由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 包子问题请教( sas)
相关主题
关于stepwise programminghelp!! help!! SAS help!! Urgent!!
请问如果用SAS 解决这个问题SAS BASE 官方sample 第三题 求解析 谢谢!
请教proc sql处理missing value的问题[合集] └ Re: 关于stepwise programming
请问SAS中如何通过组内一个变量的值控制整组变量怎样储存我想要的proc means 的结果?
How to change sas dataset column order请教关于SAS表格输出的问题
弱问一个SAS里面求adjusted means的问题Proc Surveyselect中, 当 reps >=2 时, 样本重复
在SAS里如何用array或者macro改进这段程序?求指教!关于lasso的variable selection问题
help about initial value in retain statement[急求助] survival analysis (SAS)
相关话题的讨论汇总
话题: proc话题: sas话题: 因变量话题: step话题: stepwise
进入Statistics版参与讨论
1 (共1页)
q**********9
发帖数: 711
1
有好几十个因变量(predictor,我的变量名字没有规律,不像x1-x99),想做一个stepwise
-regression, 要把这几十个因变量的 two way interaction term 都要作为因变量放
进去.程序怎么写?
要是用 proc Reg; 的话,要先添加two way interaction term 作为新的因变量,平时就
是用sas做作业,直接定义x1x2 = x1*x2就可以了,但是对于大批量数据怎么弄?
谢谢!
双黄包
c**d
发帖数: 104
2
in the model: y = var1|var2|var3|var4 @2 /stepwise;
give you all 2-way interactions.
1. using proc contents output the variable name data
2: using proc sql to create a macro variable to paste your variables to be
var1|var2|var3|var4|.....
3: in the model y = &varlist. @2 /stepwise;
q**********9
发帖数: 711
3
proc glm 可以用 model y = var1|var2|var3|var4 @2;
但是option 里没有stepwise选项,
proc reg 有stepwise 选项,但是不能用 model y = var1|var2|var3|var4 @2这个命令,
我的sas 里没有proc glmselect 命令,现在该用哪个 proc 命令呢?

【在 c**d 的大作中提到】
: in the model: y = var1|var2|var3|var4 @2 /stepwise;
: give you all 2-way interactions.
: 1. using proc contents output the variable name data
: 2: using proc sql to create a macro variable to paste your variables to be
: var1|var2|var3|var4|.....
: 3: in the model y = &varlist. @2 /stepwise;

c**d
发帖数: 104
4
楼主给了包子,要负责到底。
1. 试试能不能下载:http://support.sas.com/rnd/app/da/glmselect.html
2. 如果不能,write a macro or use R
3: update SAS to 9.2 or later
/* step 1: generate all Combinations */
/* use the macro from SAS */
/* http://support.sas.com/techsup/technote/ts498.html */
%combo(2,a,b,c)
proc sort data = combo;
by v1 v2;
run;
/* step 2: create interaction Equations*/
data combo;
set combo;
length eq $100;
eq = cat("it_", strip(put(_n_,8.)),
'=', strip(v1), '*', strip(v2));
run;
/* step 3: assign those equations to macro var1 to var999 */
/* using data step or sql: &&eqlist_&i.*/
/* step 4: in data step, call those macros variables to */
/* calculate all interactions */
%macro a;
data new;
set old;
%do i = 1 %to 999;
&&eqlist_&i.;
%end;
run;
%mend;
/* step 5: use proc reg */
/* interacions */
q**********9
发帖数: 711
5
哇,好详细,谢谢.
我下了 glmselect, 但这个只能基于9.1及更新的版本,我的sas是9.0.
明天按你下面的方法再试试,
非常感谢认真负责的回帖,再接个双簧包

【在 c**d 的大作中提到】
: 楼主给了包子,要负责到底。
: 1. 试试能不能下载:http://support.sas.com/rnd/app/da/glmselect.html
: 2. 如果不能,write a macro or use R
: 3: update SAS to 9.2 or later
: /* step 1: generate all Combinations */
: /* use the macro from SAS */
: /* http://support.sas.com/techsup/technote/ts498.html */
: %combo(2,a,b,c)
: proc sort data = combo;
: by v1 v2;

1 (共1页)
进入Statistics版参与讨论
相关主题
[急求助] survival analysis (SAS)How to change sas dataset column order
请问sas中一个变量的内容被两个左斜杠(/)分成了三部分弱问一个SAS里面求adjusted means的问题
怎样用R定位变量的位置在SAS里如何用array或者macro改进这段程序?求指教!
怎样用R除掉DUPLICATED RECORDhelp about initial value in retain statement
关于stepwise programminghelp!! help!! SAS help!! Urgent!!
请问如果用SAS 解决这个问题SAS BASE 官方sample 第三题 求解析 谢谢!
请教proc sql处理missing value的问题[合集] └ Re: 关于stepwise programming
请问SAS中如何通过组内一个变量的值控制整组变量怎样储存我想要的proc means 的结果?
相关话题的讨论汇总
话题: proc话题: sas话题: 因变量话题: step话题: stepwise