《数据分析与Stata软件应用(微课版)-上机实训参考答案第4章 数据的均值比较、推断与Stata实现.docx》由会员分享,可在线阅读,更多相关《数据分析与Stata软件应用(微课版)-上机实训参考答案第4章 数据的均值比较、推断与Stata实现.docx(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、上机实训参考答案1.在某项医学试验中,对不同的群体测定尿铅含量,选定24个观测个案,将这24名观测 个案分为男女两组,同时观测个案可分为3个年龄组。数据详情如表4-8所示。数据中包 含3个变量,即测定结果(result).性别(sex,取值为1和2, 1代表男性,2代表女 性)和年龄组(age,取值为1、2和3,分别对应青年组、中年组和老年组)。表4-8实训第1题数据idresultsexage12.411122.901132.751142.231153.671264.491275.161285.451292.0613101.6413111.0613120.7713132.8021143.04
2、21151.8821163.4321173.8122184.0022194.4422205.4122211.2423221.8323231.4523240.9223导入数据,形成名为xiti3.dta的数据文件idresultsexage112.4111 4r 42.911332.7511442.2311SS3. 712664.4912775.1612885.4S12992.06131010l.41311111.06131212.771313132.82114143.04211SIS1.882116163.432117173.8122181842?19194.442220205.4122212
3、11.24232 22 21.832323231.4S232424.9223(1)不同性别的观测个案尿铅含量是否存在显著差异。.ttest result, by(sex)Two-sample t test with equal variancesGroupObsMeanStd. Err.Std. Dev.95% Conf.Interval1122.8825.44085511.5271671.9121843.8528152122.854167.40786671.4128921.9564583.751875combined242.868333.29370921.4388752.260753.475
4、917diff.0283333.6005901-1.2172141.273881diff :=mean(l)-mean(2)t =0.0472Ho: diff = 0degreesof freedom =22Ha: diff 0Pr(T |t|)=0.9628Pr(T t)=0.4814(2)不同年龄组的观测个案尿铅含量是否存在显著差异。.anova result ageNumber of obs Root MSENumber of obs Root MSE24R-squared= 0.8597.563977Adj R-squared = 0.8464SourcePartial SSdfMSF
5、ProbFModel40.938856220.46942864.360.0000age40.938856220.46942864.360.0000Residual6.679474221.3180702Total47.61833232.0703622(3)性别和年龄组是否对观测个案尿铅含量均值存在交互作用。anova result age sex age#sexNumber of obs =24 R-squared=0.8649Root MSE=.597774 Adj R-squared =0.8274SourcePartial SSdfMSFProbFModel41.18633158.237266223.050.0000age40.938856220.46942857.280.0000sex.004816661.004816660.010.9089age#sex.242658192.12132910.340.7166Residual6.431999418.3573333Total47.61833232.0703622