由买买提看人间百态

topics

全部话题 - 话题: variable1
(共0页)
d*******2
发帖数: 340
1
来自主题: Computation版 - 请问C语言fscanf的用法
没有error message. 用
cout << "variable1: " << variable1 << endl;
cout << "variable2: " << variable2 << endl;
看,
variable1: 1
variable2: 7.7433e+268
variable1,variable2是double型. (double variable1,variable2;)
a*****b
发帖数: 2789
2
来自主题: Statistics版 - SAS 问题求助,有包子
我有N多个observation,已经读入为sas data。如下
variable1
11
22
33
44



12
13
14



我现在想比较variable1的相邻observation之间的关系。比如obs3 继续向下比较(实际情况很复杂)。想用数组来做。不知道可不可以把variable1下面的
所有数据定义成数字型数组,比如variable1(i)代表第i个数,然后我在data里面做
循环?array好像是循环变量的,对变量值不好操作,而且我又不方便把variable1转成
n个新变量。
请问应该如何定义?需要用到的proc或者function是什么?谢谢
m**i
发帖数: 51
3
比如variable a 和 variable b 如下:
variable1 variable2
classmate mate
desk chair
photo or
如果 variable2完全包含在variable1里面, 则t=1,否则t=0. 输出应该是
variable1 variable2 t
classmate mate 1
desk chair 0
photo own 0
试过index 和 find 都不行
z8
发帖数: 350
4
菜鸟问个sas问题,在一个variable中,有些observations 是 missing, 如果把非
missing的值给这些missing的呢?非常感谢
具个例子
variable1 variable2
aa .
aa 1234
aa .
bb .
bb 12345
bb 12345
cc .
cc .
cc 123456
最终成为
variable1 variable2
aa 1234
aa 1234
aa 1234
bb 12345
bb 12345
bb 12345
cc 123456
cc 123456
cc 123456
p***e
发帖数: 118
5
现在有个data,其中一个variable1的value
是 variable
1. ABC
2. BBC
3. DDD
4. DAD
现在想用variable1 建立一个新的variable2
variable2
1. “ABC"
2. "BBC"
3. "DDD"
4. "DAD"
就是说在variable的值两边加上双引号
请问怎么做??
谢谢
e*****i
发帖数: 46
6
来自主题: Statistics版 - 请教一个问题,关于proc freq
一个dataset,有Variabel(它的值从1到50) 和 Variable2(它的值是1、2、3),
Considering only those who had Variable1 greater than 20, what percentage of
them remained Variable2=3?
我是用
proc freq data=new;
table Variable1*variable2/missing;
run;
可是这样还要手动去加,有没有其他的命令可以直接把大于20的percentage列出来?
求指教~~~~
d*o
发帖数: 108
7
来自主题: Database版 - distinct in select
general SQL syntax questin:
select distinct variable_name from table_1 , table_2
where variable1 = variable2;
the problem for me is: I want to use 'distinct' for table 1; i.e. no
duplicate rows are used but I do NOT want to use 'distinct' for
table 2. What is a correct way in SQL?
y****9
发帖数: 144
8
来自主题: Database版 - SQL Server - delcare variable dynamically

Thank you for your input, but it seems not what I want. basically I am doing:
fetch next from mycur
into @variable1,@variable2 ...
However I need to build the variable list dynamically.
The whole procedure looks like this:
1. pass a query text to a procedure (like: select * from sys.objects)
2. In this procedure I open a cursor for the query
3. I need to process this cursor row by row
4. for each row, i want to refer to each column to do sth on the column.
You can see the column names will be ... 阅读全帖
l*****r
发帖数: 15615
9
来自主题: Programming版 - python question, easy one
in a communication task, the python script received the data buff as a list
of bytes.
since python tool was used to do the communication with embedded software,
which were written in C/C++;
so the message were definded in c as type of structure, for example
struct
{
unsigned long variable1;
unsigned char variable2;
unsigned char variable3[4];
...
}MessageType
in stead of writing a function in python to decode the message buffer byte
by byte: forming four bytes into unsigned long/int; and etc.
i... 阅读全帖
d*******2
发帖数: 340
10
来自主题: Computation版 - 请问C语言fscanf的用法
FILE *pFile;
pFile=fopen("myfile.txt","r");
fscanf(pFile,"%e, %e, %e, %e",&variable1,&variable2,&variable3,&variable4)
fclose(pFile);
myfile.txt
4.232e-002, 4.232e-002, 4.232e-002, 4.232e-002
为什么不对呢?
先谢了!
o******6
发帖数: 538
11
来自主题: Statistics版 - [合集] sas analysis question
☆─────────────────────────────────────☆
sxcat111 (hihi) 于 (Wed Mar 4 13:54:46 2009) 提到:
If I want to know the difference between variable1 and variable2 adjusting
variable3, variable4 and variable5. What kind of SAS procdure I should use?
I think I need to do the regression.
Thank you very much!
☆─────────────────────────────────────☆
libra (秤子) 于 (Wed Mar 4 13:57:28 2009) 提到:
what do you mean "adjusting variable3, variable4 and variable5"? don't get
you

?
☆─────────────────────────
z**k
发帖数: 378
12
data a;
input v1 $ v2;
datalines;
aa .
aa 1234
aa .
bb .
bb 12345
bb 12345
cc .
cc .
cc 123456
;
proc sql;
select t1.v1 as variable1, t2.v2 as variable2
from (select v1 from a) as t1,
(select distinct v1, v2 from a
where v2 is not missing) as t2
where t1.v1 = t2.v1;
如果你可以保证每个group至少有一个非missing值的话
s***r
发帖数: 1121
13
来自主题: Statistics版 - proc sql - SAS 10 包子请教
How can I merge 3 datasets using PROC SQL?
Dataset 1:
Plant date1 Variable1
Unique YYYYMMDD
ID
001 20060914 .....
001 20080801 .....
001 20080822
001 20100101
002 20011119
002 20020101
002 20030808
003 20091212
005 20000816
005 20001225
005 20010205
005 20030203
005 20030501 ....
...
...
....
Dataset 2:
Plant date2 Variable2
Unique YYYYMMDD
ID
001 20050314 ... 阅读全帖
w*****9
发帖数: 122
14
来自主题: Statistics版 - sas 中如何给一个variable 加密?
if variable1='subject' then variable2='abc'?
s******5
发帖数: 513
15
来自主题: Statistics版 - SAS if 问题一个
看到一行程序,
if variable1 and variable2;
没有then statement,google了一下,没找到解,问一下哈~~
k*******a
发帖数: 772
16
index(variable1, trim(variable2))
a*****9
发帖数: 1315
17
variable3=cat(variable1 variable2)
if find(variable3,'c')
run;
试试cat function , 对character 很有用。
k*******a
发帖数: 772
18
variable2='"'||strip(variable1)||'"'
k*******a
发帖数: 772
19
来自主题: Statistics版 - 请教一个问题,关于proc freq
proc freq data=new;
where variable1 > 20;
table variable2/missing;
run;
p***e
发帖数: 118
20
来自主题: Statistics版 - SAS Proc Rank 的问题急问
proc rank data=a1 out=a2 groups=50 descending ties=dense;
by variable1 variable2 ;
var variable3;
ranks variable4;
run;quit;
出来结果,有的最小是0,有的最小是1。。。。
(共0页)