













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














------------+-----------------------------------^ i_age2^ 01 | || Freq. 22272 Percent75.5124.49^ 100.00Cum.75. ------------+----------------------------------- Total | 294 100. ------------+-----------------------------------^ i_age3 01^ |||^ Freq. 21579 Percent73.1326.87^ 100.0073.13Cum. ------------+----------------------------------- Total | 294 100. ------------+-----------------------------------^ i_age4 01^ |||^ Freq. 22668 Percent76.8723.13^ 100.0076.87Cum. ------------+----------------------------------- Total | 294 100.
Logistic Log likelihood regression = -132.23409 Number LR ProbPseudo chi2(3) > ofchi2R2 obs ==== (^) 0.30100.01363.66 294 ------------------------------------------------------------------------------ -------------+---------------------------------------------------------------- i_age2 cases || (^) -.0300523Coef. Std..4045487 Err. -0.07z P>|z|0.941 (^) -.8229533[95% Conf. Interval]. ------------------------------------------------------------------------------^ i_age3^ i_age4^ _cons^ |||^ -.5166637-.7099543-1.304949^ .4301908.4702295.2818673^ -1.20-1.51-4.63^ 0.2300.1310.000^ -1.359822-1.631587-1.857398^ .3264948.2116785-.
. ------------+----------------------------------- tabulate i_age4 i_age4 | Freq. Percent Cum. ------------+----------------------------------- Total^01 |||^22629468 100.0076.8723.13^ 100.0076. ... (^) (^) SOLUTION * logit Fit (^) a cases logistic for i_age2 #2C regression i_age3 i_age4 model using the command LOGIT and the 3 design variables just created Logistic Log likelihood regression = -132.23409 Number LR ProbPseudo chi2(3) > ofchi2R2 obs ==== (^) 0.30100.01363.66 294 ------------------------------------------------------------------------------ -------------+---------------------------------------------------------------- i_age2 cases || (^) -.0300523Coef. Std..4045487 Err. -0.07z P>|z|0.941 (^) -.8229533[95% Conf. Interval]. ------------------------------------------------------------------------------^ i_age3^ i_age4^ _cons^ |||^ -.5166637-.7099543-1.304949^ .4301908.4702295.2818673^ -1.20-1.51-4.63^ 0.2300.1310.000^ -1.359822-1.631587-1.857398^ .3264948.2116785-. ...* (^) * (^) ***** (^) * sort (^) Fill SOLUTION Use (^) agequart incommand the for table (^) SORT #2D withto sort midpoint data byof quartileage and betasof age and se's .. ---------------------------------------------------------------------------------------------------------------- (^) * by use agequart: command (^) centile CENTILE (^) age, with (^) c(50) option c(50) preceded by BY command to obtain midpoints -> agequart Variable = | (^1) Obs Percentile Centile --[95% Binom. Conf. Interp. Interval] -- -------------+------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------- age | 75 50 23 22 24 -> agequart Variable = | (^2) Obs Percentile Centile --[95% Binom. Conf. Interp. Interval] -- -------------+------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------- age | 72 50 34 33 36 -> agequart Variable = | (^3) Obs Percentile Centile --[95% Binom. Conf. Interp. Interval] -- -------------+------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------- age | 79 50 51 50 54 -> agequart Variable = | (^4) Obs Percentile Centile --[95% Binom. Conf. Interp. Interval] -- -------------+------------------------------------------------------------- age | 68 50 68 65.38909 71
. NOTE: with *** SOLUIION** theThe points solution for (^) that #2E to you #2E want requires to plot, saving saving depress.dta, it, and using clearing it… the work space, creating a new little data set ... (^) ** clear UseBefo there creatingdrop down a menu:new data FILE set, > SAVEuse theAS tocommand save yourCLEAR enhancements to your data. .... save UseWhenUse "/Users/carolbigelow/Desktop/week8plot.dta"the (^) theyou’re dropdrop done downdown entering menu:menu: DATA (^) FILEdata, >> DATAexitSAVE EDITORtheAS todata saveto editorcreate your newa new data data as set.WEEK8PLOT.dta file.. use Use/Users/carolbigelow/Desktop/week8plot.dta "/Users/carolbigelow/Desktop/week8plot.dta" the drop down menu: FILE > OPEN to actually saved use your new data set .. (^) * list Use +-----------------------------+ command LIST to check creation of data set 1. 2. |^ |-----------------------------|||^ midpoint 2334 betahat-.0301 0 sebeta.4045 0 ||| 3. 4. || +-----------------------------+ 5168 -.5167-.71 .4302.4702 || .. NOTE: (^) * graph Use (^) (^) Once command twoway the (^) connected GRAPH basic (^) TWOWAY graph betahat (^) has CONNECTED (^) been midpoint created followed for by you, Y variable you can (^) first click (^) then on the X (^) variable graph editor (it’s an icon that looks like When the (^) extension ayou histogram) are done, is (^) “png”. and be (^) try sure your to (^) save hand (^) yourat creating graph by titles, clicking etc. in the icon that looks like a disk. A good choice for
PubHlth 640 by age_grp; Intermediate Biostatistics 10 run; *^ tables I_age2 I_age3 I_age4; *_________________________________________ * * Homework * Produce a frequency distributionQuestion #2B - of the
PubHlth 640 * Y = estimated coefficient (^) from logistic model. Intermediate Biostatistics 11 ________________________________________; goptions reset=symbol; symbol1 v=square color=blue i=j; proc gplot run; plot title "Estimated beta betamidage; data=temp2; by Midpoint of Age";
2C.) Analyze > Regression > Binary logistic
logit(P{CASES=1}) = β 0 + β1ageQ2 + β Variables in the Equation 2ageQ3 + β 3 ageQ
2D.) from estimates in 2B and 2C Quartile Midpoint (^) β SE(β) 123 23.535.551.0 (^) -0.030-0.517 (^0) 0.4050.430 0 2E.) Create a separate dataset to hold the data from 2D.^4 74.5^ -0.710^ 0. File > New > Data
2F.) logit(cases) appears to be linear in age with a negative slope. As age increases (as evidenced by midpoint) betahat ( decreases. β)
Click Statistics… button
Click OK.
Unfortunately, Minitab does not have a menu option to populate the data as required, so you will need to enter these by hand.However, drag filling and copy and paste techniques that work in Excel also work in Minitab. AGE AgeQ2 AgeQ3 AgeQ (^18) … (^29) … (^01 00 ) (^43) … 60 00 10 01 2C.) Stat > Regression > Binary Logistic Regression… logit(P{CASES=1}) = β 0 + β1ageQ2 + β2ageQ3 + β3ageQ
Click OK.
Log-Likelihood = -132.234 Test that all slopes are zero: G = 3.656, DF = 3, P-Value = 0.301 >> Remarks :