- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I need help to analyze the dependence of the objective function (variable: "cus12") on independent variables. I have data that has 1000 columns and the independent variables are divided into 4 groups: app_x, act_x, agr_x, ags_x. I probably need to write a loop to investigate the dependence of the variable "cus12" on variables from the given groups. I have a problem with writing such a loop and entering the appropriate "proc" in it.
I don't know how to start. My idea is as follows: 1. I think I should build a macro and a loop (but all the loops I build don't work). 2. I think I should parse the dependency using "proc logistic" but and don t have macro and loops so I can't try to do anything inside. 3. I wanted to use the Chi-Square and Cramer's V test, but without a good start, I can't try anything else. I am a beginner in SAS. Any help/advice will be useful.
Can I give changing variables here? If yes, How?
proc freq data = my.credit;
tables ConstansVariable * variable_x / chisq;
output out= data cramv;
run;
I think about put this proc to loop but I don t know how...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1. Show us some sample data. No need for 1000 dependent variables, but please provide 8 or 12 (two or three sets of 4) so we can see the structure of the names. Do the groups of four have a common prefix or suffix?
2. Cramer's V is a measure of association between nominal variables. As you indicate, it is produced by PROC FREQ when you use the CHISQ option on the TABLES statement.
3. What do you intend to do with these 250 Cramer V statistics after you have estimated them? Presumably, you are not going to look at 250 tables on the screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Now i have something like that. (I don t know if it's ok)
%macro crammer_num;
%do i=1 %to %sysfunc(countw(&num_name_list));
%let next_name=%scan(&num_namelist,&i);
data zm&next_name;
set &zbior(keep= &fun &nextname);
run;
proc freq data=zm&next_name noprint; tables &fun*&nextname/chisq;
output out=vcram&nextname cramv;
run;
data vcram&nextname;
set vcram&next_name;
zmienna ="&nextname";
vcram = abs(cramv);
run;
data vcram;
set vcram vcram&next_name;
run;
%end;
%mend crammer_num;
%crammer_num;
Part of data in file.