Question
. A researcher would like to compare the observed newborn weights (DBWT), converted to pounds, for the following three groups of individuals: (1) newborns whose
.
A researcher would like to compare the observed newborn weights (DBWT), converted to pounds, for the following three groups of individuals: (1) newborns whose mothers developed gestational diabetes but did not have pre-pregnancy hypertension; (2) newborns whose mothers developed gestational diabetes and had pre-pregnancy hypertension; and (3) newborns whose mothers did not have/develop any of the following - gestational diabetes, gestational hypertension, pre-pregnancy diabetes, and pre-pregnancy hypertension. Report the means and standard deviations of the newborn weights for only these three groups of individuals in a single SAS table, and test whether the means of the first two groups of individuals, (1) and (2) above, are different from each other at the 5% significance level (you can assume the underlying population distributions of these groups of individuals are normally distributed for the purpose of this test). Finally interpret the results of this test. [40 points]
I'm having issues getting the paired t-test to work on SAS.
* Read the dataset and keep relevant variables */ data natl2017; set '\\apporto.com\dfs\CLT\Users ame\Desktop atl2017'; keep DBWT RF_GDIAB RF_EHYPE RF_PDIAB RF_GHYPE; run;
/* Convert grams to pounds */ data NewbornWeights; set natl2017; DBWT_lbs = DBWT / 453.59237; /* Conversion factor: grams to pounds */ run;
/* Filter data for the three groups */ data Groups; set NewbornWeights; if RF_GDIAB='Y' and RF_EHYPE='N' then Group = 'Group1'; else if RF_GDIAB='Y' and RF_EHYPE='Y' then Group = 'Group2'; else Group = 'Group3'; run;
/* Calculate means and standard deviations */ proc means data=Groups mean std; var DBWT_lbs; class Group; run;
/* Generate histogram for visual analysis */ proc univariate data=Groups; var DBWT_lbs; histogram / normal; run;
/* Perform t-test for Group 1 vs Group 2 */ proc ttest data=Groups h0=0 plots=none side=u; class Group; var DBWT_lbs; title 'Paired t-test between Group1 and Group2'; paired Group1*Group2; run;
error messages: ERROR: Variable GROUP1 not found. ERROR: Variable GROUP2 not found
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started