BookmarkSubscribeRSS Feed
ED18
Calcite | Level 5

I am trying to use proc surveyreg to run a t-test for my complex survey data, but I keep getting an error stating " Variable Depression_Indicator in list does not match type prescribed for this list/ No Model Statement" 

 

This is the code I am using 

PROC SURVEYREG data=final nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
CLASS riagendr;
WEIGHT MEC4YR;
MODEL DEPRESSION_INDICATOR = riagendr/solution vadjust=none;
run;

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Is DEPRESSION_INDICATOR a character variable? What does PROC CONTENTS say?

 

To do a t-test, your Y variable must be numeric.

--
Paige Miller
SAS_Rob
SAS Employee

Given the name of your variable I am assuming that it is a categorical variable.  To compare groups for a categorical response with complex survey data you should use Proc SURVEYFREQ instead with one of the Chi-Square tests (e.g. CHISQ option on the TABLES statement.

PROC SURVEYFREQ data=final nomcar;
STRATA sdmvstra;
CLUSTER sdmvpsu;
WEIGHT MEC4YR;
TABLES DEPRESSION_INDICATOR*riagendr/CHISQ;
run;

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 2 replies
  • 1883 views
  • 0 likes
  • 3 in conversation