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-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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