I'm using Proc surveylogistic to run trend analyses with three years of weighted data (code below). I've included my linear variable along with other variables to control for. I've added a contrast line to the code but I'm getting the following error message: NOTE: Convergence criterion (GCONV=1E-8) satisfied. WARNING: More coefficients than levels specified for effect datayr. Some coefficients will be ignored.
The results show that the three years of data are included although the warning statement says otherwise. I had been looking at the 'Contrast Test Results' p value. Should I keep the contrast line? Should I instead be using the p-values from the Type 3 Analysis of Effects?
proc surveylogistic data=combined1721;
strata stratum;
cluster psu;
weight weight;
class forced_sex datayr female RACEETH4cat grade ;
model forced_sex = datayr female RACEETH4cat grade ;
contrast 'linear' datayr -1 0 1;
format RACEETH4cat RACEETH4cat. forced_sex forced_sex.;
run;
Assuming you are trying to test the linear effect using orthogonal polynomials, it is usually easier to set the PARAM= option on the CLASS statement to GLM to make sure that the coefficients match up correctly with the levels. This will also take care of the WARNING message in your case.
class datayr female RACEETH4cat grade/param=glm;
note that I removed the response variable from the CLASS statement since it is not needed.
Assuming you are trying to test the linear effect using orthogonal polynomials, it is usually easier to set the PARAM= option on the CLASS statement to GLM to make sure that the coefficients match up correctly with the levels. This will also take care of the WARNING message in your case.
class datayr female RACEETH4cat grade/param=glm;
note that I removed the response variable from the CLASS statement since it is not needed.
That worked, thank you!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.