p*****o 发帖数: 543 | 1 hey everyone,
im using proc report associated with ods tagsets.excelxp to create excel
output, but the excel file is too big (5MB -- I mean it should not be that
big). Actually if I just open the excle file and save it (without doing
anything) and then close it, the size goes down to 1MB only.
Anyone can help me how to make the excle created by SAS much smaller? |
|
s******y 发帖数: 352 | 2 Yes, But still have to work little bit harder. not sure if there are other
ways around.
proc format;
value a
0-30000 = 'a*.1'
30000-60000 = '30000*.1 + (a-30000)*.25'
60000-80000 = '30000*.1 + 30000*.25 + (a-60000)*.30'
;
run;
data test;
do a=10 to 80000 by 5000;
b='%sysevalf('||strip(tranwrd(put(a,a.),'a',a))||')';
c=resolve(b);
output;
end;
run; |
|
z****n 发帖数: 67 | 3 请问SAS中proc mixed为什么没有Rsquare的输出? 理论上可以自及计算吗?
如果没有Rsquare怎么判断模型好坏呢? |
|
h*e 发帖数: 10233 | 4 我有两个dataset,主dataset有A,B,C,D 4个column,有一个reference dataset,里面有
B,C,D,E 4个column,
我需要把两个dataset 用B,C,D merge一下,把E值加到主dataset去,但是问题是
reference dataset有一些B,C,D,E是blank value,rule是如果一个值是missing,就比较
其它的值。比如说
主dataset B=1,C=2,D=3,而reference dataset B=1,C=null, D=3,E=5, 那就直接比较B
,D,把E加到主dataset中。proc merge有这种功能吗?或者要用其它办法?多谢 |
|
h*e 发帖数: 10233 | 5 写错了,不是proc merge,就是data step merge,我就想是不是有什么option可以解决
这个问题。 |
|
R*********i 发帖数: 7643 | 6 Came in b/c of your title - "Proc merge" was a famous interview trick where
the interviewer asks how to use the procedure so that s/he can identify if
the interviewee ever used SAS. |
|
k*****u 发帖数: 1688 | 7 比如导入excel文档。excel变量名为 1st year salary ($),这种东西。 怎么改成
first_salary? 用proc datasets的modify好像不好搞
谢谢了
|
|
|
o****o 发帖数: 8077 | 9 很多回归的PROC都能算CI,还能指定alpha |
|
|
S********a 发帖数: 359 | 11 正在做generalized linear mixed model with Poisson distribution, 目前理解是用proc glimmix procedure in SAS or lmer in R, 谁能给推荐一下这方面的书,最好有例子的,谢谢 |
|
z**********i 发帖数: 12276 | 12 SAS for Mixed Models?
code and examples.
我是用NLMIXED做的。
用proc glimmix procedure in SAS or lmer in R, 谁能给推荐一下这方面的书,最好
有例子的,谢谢 |
|
b*********l 发帖数: 466 | 13 How to produce tabular format table without using proc tabulate?
Tabular format is like the following:
|--------+-------------+--------------+--------+-----------+------------|
|lbtest| aaaaaa | bbbbbb |ccccc |ddddd |eeeeee |
|--------+-------------+--------------+--------+-----------+------------| |
|
R*********i 发帖数: 7643 | 14 Not sure if I understand your question - proc report? |
|
b*********l 发帖数: 466 | 15 Just want to produce a tabular table.
If use proc report. is there any options to add the tabular format? |
|
p**5 发帖数: 2544 | 16 谁能看看这个error?谢谢
191
192 PROC IMPORT OUT= WORK.text
193 DATAFILE= "D:\Journal\2009_IF.xls"
194 DBMS=EXCEL REPLACE;
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
195 GETNAMES=NO;
NOTE: The previous statement has been deleted.
196 DATAROW=5;
-------
180
ERROR 180-322: Statement is not valid or it is used out of pr... 阅读全帖 |
|
d******9 发帖数: 404 | 17 Question 2:
C is correct. 5 obs because SQL built a Cartesian product.
See the below SAS output.
data one;
input year $ qtr budget;
cards;
2001 3 500
2001 4 400
2002 1 700
;
run;
data two;
input year $ qtr sales;
cards;
2001 4 300
2001 2 200
2002 1 600
;
run;
proc sql;
select one.*, sales
from one, two
where one.year = two.year;
quit;
======================
The SAS System 23:32 Wednesday, April 1, 2009 1
year qtr budget sales
... 阅读全帖 |
|
p********a 发帖数: 5352 | 18 记得以前有谁发过。我有一堆数据,需要用MACRO做无数个PROC REG,然后提取R2,
REGRESSION 系数。
谢谢 |
|
A*******s 发帖数: 3942 | 19 用ods output tables
一般来说搞多次proc reg
用by statement代替macro更有效率一些
而且前者生成的相关output table就一个 |
|
d*******o 发帖数: 493 | 20 要是我就会用proc fcmp写三个对应R-square, P, coefficient的user-defined
functions. 这样效率应该最高。 |
|
w****g 发帖数: 81 | 21 1.
since subquery is less efficient.
you can try to use "proc sql stimer;" to compare. |
|
d****z 发帖数: 301 | 22 一直折腾不出来.好几个月了.
牛细胞生长情况, 有两种细胞,3个时间点,每个有两个重复.
想找出差异表达的基因...
结果一直疯狂报错:
warning: Stopped because of infinite likelihood.
跪求建议意见!!!!
proc mixed data=long;
class rep genotype time;
model y=rep genotype time genotype*time /outp=check;
random rep*time;
lsmeans genotype*time;
ods output tests3=results;
ods output lsmeans=lsmeans;
by gene;
run; |
|
w*****n 发帖数: 375 | 23 Your random statement might be wrong, and I suspect that you don't
have enough degrees of freedom to estimate so many parameters.What's
your sample size?
Generate variable "id", which has two reps, and try the following
simple model first:
proc mixed data=long;
class id genotype time;
model y = genotype time genotype*time /outp=check;
random intercept/sub = id;
lsmeans genotype*time;
ods output tests3=results;
ods output lsmeans=lsmeans;
by gene;
run; |
|
w******4 发帖数: 488 | 24 I think this is a split-plot design, where genotype is the whole-plot factor
, time is the sub-plot factor. You can try this:
proc mixed data=long;
class rep genotype time;
model y=genotype time genotype*time /outp=check;
random rep(genotype);
lsmeans genotype*time;
ods output tests3=results;
ods output lsmeans=lsmeans;
by gene;
run; |
|
l***a 发帖数: 12410 | 25 how to do this in proc sql? |
|
|
b*******g 发帖数: 170 | 27 我以前碰到类似的问题,后来用PROC LOGISTIC做的,就能用MIANALYZE了。 |
|
m******t 发帖数: 44 | 28 已经解决谢谢大家
在proc mianalyze的输入里面加上一个parainfo就行了 |
|
s***r 发帖数: 1121 | 29 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 ... 阅读全帖 |
|
l*u 发帖数: 114 | 30 乱写一个, 不知道对不对
proc sql;
select DISTINCT PlantUniqueID from dataset1 dataset2 dataset3
where dataset1.PlantUniqueID = dataset2.PlantUniqueID = dataset3.
PlantUniqueID
and dataset1.date1 = dataset2.date2 - 5
or dataset1.date1 = dataset2.date3 + 10
quit; |
|
l***a 发帖数: 12410 | 31 的histogram?
如果只是数字的话proc freq很方便,可是如果category很多的话不够直观。freq的
plots提供的图都不是我想要的。。。我感觉这应该是个很简单的功能,但是我从没用过 |
|
l***a 发帖数: 12410 | 32 麻烦的办法只能先这样output再gplot/sgplot之类的,就是想知道有没有哪个proc(
means,report,freq,univeriate,etc)有没有现成的option |
|
w*******e 发帖数: 666 | 33 proc sql ;
create table two as
select * from one
where hist like '%STR%' or hist like '%ST1%' or hist like '%ST2%';
quit;
写了上面的code,但是sas报错:
ERROR: Expected open parenthesis after macro function name not found.
和WARNING: Apparent invocation of macro ST2 not resolved。
请问如果想选出变量hist里包含STR 或者 ST1 或者ST2字符,该怎么修改上面的code呢
?非常感谢! |
|
a********s 发帖数: 188 | 34 Just as a reference: I did not use genmod for multinomial before, but did
use PROC LOGISTIC with option GLOGIT (generalized logit model), and specify
PREDPROB = I to get each level probabilities. |
|
a********s 发帖数: 188 | 35 I am not sure about SAS PROC PHREG, but in a general Bayesian modeling, say,
Y = beta0 + beta1*X;
we can specify a normal distribution like
beta0, beta1 ~ N(0, 1E5)
Both reference level and other levels should have priors. They could be the
same, or they can be different. |
|
d**********o 发帖数: 1321 | 36 和你查的一样,
proc gchart data=xxx;
vbar varname / midpoints='value1' 'value2';
run; quit;
不work没道理啊? |
|
P****D 发帖数: 11146 | 37 Do you also have ORDER= or ASCENDING or DESCENDING options in the same PROC?
These options override the order you specify in MIDPOINTS=. |
|
y***e 发帖数: 6 | 38 I have five variables, A, B, C, D and E, the value for each variable is
either 1 or missing. I want to count the frequency of "1" in each variable
and make a better looking output like this:
1 .
----------------
A 5 8
B 5 1
C 87 0
D 6 5
E 18 5
When using the proc tabulate, I can only put the A - E variable in the
column instead of row. Asking for help! Thanks! |
|
a****g 发帖数: 8131 | 39 yes
you can use proc tabulate for this |
|
z**********i 发帖数: 12276 | 40 把你的数据转换一下,类似这样的CODE可以.
proc freq data=;
weight count;
tables * /chisq ;
run; |
|
k*****u 发帖数: 1688 | 41 y~一堆x,某些x离散,某些x连续,所以用glmselect来选择变量
但是glmselect好像没有cookd和vif。还是它有我自己没找出来?因为要找outlier
知道的同学帮忙回答一下。谢谢
或者我是不是要用proc mixed来求cookd然后再找outlier?
谢谢 |
|
s***n 发帖数: 392 | 42 请高人指点……
我用cox proportional hazard model分析cohort数据,outcome是death,用proc
phreg。前人发给我的一个model是这么写的:
exit_age*death= X Y Z/entry=entry_age
其中exit_age和entry_age分别是每个人出、进cohort的年龄。我觉得这个model没有
adjust for age,就把entry_age也写到model等号右边去了,作为第四个covariate。
结果,这个entry_age的effect算出来竟然是负的——年纪越大,死亡率越低,这显然
不合理。
于是我自己算了个exit_time(用exit_age减去entry_age),把model写成:
exit_time*death= X Y Z entry_age
这样entry_age的effect就是正的了,两个model的X Y Z的parameter estimate倒是差
不多。但是我想不通的是,为什么用第一个model,再adjust entry_age就错了呢?这
两个model的区别究竟是什... 阅读全帖 |
|
t********1 发帖数: 799 | 43 i use proc means to get the std dev of a var in dataset.
now I want to pass the std value to a macro var, in order to calculate
others in the following formula. How can I complete this? |
|
L****n 发帖数: 3545 | 44 or proc sql select into :var |
|
z**********i 发帖数: 12276 | 45 什么MODEL? PROC GENMOD能拿到STARTING VALUES吗?
0.
by |
|
|
e*******e 发帖数: 75 | 47 Hi,
I have a variable "Parameter" as follows :
Parameter
Race
WHITE
BLACK
OTHER
GENDER
FEMALE
MALE
AGE
>50
<50;
I used proc report to generate a table of this variables. However, all the
spaces of the variable values are gone and all the values are aligned:
Parameter
Race
WHITE
BLACK
OTHER
GENDER
FEMALE
MALE
AGE
>50
<50;
How can I keep the space in those values and output it to rtf document?
Thank you very much. |
|
p******s 发帖数: 229 | 48 There are 2 datasets, A and B. There is a variable called drug_id in each
dataset. How can we join thess 2 datasets and exclude drug_ids that exist
in B?
I know how to do it in DATA step (merge A (in=a) B (in=b); by drug_id; if a
and not b; run;), but have no idea how to do in PROC SQL.
Thank you. |
|
|
m*****y 发帖数: 229 | 50 I think the idea of hehehe is correct, but not necessary left join I think.
DATA A;
INPUT drug_id x;
datalines;
1 2
;
data B;
input drug_id y;
datalines;
1 4
;
proc sql;
select A.drug_id, x, y
from A,B
where A.drug_id=B.drug_id;
quit;
result:
drug_id x y
1 2 4
drug_ |
|