Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 1/20 BIOST/STAT 579 – Data Analysis Longitudinal Data Analysis Longitudinal data present special opportunities and challenges that don’t exist with cross-sectional data analysis. First, there are questions that can be addressed with longitudinal data that cannot even be considered with cross-sectional data. For example, with longitudinal data one can distinguish between crosssectional and longitudinal associations. A second feature of longitudinal data is that there are three distinct types of models that can be considered: 1) marginal models, 2) random-effects models, and 3) transition models. These models address different scientific questions so the choice of model type is extremely important and needs to be made based on the scientific question of interest rather than on statistical considerations. The third issue to be considered is modeling the correlation structure. With longitudinal data there is a wide variety of correlation structures to choose from. Outline 1. Longitudinal versus cross-sectional associations 2. Contrasts between three approaches to modeling longitudinal data 3. Modeling longitudinal correlation structures 1 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 2/20 1. Longitudinal versus cross-sectional associations Example I (Potthoff & Roy growth data): Distances between two facial landmarks for 27 children (11 females, 16 males) at ages 8, 10, 12, and 14 years. Spaghetti plots of the data are shown below. (Note: age is centered at 11.) -3 -2 -1 0 1 2 3 25 20 Distance (mm) 25 20 Distance (mm) 30 Distance vs. Age (Males) 30 Distance vs. Age (Females) -3 -2 -1 Age (yrs) 0 1 2 3 Age (yrs) Recall that a linear model with gender, age, and gender-age interaction gave the same coefficients as separate analyses of subject means and individual regression slopes on age. Linear models: (Estimate SE) Variable Intercept Male Age Male*Age Linear model on raw data (Estimate Robust SE) 22.6 0.61 2.32 0.75 0.48 0.06 0.30 0.12 Linear model on means (Estimate SE) Linear model on slopes (Estimate SE) 22.6 0.59 2.32 0.76 0.48 0.10 0.30 0.13 For these data the overall linear model gives the same results as the analyses of subjectspecific means and slopes. This means that the age coefficient in the overall model represents the change in mean corresponding to aging of an individual child. This property results from the fact that the data are balanced. Let’s try a different data set to see what happens if the data are not balanced. 2 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis Example II (Tooth loss in periodontitis patients): 11/26/07 - 3/20 A cohort study was done on the effectiveness of treatment of periodontitis. The study enrolled approximately 800 patients with periodontitis and followed them for up to 10 years. The outcome variable is the number of teeth extracted in each follow-up year. Results of the three analyses as above: Variable Linear model on raw data (Estimate robust SE) Linear model on means (Estimate SE) Linear model on slopes (Estimate SE) Intercept 0.181 0.019 0.187 0.022 Male 0.022 0.030 0.012 0.030 Age -0.001 0.002 0.000 0.003* -0.060 0.016 Male X Age 0.001 0.004 0.002 0.004* 0.029 0.022 *Note that we can fit age and male X age terms to the subject means because the average value of age varies across subjects (unlike the Potthoff-Roy data). The results show there is a longitudinal association (within subjects) between extractions and age but no cross-sectional association (between subjects). (The overall analysis gives results similar to the between subjects analysis in this case.) The analysis of slopes is not very precise because each slope is given equal weight regardless of its variability. A better analysis, which allows simultaneous estimation of cross-sectional and longitudinal associations is between and within-cluster regression, based on fitting the following model: E(Y) = Intercept + Male * { Ave. Age + (Age – Ave. Age) } Variable Linear model (Estimate Robust SE) Intercept 0.180 0.019 Male 0.022 0.030 Ave. Age 0.002 0.003 Age Diff. -0.025 0.009 Male X Ave. Age 0.000 0.004 Male X Age Diff. 0.014 0.012 3 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 4/20 Note that the overall estimates for Age and Male X Age (from previous table) are intermediate between the cross-sectional and longitudinal estimates, but are closer to the cross-sectional estimates. Alternative parametrization: E(Y) = Intercept + Male*{ Baseline Age + Year } (Note: Year = Age – Baseline Age) Variable Estimate Robust SE Intercept 0.072 0.151 Male 0.056 0.214 Baseline Age 0.002 0.003 Year -0.022 0.008 Male X BL Age -0.001 0.004 Male X Year 0.015 0.011 Between and within-regression for a log-linear model: log(E(Y)) = Intercept + Male * { Baseline Age + Year } Estimates and robust SEs: Variable Estimate Robust SE Intercept -2.362 0.847 Male 0.396 1.128 Baseline Age 0.012 0.016 Year -0.130 0.049 Male X Baseline Age -0.005 0.022 Male X Year 0.092 0.063 4 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 5/20 5 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 6/20 2. Contrasts between three approaches to modeling longitudinal data Three modeling approaches: Marginal Model (Direct Approach) Random Effects Model Transition Model Example I (Potthoff & Roy growth data): Marginal Model (“direct” approach): E(Y) = Intercept + Male + Age + Male X Age Random Effects Model: E(Y|U) = Intercept + Male + Age + Male X Age + U U = random effect at subject level (iid) ~ N(0, V) Transition Model: E(Y|YPrevious) = Intercept + Male + Age + Male X Age + YPrevious YPrevious = value of Y at previous time point Results of three model fits for the Potthoff-Roy data: Marginal Model* Estimate SE Random- Effects Model Transition Model* Intercept 22.6 0.61 22.6 0.59 9.57 3.67 Male 2.32 0.75 2.32 0.76 1.03 0.51 Age 0.48 0.06 0.48 0.09 0.18 0.12 Male X Age 0.30 0.12 0.30 0.12 0.31 0.13 NA NA 0.60 0.17 Variable YPrevious * SEs are robust SEs. Note: The marginal and RE models give the same results here because the data are balanced. The transition model gives very different results from the other two models because it includes adjustment for a prior outcome. 6 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 7/20 Example II (Periodontitis study): Variable Marginal Model Random- Effects Model Transition Model Intercept 0.181 0.019 0.180 0.021 0.133 0.018 Male 0.022 0.030 -0.002 0.003 0.040 0.028 Age -0.001 0.002 0.022 0.030 0.001 0.002 Male X Age 0.001 0.004 0.002 0.004 0.001 0.003 NA NA YPrevious Marginal Model Estimate SE Random- Effects Model Transition Model Intercept 0.072 0.151 0.079 0.158 0.078 0.136 Male 0.056 0.214 0.043 0.216 0.022 0.186 BL-Age 0.002 0.003 0.002 0.003 0.001 0.003 Year -0.022 0.008 -0.023 0.007 0.004 0.006 Male X BL-Age -0.001 0.004 0.000 0.004 0.011 0.007 Male X Year 0.015 0.011 0.015 0.010 0.000 0.004 NA NA 0.006 0.010 Variable YPrevious Note: The marginal and RE models give similar results, which is not surprising (for linear models). The transition model does not differ too much from the other two models, in this case, because the prior outcome is not strongly associated with the outcome. Example III (Logistic regression for a cross-over trial): Ref: Diggle et al., p.180 Marginal Model: logit(E(Y)) = Intercept + Treatment + Period Random Effects Model: logit(E(Y|U)) = Intercept + Treatment + Period + U 7 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis U = random effect at subject level (iid) ~ N(0, V) 11/26/07 - 8/20 Results: Marginal Model* Random- Effects Model Intercept 0.67 0.29 2.2 1.0 Treatment 0.57 0.23 1.8 0.93 Period -0.30 0.23 -1.0 0.84 Variable * SEs are robust SEs. Notes: The estimated random effects SD is very large (5.0), which contributes to the large differences between model estimates. Differences between coefficient estimates are due to different interpretations of the two models (as opposed to different properties of the parameter estimators). Ratios of coefficient estimates to their SEs are similar in the two models, which is often observed. 8 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 9/20 3. Modeling longitudinal correlation structures Example (Potthoff-Roy data): Variable Intercept Male Age Male*Age Est. 22.6 2.32 0.48 0.30 Independent Naive Robust SE SE 0.34 0.61 0.44 0.75 0.15 0.06 0.20 0.12 Est. 22.6 2.32 0.48 0.30 Exchangeable Naïve Robust SE SE 0.57 0.61 0.74 0.75 0.10 0.06 0.12 0.12 Est. 22.6 2.42 0.48 0.29 Autoregressive Naïve Robust SE SE 0.52 0.61 0.67 0.75 0.14 0.06 0.18 0.12 Note: Independent and Exchangeable analyses give same estimates and robust SEs (but not naïve SEs) because the data are balanced. The AR-1 analysis gives similar estimates and robust SEs (which are equal to 2 decimal places). Naïve SEs in AR-1 analysis are noticeably different than robust SEs. The observed correlation structure is closer to exchangeable than AR-1: Age Age Age Age 8 10 12 14 Age 8 1 .63 .71 .60 Age 10 .63 1 .63 .76 Age 12 .71 .63 1 .79 Age 14 .60 .76 .79 1 The correlation structure is similar, but with very different values of the correlations, for males and females: Males: 8 10 12 14 Age 8 1 .44 .56 .32 Age 10 .44 1 .39 .63 Age 12 .56 .39 1 .59 Age 14 .32 .63 .59 1 Age 8 Age 10 Age 12 Age 8 1 .83 .86 Age 10 .83 1 .90 Age 12 .86 .90 1 Age 14 .84 .88 .95 Age Age Age Age Females: 9 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis Age 14 .84 .88 11/26/07 - 10/20 .95 1 Note: these differences can be seen in the spaghetti plots. Note: such variations in correlation structure are often ignored but can be capitalized on to increase estimation precision (Stoner and Leroux, 2002) References Diggle, Heagerty, Liang and Zeger (2002). Longitudinal Data Analysis. Potthoff and Roy (1964) Biometrika (facial measurement data) Stoner and Leroux (2002) Biometrika (improving precision compared to GEE) 10 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 11/20 Survival Analysis Example (NHANES cardiovascular hospitalization or death): What the data look like: chdhosp: indicator of whether or not subject had the event of interest (cardiovascular hospitalization or death) time: time of occurrence of the event or time of censoring (end of follow-up) whichever came first Consider subset of subjects > 70 years of age at baseline. n mean min max chdhosp 1110 0.5153 0 1.0000 time 1110 9.1047 0 22.0616 table(round(chdsurv$time[chdsurv$age>70],0),chdsurv$chdhosp[chdsurv$age>70]) 0 1 0 24 23 1 21 60 2 20 40 3 27 41 4 30 33 5 20 47 6 28 33 7 15 22 8 27 33 9 40 28 10 29 25 11 19 42 12 22 21 13 23 31 14 27 21 15 19 22 16 23 10 17 12 16 18 12 12 19 32 10 20 38 2 21 28 0 22 2 0 Note: the above give a picture of the data but are not descriptives you would report. Descriptive statistics to report: Kaplan-Meier estimate of the survival curve, which is the probability of “surviving” (being event-free) to a given time. 11 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 12/20 0.6 0.4 Female Male 0.0 0.2 Survival Probability 0.8 1.0 Kaplan-Meier Estimates (Age > 70) by Gender with 95% Confidence Limits 0 5 10 15 20 Year How Kaplan-Meier is calculated (first 10 values, females, n=597): Time Risk Event Survival 0.0000 597 0 1.0000 0.0274 590 0 1.0000 0.0548 589 1 0.9983 0.1150 588 1 0.9966 0.1506 587 1 0.9949 0.1725 586 0 0.9949 0.1862 585 1 0.9932 0.1916 584 0 0.9932 0.2108 583 1 0.9915 0.4408 582 0 0.9915 SE 0.0000 0.0000 0.0017 0.0024 0.0029 0.0029 0.0034 0.0034 0.0038 0.0038 Regression analysis The Cox proportional hazards model is the most popular model (like logistic regression for binary data there are alternatives which don’t seem to be used much). The Cox model is a linear model for the log of the hazard rate (instantaneous probability of failure given survival to a given time). 12 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 13/20 Example: Comparison of hazards for males and females among subjects greater than 70 years of age at baseline. coxph(formula = Surv(time, chdhosp) ~ gender, data = chdsurv, subset = (age > 70)) n= 1110 coef exp(coef) se(coef) z p gendermale 0.309 1.36 0.0843 3.67 0.00024 gendermale exp(coef) exp(-coef) lower .95 upper .95 1.36 0.734 1.16 1.61 The hazard for cardiovascular hospitalization or death is 1.36 times as high for males as for females. This hazard ratio is highly statistically significant (significantly different from 1). Example: Apply Cox regression to the HW problem on comparing male and female risk of CHD. summary(coxph( Surv(time,chdhosp) ~ gender, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender, data = chdsurv) n= 11313 coef exp(coef) se(coef) z p gendermale 0.708 2.03 0.0388 18.3 0 gendermale exp(coef) exp(-coef) lower .95 upper .95 2.03 0.493 1.88 2.19 Rsquare= 0.029 (max possible= 0.986 ) Likelihood ratio test= 331 on 1 df, p=0 Wald test = 334 on 1 df, p=0 Score (logrank) test = 348 on 1 df, p=0 summary(coxph( Surv(time,chdhosp) ~ gender+age, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender + age, data = chdsurv) n= 11313 coef exp(coef) se(coef) z p gendermale 0.5291 1.70 0.03887 13.6 0 age 0.0765 1.08 0.00169 45.2 0 exp(coef) exp(-coef) lower .95 upper .95 gendermale 1.70 0.589 1.57 1.83 13 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis age 1.08 0.926 Rsquare= 0.238 (max possible= Likelihood ratio test= 3074 on Wald test = 2289 on Score (logrank) test = 2965 on 1.08 11/26/07 - 14/20 1.08 0.986 ) 2 df, p=0 2 df, p=0 2 df, p=0 summary(coxph( Surv(time,chdhosp) ~ gender + age + povindex + physact, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender + age + povindex + physact, data = chdsurv) n=10873 (440 observations deleted due coef exp(coef) se(coef) gendermale 0.582057 1.790 0.040131 age 0.073910 1.077 0.001734 povindex -0.000685 0.999 0.000119 physactYes -0.214802 0.807 0.041118 gendermale age povindex physactYes to missingness) z p 14.50 0.0e+00 42.62 0.0e+00 -5.74 9.5e-09 -5.22 1.8e-07 exp(coef) exp(-coef) lower .95 upper .95 1.790 0.559 1.654 1.936 1.077 0.929 1.073 1.080 0.999 1.001 0.999 1.000 0.807 1.240 0.744 0.874 Rsquare= 0.244 (max possible= Likelihood ratio test= 3035 on Wald test = 2313 on Score (logrank) test = 2981 on 0.986 ) 4 df, p=0 4 df, p=0 4 df, p=0 summary(coxph( Surv(time,chdhosp) ~ gender+age+povindex+physact+priorhd*diabetes, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender + age + povindex + physact + priorhd * diabetes, data = chdsurv) n=10873 (440 observations deleted due coef exp(coef) gendermale 0.575933 1.779 age 0.069264 1.072 povindex -0.000549 0.999 physactYes -0.149642 0.861 priorhdYes 1.074203 2.928 diabetesYes 0.792959 2.210 priorhdYes:diabetesYes -0.202058 0.817 gendermale to missingness) se(coef) z p 0.040236 14.31 0.0e+00 0.001769 39.16 0.0e+00 0.000118 -4.66 3.2e-06 0.041467 -3.61 3.1e-04 0.055510 19.35 0.0e+00 0.076011 10.43 0.0e+00 0.144600 -1.40 1.6e-01 exp(coef) exp(-coef) lower .95 upper .95 1.779 0.562 1.644 1.925 14 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis age povindex physactYes priorhdYes diabetesYes priorhdYes:diabetesYes 1.072 0.999 0.861 2.928 2.210 0.817 Rsquare= 0.275 (max possible= Likelihood ratio test= 3499 on Wald test = 2968 on Score (logrank) test = 4175 on 0.933 1.001 1.161 0.342 0.453 1.224 1.068 0.999 0.794 2.626 1.904 0.615 11/26/07 - 15/20 1.075 1.000 0.934 3.264 2.565 1.085 0.986 ) 7 df, p=0 7 df, p=0 7 df, p=0 summary(coxph( Surv(time,chdhosp) ~ gender + age + povindex + physact + priorhd*diabetes + bpdia + I(bpdia^2) + weight + I(weight^2) + height, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender + age + povindex + physact + priorhd * diabetes + bpdia + I(bpdia^2) + weight + I(weight^2) + height, data = chdsurv) n=10815 (498 observations deleted due coef exp(coef) gendermale 6.11e-01 1.842 age 6.93e-02 1.072 povindex -4.59e-04 1.000 physactYes -1.25e-01 0.883 priorhdYes 1.04e+00 2.823 diabetesYes 7.68e-01 2.156 bpdia 5.80e-03 1.006 I(bpdia^2) 1.57e-05 1.000 weight -1.28e-02 0.987 I(weight^2) 1.27e-04 1.000 height -6.86e-01 0.504 priorhdYes:diabetesYes -1.90e-01 0.827 to missingness) se(coef) z 5.66e-02 10.790 1.87e-03 37.031 1.18e-04 -3.888 4.17e-02 -2.998 5.58e-02 18.586 7.62e-02 10.089 1.17e-02 0.495 6.31e-05 0.249 7.49e-03 -1.705 4.45e-05 2.846 3.39e-01 -2.025 1.45e-01 -1.313 p 0.0000 0.0000 0.0001 0.0027 0.0000 0.0000 0.6200 0.8000 0.0880 0.0044 0.0430 0.1900 exp(coef) exp(-coef) lower .95 upper .95 gendermale 1.842 0.543 1.649 2.059 age 1.072 0.933 1.068 1.076 povindex 1.000 1.000 0.999 1.000 physactYes 0.883 1.133 0.813 0.958 priorhdYes 2.823 0.354 2.530 3.149 diabetesYes 2.156 0.464 1.857 2.503 bpdia 1.006 0.994 0.983 1.029 I(bpdia^2) 1.000 1.000 1.000 1.000 weight 0.987 1.013 0.973 1.002 I(weight^2) 1.000 1.000 1.000 1.000 height 0.504 1.985 0.259 0.978 priorhdYes:diabetesYes 0.827 1.210 0.622 1.098 Rsquare= 0.281 (max possible= 0.986 ) 15 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis Likelihood ratio test= 3566 Wald test = 2951 Score (logrank) test = 4191 on 12 df, on 12 df, on 12 df, 11/26/07 - 16/20 p=0 p=0 p=0 summary(coxph( Surv(time,chdhosp) ~ gender + age + povindex + physact + priorhd*diabetes + hitched + breakdwn, data=chdsurv)) Call: coxph(formula = Surv(time, chdhosp) ~ gender + age + povindex + physact + priorhd * diabetes + hitched + breakdwn, data = chdsurv) n=10873 (440 observations deleted due coef exp(coef) gendermale 0.581903 1.789 age 0.069304 1.072 povindex -0.000532 0.999 physactYes -0.149064 0.862 priorhdYes 1.069120 2.913 diabetesYes 0.788180 2.199 hitchedYes 0.080791 1.084 breakdwnYes 0.208847 1.232 priorhdYes:diabetesYes -0.222180 0.801 gendermale age povindex physactYes priorhdYes diabetesYes hitchedYes breakdwnYes priorhdYes:diabetesYes to missingness) se(coef) z p 0.040357 14.42 0.0e+00 0.001771 39.14 0.0e+00 0.000118 -4.51 6.5e-06 0.041507 -3.59 3.3e-04 0.055556 19.24 0.0e+00 0.076041 10.37 0.0e+00 0.089802 0.90 3.7e-01 0.096550 2.16 3.1e-02 0.144980 -1.53 1.3e-01 exp(coef) exp(-coef) lower .95 upper .95 1.789 0.559 1.653 1.937 1.072 0.933 1.068 1.075 0.999 1.001 0.999 1.000 0.862 1.161 0.794 0.935 2.913 0.343 2.612 3.248 2.199 0.455 1.895 2.553 1.084 0.922 0.909 1.293 1.232 0.812 1.020 1.489 0.801 1.249 0.603 1.064 Rsquare= 0.276 (max possible= Likelihood ratio test= 3505 on Wald test = 2966 on Score (logrank) test = 4176 on 0.986 ) 9 df, p=0 9 df, p=0 9 df, p=0 16 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis For comparison, results from logistic and linear regression: 11/26/07 - 17/20 Logistic regression models: round(summary(glm(chd~gender,family=binomial,data=chd))$coef,3) (Intercept) gendermale Estimate Std. Error z value Pr(>|z|) -3.545 0.075 -47.276 0 0.826 0.098 8.416 0 round(summary(glm(chd~gender+age,family=binomial,data=chd))$coef,3) Estimate Std. Error z value Pr(>|z|) (Intercept) -8.745 0.353 -24.778 0 gendermale 0.575 0.101 5.724 0 age 0.090 0.005 16.943 0 round(summary(glm(chd~gender+age+povindex+physact,family=binomial,data=chd))$coef,3) (Intercept) gendermale age povindex physactYes Estimate Std. Error z value Pr(>|z|) -8.066 0.378 -21.364 0.000 0.653 0.103 6.310 0.000 0.085 0.005 15.546 0.000 -0.001 0.000 -2.238 0.025 -0.507 0.113 -4.494 0.000 round(summary(glm(chd~gender+age+povindex+physact+priorhd*diabetes,family=binomial,d ata=chd))$coef,3) Estimate Std. Error z value Pr(>|z|) (Intercept) -7.889 0.383 -20.576 0.000 gendermale 0.601 0.106 5.652 0.000 age 0.074 0.006 13.197 0.000 povindex -0.001 0.000 -1.665 0.096 physactYes -0.347 0.116 -2.977 0.003 priorhdYes 1.520 0.122 12.491 0.000 diabetesYes 0.724 0.197 3.680 0.000 priorhdYes:diabetesYes -0.163 0.306 -0.531 0.595 round(summary(glm(chd~gender+age+povindex+physact+priorhd*diabetes+bpdia+I(bpdia^2)+ weight+I(weight^2)+height,family=binomial,data=chd))$coef,3) (Intercept) gendermale age povindex physactYes priorhdYes diabetesYes Estimate Std. Error z value Pr(>|z|) -4.662 1.904 -2.449 0.014 0.726 0.149 4.883 0.000 0.074 0.006 12.776 0.000 0.000 0.000 -1.429 0.153 -0.331 0.117 -2.828 0.005 1.510 0.122 12.327 0.000 0.729 0.198 3.689 0.000 17 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 18/20 bpdia -0.024 0.027 -0.863 0.388 I(bpdia^2) weight I(weight^2) height priorhdYes:diabetesYes 0.000 -0.026 0.000 -0.763 -0.167 0.000 0.020 0.000 0.880 0.307 0.872 -1.336 1.355 -0.868 -0.544 0.383 0.181 0.175 0.386 0.586 round(summary(glm(chd~gender+age+povindex+physact+priorhd*diabetes+hitched+breakdwn, family=binomial,data=chd))$coef,3) (Intercept) gendermale age povindex physactYes priorhdYes diabetesYes hitchedYes breakdwnYes priorhdYes:diabetesYes Estimate Std. Error z value Pr(>|z|) -8.025 0.444 -18.090 0.000 0.609 0.107 5.701 0.000 0.074 0.006 13.190 0.000 -0.001 0.000 -1.626 0.104 -0.348 0.117 -2.984 0.003 1.514 0.122 12.416 0.000 0.719 0.197 3.653 0.000 0.127 0.236 0.537 0.592 0.180 0.247 0.730 0.466 -0.167 0.307 -0.543 0.587 Linear models: round(summary(glm(chd~gender, family=quasi(link=identity, variance="mu(1-mu)"), data=chd))$coef, 4) (Intercept) gendermale Estimate Std. Error t value Pr(>|t|) 0.0281 0.0020 13.7204 0 0.0338 0.0042 8.0374 0 round(summary(glm(chd~gender+I(age-50), start=c(.03,.02,.001), family=quasi(link=identity,variance="mu(1-mu)"), data=chd))$coef, 3) Estimate Std. Error t value Pr(>|t|) (Intercept) 0.035 0.002 20.185 0 gendermale 0.014 0.003 4.815 0 I(age - 50) 0.001 0.000 20.185 0 There were 27 warnings (use warnings() to see them) round(summary(glm(chd~gender+I(age-50) + povindex + physact, start=c(.03,.02,0,0,0),family=quasi(link=identity, variance="mu(1-mu)"), data=chd))$coef, 3) (Intercept) gendermale I(age - 50) povindex physactYes Estimate Std. Error t value Pr(>|t|) 0.037 0.003 14.526 0.000 0.021 0.003 6.181 0.000 0.001 0.000 8.562 0.000 0.000 0.000 -3.284 0.001 -0.006 0.003 -2.163 0.031 18 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis 11/26/07 - 19/20 There were 29 warnings (use warnings() to see them) round(summary(glm(chd~gender+I(age-50) + povindex + physact + priorhd*diabetes, start=c(.03,.02,0,0,0,0,0,0), family = quasi(link=identity,variance="mu(1mu)"),data=chd))$coef,3) Estimate Std. Error t value Pr(>|t|) (Intercept) 0.031 0.002 13.355 0.000 gendermale 0.019 0.003 6.269 0.000 I(age - 50) 0.001 0.000 7.864 0.000 povindex 0.000 0.000 -3.141 0.002 physactYes -0.005 0.002 -1.816 0.069 priorhdYes 0.070 0.010 6.938 0.000 diabetesYes 0.018 0.009 1.915 0.056 priorhdYes:diabetesYes 0.033 0.032 1.020 0.308 There were 29 warnings (use warnings() to see them) round(summary(glm(chd~gender+I(age-50) + povindex + physact + priorhd*diabetes + bpdia + I(bpdia^2) + weight + I(weight^2) + height, start = c(.03,.02,0,0,0,0,0,0,0,0,0,0,0), family = quasi(link=identity,variance="mu(1mu)"),data=chd))$coef,3) Estimate Std. Error t value Pr(>|t|) (Intercept) 0.096 0.046 2.071 0.038 gendermale 0.022 0.004 5.676 0.000 I(age - 50) 0.001 0.000 7.427 0.000 povindex 0.000 0.000 -1.847 0.065 physactYes -0.004 0.003 -1.691 0.091 priorhdYes 0.066 0.010 6.574 0.000 diabetesYes 0.017 0.009 1.845 0.065 bpdia -0.001 0.001 -0.687 0.492 I(bpdia^2) 0.000 0.000 0.601 0.548 weight 0.000 0.000 -0.894 0.372 I(weight^2) 0.000 0.000 0.770 0.441 height -0.013 0.021 -0.648 0.517 priorhdYes:diabetesYes 0.030 0.031 0.966 0.334 There were 27 warnings (use warnings() to see them) round(summary(glm(chd~gender+I(age-50) + povindex + physact + priorhd*diabetes + hitched + breakdwn, start = c(.03,.02,0,0,0,0,0,0,0,0), family = quasi(link=identity,variance="mu(1-mu)"),data=chd))$coef,3) (Intercept) gendermale I(age - 50) povindex physactYes priorhdYes diabetesYes Estimate Std. Error t value Pr(>|t|) 0.030 0.005 6.444 0.000 0.019 0.003 6.279 0.000 0.001 0.000 7.830 0.000 0.000 0.000 -3.079 0.002 -0.005 0.002 -1.816 0.069 0.070 0.010 6.917 0.000 0.018 0.009 1.903 0.057 19 Biost/Stat 579 – Autumn 2008 – Longitudinal Data Analysis & Survival Analysis hitchedYes 0.000 0.005 0.078 breakdwnYes 0.002 0.008 0.287 priorhdYes:diabetesYes 0.032 0.032 1.019 There were 29 warnings (use warnings() to see them) 11/26/07 - 20/20 0.938 0.774 0.308 20