BookmarkSubscribeRSS Feed
johnrizk
Calcite | Level 5

Hi everyone, 
I have a question about PROC surveyreg.

I am using a dataset where treatment (1 or 2)  is the independent variable. I am assuming 2 stages of sample selection.

PSU indicates the first stage sampling unit, and SSU the second stage sampling unit. The SSUs are nested within the PSUs.

The PSU are nested within stratum. Stratum is a PSU-level stratification variable.

I wanted to ask if I'm using the correct SAS code:

proc surveyreg data=output.surv627;
Class stratum PSU SSU treatment;
Model Y = treatment|stratum / solution;
Strata stratum;
Cluster PSU SSU;
Weight weight;
run;

 

1 REPLY 1
ballardw
Super User

Strata and Cluster variables do not belong on the Model statement and will generally throw an error to that effect. I suspect similar with appearance on a CLASS statement. Those variables are supposed to describe the sample design.

You can cheat and use the values by adding another variable with the same value for the model statement but may be a bit flaky for some purposes.

 

If you only have two levels of treatment you likely don't want surveyreg. The procedure is more for continuous, or at least values that are somewhat continuous independent and dependent values.

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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