BookmarkSubscribeRSS Feed
sajama
Calcite | Level 5

Hi,

 

I am sajama. I am using DHS data for my dissertation and using SAS studio for it. I needed to calculate krushall wallis and mann whitney u test using complex sample in SAS? could you please help me on this with the codes. I am new in SAS and when I tried using surveyfreq command, something goes wrong everytime. I have already generated complex sample (CS) plan watching DHS video and I could get the frequency with CS plan but not K test, May be I am wrong somewhere in the organizing the command. 

 

I don't have idea if I should run the complex sample command and test command in one go or saparately?

I tried using the below command:

proc surveyfreq data=NDHSSAS.DHS wilcoxon plots(only)=(wilcoxonboxplot);
class HV007;
var Stunting;
where hv103=1 and HC33=1 and HC1 >=0 and HC1<=59 and HV025=1;
weight WGT;
cluster hv021;
stratum hv022;
run;

 

But could not get the result. 

I will really appreciate your help.

Thank you in advance.

1 REPLY 1
ballardw
Super User

"Something goes wrong" is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

When I look at the syntax reference for Surveyfreq I do not see a WILCOXON or Plots option.

 

Other potential issues involve use of strata and clusters without telling the procedure any information about the primary sampling units in the sample frame.

 

There is no Class statement is Surveyfreq. Possibly you meant By.

There is no VAR statement, TABLES requests summaries for the variable or variable combinations. or possibly you wanted Tables Stunting*HV007.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1238 views
  • 0 likes
  • 2 in conversation