I am using the National Survey of Children's Health (NSCH) 2020, 2021, and 2022 datasets for an analysis.
Essentially, I am trying to use multiple imputation for federal poverty level (FPL) variable. From there, I was trying to construct a multivariate logistic regression model to estimate adjusted odds ratios with 95% confidence intervals and P values. However, when I try to run the proc mianalyze statement, I obtain the following error message:
Within-imputation StdErr missing for variable estimate in _Imputation_= 4 in the input DATA= data set.
Here is my code:
data stacked;
set work.nsch20_22;
array fpli{6} fpl_i1-fpl_i6;
do _Imputation_=1 to 6;
fpl_i=fpli{_Imputation_};
if fpl_i < 100 then povcat_i = 1;
if 100<=fpl_i<200 then povcat_i = 2;
if 200<=fpl_i<400 then povcat_i = 3;
if fpl_i>=400 then povcat_i = 4;
output;
end;
run;
proc sort data=stacked;
by _Imputation_;
run;
proc surveylogistic data=stacked;
strata stratum fipsst;
cluster hhid;
weight fwc20_22;
by _Imputation_;
class AgeCategory Sex_Logistic Race_Logistic BORNUSA_Logistic CURRINS_Logistic
YEAR SC_HISPANIC_R HIGRADE_TVIS povcat_i / param=glm;
model SickleCell_Binary(event='1')=AgeCategory Sex_Logistic SC_HISPANIC_R Race_Logistic
povcat_i HIGRADE_TVIS BORNUSA_Logistic CURRINS_Logistic YEAR / link=logit
technique=fisher;
ods output parameterestimates = parms ;
run;
proc sort data=work.parms;
by _imputation_; *NOTE: if I ever add the response variable (SickleCell_Binary) in the BY statement, an error message will appear that the response variable cannot be found in the dataset, so I have been only keeping _imputation_ in the BY statement. Is this the source of the problem/can you help me with this please?;
run;
proc mianalyze data=parms;
modeleffects estimate;
stderr stderr;
ods output parameterestimates=MI_parms;
run; *NOTE: this is when I receive the error message that the within-imputation StdErr is missing;
data OR;
set MI_parms;
OR=exp(estimate);
lower_or=exp(LCLMean);
upper_or=exp(UCLMean);
keep comparison OR lower_or upper_or;
run; *NOTE: I have never been able to get to this set of code. However, would this code give me adjusted odds ratios with 95% confidence intervals along with P values??;
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.