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;
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.