a first order model with one binary and one quantitative predictor variable

Click here to load reader

Download A first order model with one binary and one quantitative predictor variable

Post on 19-Jan-2016

232 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • A first order model with one binary and one quantitative predictor variable

  • Examples of binary predictor variablesGender (male, female)Smoking status (smoker, nonsmoker)Treatment (yes, no)Health status (diseased, healthy)

  • On average, do smoking mothers have babies with lower birth weight?Random sample of n = 32 births.y = birth weight of baby (in grams)x1 = length of gestation (in weeks)x2 = smoking status of mother (yes, no)

  • Coding the binary (two-group qualitative) predictorUsing a (0,1) indicator variable.xi2 = 1, if mother smokesxi2 = 0, if mother does not smokeOther terms used: dummy variablebinary variable

  • On average, do smoking mothers have babies with lower birth weight?

  • A first order model with one binary and one quantitative predictorwhere yi is birth weight of baby i xi1 is length of gestation of baby i xi2 = 1, if mother smokes and xi2 = 0, if not

  • An indicator variable for 2 groups yields 2 response functionsIf mother is a smoker (xi2 = 1):If mother is a nonsmoker (xi2 = 0):

  • Interpretation of the regression coefficientsrepresents the change in the mean response Y for each additional unit increase in the quantitative predictor x1 for both groups.

  • The estimated regression functionThe regression equation isWeight = - 2390 + 143 Gest - 245 Smoking

  • A significant difference in mean birth weights for the two groups?The regression equation isWeight = - 2390 + 143 Gest - 245 Smoking

    Predictor Coef SE Coef T PConstant -2389.6 349.2 -6.84 0.000Gest 143.100 9.128 15.68 0.000Smoking -244.54 41.98 -5.83 0.000

    S = 115.5 R-Sq = 89.6% R-Sq(adj) = 88.9%

  • Why not instead fit two separate regression functions?One for the smokers and one for the nonsmokers?

  • Using indicator variable, fitting one function to 32 data pointsThe regression equation isWeight = - 2390 + 143 Gest - 245 Smoking

    Predictor Coef SE Coef T PConstant -2389.6 349.2 -6.84 0.000Gest 143.100 9.128 15.68 0.000Smoking -244.54 41.98 -5.83 0.000

    S = 115.5 R-Sq = 89.6% R-Sq(adj) = 88.9%

  • Using indicator variable, fitting one function to 32 data pointsPredicted Values for New ObservationsNew Obs Fit SE Fit 95.0% CI 95.0% PI1 2803.7 30.8 (2740.6, 2866.8) (2559.1, 3048.3) 2 3048.2 28.9 (2989.1, 3107.4) (2804.7, 3291.8)

    Values of Predictors for New ObservationsNew Obs Gest Smoking1 38.0 1.002 38.0 0.00

  • Fitting function to 16 nonsmokersThe regression equation isWeight = - 2546 + 147 Gest

    Predictor Coef SE Coef T PConstant -2546.1 457.3 -5.57 0.000Gest 147.21 11.97 12.29 0.000

    S = 106.9 R-Sq = 91.5% R-Sq(adj) = 90.9%

  • Fitting function to 16 nonsmokers

    Predicted Values for New ObservationsNew Obs Fit SE Fit 95.0% CI 95.0% PI1 3047.7 26.8 (2990.3, 3105.2) (2811.3, 3284.2)

    Values of Predictors for New ObservationsNew Obs Gest1 38.0

  • Fitting function to 16 smokersThe regression equation isWeight = - 2475 + 139 Gest

    Predictor Coef SE Coef T PConstant -2474.6 554.0 -4.47 0.001Gest 139.03 14.11 9.85 0.000

    S = 126.6 R-Sq = 87.4% R-Sq(adj) = 86.5%

  • Fitting function to 16 smokers

    Predicted Values for New ObservationsNew Obs Fit SE Fit 95.0% CI 95.0% PI1 2808.5 35.8 (2731.7, 2885.3) (2526.4, 3090.7)

    Values of Predictors for New ObservationsNew Obs Gest1 38.0

  • Summary table

    Model estimated usingSE(Gest)Length of CI for Y32 data points9.128(NS) 118.3(S) 126.216 nonsmokers11.97114.916 smokers14.11153.6

  • Reasons to pool the data and to fit one regression functionModel assumes equal slopes for the groups and equal variances for all error terms. It makes sense to use all of the data to estimate these quantities.More degrees of freedom associated with MSE, so confidence intervals that are a function of MSE tend to be narrower.

  • How to answer the research question using one regression function?The regression equation isWeight = - 2390 + 143 Gest - 245 Smoking

    Predictor Coef SE Coef T PConstant -2389.6 349.2 -6.84 0.000Gest 143.100 9.128 15.68 0.000Smoking -244.54 41.98 -5.83 0.000

    S = 115.5 R-Sq = 89.6% R-Sq(adj) = 88.9%

  • How to answer the research question using two regression functions?The regression equation is Weight = - 2546 + 147 Gest

    Predictor Coef SE Coef T PConstant -2546.1 457.3 -5.57 0.000Gest 147.21 11.97 12.29 0.000NonsmokersThe regression equation is Weight = - 2475 + 139 Gest

    Predictor Coef SE Coef T PConstant -2474.6 554.0 -4.47 0.001Gest 139.03 14.11 9.85 0.000Smokers

  • Reasons to pool the data and to fit one regression functionIt allows you to easily answer research questions concerning the binary predictor variable.

  • What if we instead tried to use two indicator variables?One variable for smokers and one variable for nonsmokers?

  • Definition of two indicator variables one for each groupUsing a (0,1) indicator variable for nonsmokersxi2 = 1, if mother smokesxi2 = 0, if mother does not smokeUsing a (0,1) indicator variable for smokersxi3 = 1, if mother does not smokexi3 = 0, if mother smokes

  • The modified regression functionwith two binary predictorswhere Y is mean birth weight for given predictors xi1 is length of gestation of baby i xi2 = 1, if smokes and xi2 = 0, if not xi3 = 1, if not smokes and xi3 = 0, if smokes

  • Implication on data analysisRegression Analysis: Weight versus Gest, x2*, x3*

    * x3* is highly correlated with other X variables* x3* has been removed from the equation

    The regression equation isWeight = - 2390 + 143 Gest - 245 x2*

    Predictor Coef SE Coef T PConstant -2389.6 349.2 -6.84 0.000Gest 143.100 9.128 15.68 0.000x2* -244.54 41.98 -5.83 0.000

    S = 115.5 R-Sq = 89.6% R-Sq(adj) = 88.9%

  • To prevent problems with the data analysisA qualitative variable with c groups should be represented by c-1 indicator variables, each taking on values 0 and 1.2 groups, 1 indicator variable3 groups, 2 indicator variables4 groups, 3 indicator variablesand so on

  • What is the impact of using a different coding scheme? such as (1, -1) coding?

  • The regression model defined using (1, -1) coding schemewhere yi is birth weight of baby i xi1 is length of gestation of baby i xi2 = 1, if mother smokes and xi2 = -1, if not

  • The regression model yields 2 different response functionsIf mother is a smoker (xi2 = 1):If mother is a nonsmoker (xi2 = -1):

  • Interpretation of the regression coefficientsrepresents the change in the mean response Y for each additional unit increase in the quantitative predictor x1 for both groups.

  • The estimated regression functionThe regression equation isWeight = - 2512 + 143 Gest - 122 Smoking2

  • What is impact of using different coding scheme?Interpretation of regression coefficients changes.When reporting your results, make sure you explain what coding scheme was used!When interpreting others results, make sure you know what coding scheme was used!