10-20-2017 03:31 PM
proc surveyfreq data=wdp.newzhang; tables sex*lang / wchisq; weight weight_3; run;
I have encountered a major issue when attempting to conduct a wald chi-square test of independence using survey data. Specifically, SAS would not provide the results of the wald chi-square test in the output table, which I do not understand. Therefore, I would greatly appreciate it if a knowledgeable SAS user with a certain level of experience with conducting statistical analyses using survey data could provide a feasible solution on this dilemma. Thanks in advance!
Please find below a copy of the SAS code that I have attempted to run.
10-20-2017 03:45 PM
Please explain this part in more detail:
SAS would not provide the results of the wald chi-square test in the output table
Does that mean it wasn't calculated? or displayed? Or do you want it in an output data set to use somewhere else and don't know how to do that? It would also help if you could replicate your issue using either a SASHELP data set (CLASS, CAR or HEART are good ones) so we can run the code and replicate the issue. This way we can determine if it's a data or code issue.
10-20-2017 04:07 PM
10-20-2017 04:17 PM
Right now you're using your own data,
Instead, try using a data set from SASHELP so we can run the code. We can't right now because we don't have your data. Or you can use data from the documentation.
10-20-2017 04:27 PM
Thank you for responding again. Nevertheless, I do not know whether the SASHELP datasets that you have specified earlier (e.g. class, heart, etc) are survey-based datasets.
Do you just want for me to include the same commands using another dataset using different variables than the ones that I am currently using?
proc surveyfreq data=sashelp.class;
10-20-2017 04:30 PM
Sort of. Check your log, are you seeing this message:
NOTE: Chi-square tests cannot be computed for the table of Sex by
Age because at least one table cell has 0 frequency.
NOTE: PROCEDURE SURVEYFREQ used (Total process time):
real time 0.27 seconds
cpu time 0.04 seconds
10-20-2017 04:43 PM
Yes, I do see the following comments made on the SAS log.
NOTE: Chi-square tests cannot be computed for the table of SEX by LANG because at least one table
cell has 0 frequency.
Frankly, this dataset has quite a lot of missing values. Nevertheless, I thought that using weight would have compensated for the missing values by adjusting the data to be more representative of the population. Could you provide a solution to this issue? Thanks!
10-20-2017 04:12 PM