Hello Gurus,
I'm trying to impute height & weight of row 128 in this dsn but not sure what I am missing.... I can't seem to impute these 2 columns in obs 128. Any ideas?
DATA HEART;SET SASHELP.HEART;RUN;
PROC PRINT DATA=HEART(FIRSTOBS=126 OBS=130);TITLE 'BEFORE IMPUTING';RUN;
proc mi data=HEART seed=12345 nimpute=5 out=HEART_mi; var HEIGHT WEIGHT;RUN;
PROC PRINT DATA=HEART_MI(FIRSTOBS=126 OBS=130);TITLE 'AFTER IMPUTING';RUN;
Thanks.
Look at the Missing Data Patterns table:
It shows that there are two observations for which BOTH Height and Weight are missing. The imputation does not impute those records. For other records, the procedure can estimate the joint distribution of Height and Weight and conditionally impute one missing value when the other variable is nonmissing.
One way to get imputed values when both Height and Weight are missing is to include a third variable. For example, if you think that joint distribution of heights and weights might be dependent on the SEX variable, you can use
proc mi data=HEART seed=12345 nimpute=5 out=HEART_mi;
class SEX;
var HEIGHT WEIGHT SEX;
FCS;
RUN;
Look at the Missing Data Patterns table:
It shows that there are two observations for which BOTH Height and Weight are missing. The imputation does not impute those records. For other records, the procedure can estimate the joint distribution of Height and Weight and conditionally impute one missing value when the other variable is nonmissing.
One way to get imputed values when both Height and Weight are missing is to include a third variable. For example, if you think that joint distribution of heights and weights might be dependent on the SEX variable, you can use
proc mi data=HEART seed=12345 nimpute=5 out=HEART_mi;
class SEX;
var HEIGHT WEIGHT SEX;
FCS;
RUN;
Please help with this probelem
Tabulate the percent of observations in the SASHELP.HEART dataset that have non-missing values for all the predictor variables that you will use in later analyses: AgeAtStart, BP_Status, Chol_Status, Cholesterol, Diastolic, Height, MRW, Sex, Smoking, Smoking_Status, Systolic, Weight, and Weight_Status.
Since this sounds like a school assignment, I will give you a hint rather than a complete SAS program. You can get your answer by reading the article "Count the number of missing values for each variable."
The article shows how to get counts. To get percentages also, just remove the NOPERCENT option on the TABLES statement in PROC FREQ.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.