- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the population data to obtain the proportions of the population in each category. For example, your population might have 10% Asian, 40% black, and 50% white.
Then use those numbers on the TESTP= option on the TABLES statement in PROC FREQ:
proc sort data=Have out=Sample;
by Race; /* assume values are Asian, Black, and White */
run;
proc freq data = Sample order=data;
tables Race / nocum chisq
/* If population proportions are for Asian, Black, and White */
testp=(0.1 0.40 0.5);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rick,
I think I understand what you are saying, but when I look at that document, it shows two Chi-Square test,( one for each region). I am only wanting to do one Chi-Square test, based off two different groups. I have attached a document that shows the frequency of sex, Females and Males,in Case group, as well as the frequency of sex3, Females and Males, in Case3 group. Since they are in two different data sets, how would I code this?
*I will exclude the Unknown values before analysis, but I am more interested in how to set up the code right now
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The two groups will need to be in the same data set, with an indicator variable that defines which group the observation belong to. That group variable would then appear on the TABLES statement.
So for example, if you wanted to test if the distribution of race across the two groups was the same, then you would have:
tables group*race/chisq;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What is the response variable here? I must have missed that Anyhow, if there is a date on every record, you can code in a flag based on the cutoff date. I think you can ignore observation ID in the PROC FREQ analysis. If you become interested in a more complex/complete approach, you might be able to use PROC GENMOD with a GEE model to test for the time segment equality/homogeneity.
SteveDenham
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
Thank you. Do you have any references or suggestions on how I code it based on the cutoff date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There are probably 50 threads on how to do that, especially in the Programming forum. Search and you will find.
SteveDenham