I am struggling to create a prevalence diabetes graph with confidence intervals using the survey reg procedure (my data has survey weights. Note= diabetes prevalence can we used as a continuous variable)
I am using the following code:
ods graphics on;
proc surveyreg data= mydata;
model diabetes=sex/ clparm;
thank you for your prompt help, it is much needed!
Hi: The PROC SURVEYREG documentation describes how you use can use ODS GRAPHICS with this procedure: https://go.documentation.sas.com/doc/en/statcdc/14.2/statug/statug_surveyreg_details54.htm
As shown in the documentation, using various statements will cause PROC SURVEYREG to automatically produce graphics. I don't see the PLOTS= option in your code so I wonder whether you might need a PLOTS= option. When I run the example from the doc using the FARMS data (which has both a STRATA and a WEIGHT statement, the default plot that I get is a bubble plot without using the PLOTS= option. This might be a question that is better worked with Tech Support so they can look at your data and your code and help you figure out the correct SURVEYREG syntax for what you want to do..
The SURVEYREG example 120.4 is the one I used https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_surveyreg_examples04.htm and I got a bubble plot as shown in the documentation.
I would like to see some examples of the value of Diabetes.
Surveyreg, like Proc Reg is more designed to have more or less continuous independent and dependent variables. As in predicting how much change the dependent variable is associated with a change in the independent. Sex, especially as a class variable, typically does not have that sort of behavior.
If your diabetes variable is actually a 0/1 type coding (or similar) for does not have diabetes/has diabetes then you probably should be looking to SurveyLogistic.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.