Sample Exam 1

26 downloads 138727 Views 168KB Size Report
small-cell lung cancer.” The number 1.7 is a sample odds ratio. (c). Using data from the Harvard Physician's Health Study, we find a 95% confidence interval for  ...
STA 4504/5503 Categorical Data Analysis

Sample Exam 1

Spring 2011

1. Indicate whether each of the following is true (T) or false (F). (a)

In 2×2 tables, statistical independence is equivalent to a population odds ratio value of θ = 1.0.

(b)

A British study reported in the New York Times: (Dec. 3, 1998) stated that of smokers who get lung cancer, “women were 1.7 times more vulnerable than men to get small-cell lung cancer.” The number 1.7 is a sample odds ratio.

(c)

Using data from the Harvard Physician’s Health Study, we find a 95% confidence interval for the relative risk relating having a heart attack to drug (placebo, aspirin) to be (1.4, 2.3). If we had formed the table with aspirin in the first row (instead of placebo), then the 95% confidence interval would have been (1/2.3, 1/1.4) = (.4, .7).

(d)

Pearson’s chi-squared test of independence treats both the rows and the columns of the contingency table as nominal scale; thus, if either or both variables are ordinal, the test ignores that information.

(e)

For testing independence with random samples, Pearson’s X 2 statistic and the likelihood-ratio G2 statistic both have chi-squared distributions for any sample size, as long as the sample was randomly selected.

(f)

Fisher’s exact test is a test of the null hypothesis of independence for 2×2 contingency tables that fixes the row and column totals and uses a hypergeometric distribution for the count in the first cell. For a one-sided alternative of a positive association (i.e., odds ratio > 1), the P-value is the sum of the probabilities of all those tables that have count in the first cell at least as large as observed, for the given marginal totals.

(g)

The difference of proportions, relative risk, and odds ratio are valid measures for summarizing 2×2 tables for either prospective or retrospective (e.g., case-control) studies.

(h)

In a 5×2 contingency table that compares 5 groups on a binary response variable, the G2 chi-squared statistic with df = 4 for testing independence can be exactly partitioned into 4 separate independent chi-squared statistics that each have df = 1 by comparing row 1 to row 5, row 2 to row 5, row 3 to row 5, and row 4 to row 5.

(i)

An ordinary regression model that treats the response Y as having a normal distribution is a special case of a generalized linear model, with normal (a.k.a. Gaussian) random component and identity link function.

(j)

One question in a recent General Social Survey asked subjects how many times they had had sexual intercourse in the previous month. The sample means were 5.9 for the male respondents and 4.3 for the female respondents; the sample variances were 54.8 and 34.4. The modal response for each gender was 0. Since the response variable is a count, the best way to model this count with gender as an indicator explanatory variable would be to use a Poisson generalized linear model.

STA 4504/5503 Sample Exam 1

2

2. Each of 100 multiple-choice questions on an exam has five possible answers but one correct response. For each question, a student randomly selects one response as the answer. (a) Specify the probability distribution of the student’s number of correct answers on the exam, identifying the parameter(s) for that distribution. (b) Would it be surprising if the student made at least 50 correct responses? Explain your reasoning. 3. Consider the following data from a women’s health study (MI is myocardial infarction, i.e., heart attack).

Oral Contraceptives

Used Never Used

MI Yes No 23 34 35 132

(a) Construct a 95% confidence interval for the population odds ratio. (b) Suppose that the answer to part (a) is (1.3, 4.9). Does it seem plausible that the variables are independent? Explain. 4. For adults who sailed on the Titanic on its fateful voyage, the odds ratio between gender (female, male) and survival (yes, no) was 11.4. (a) What is wrong with the interpretation, “The probability of survival for females was 11.4 times that for males.” (b) When would the quoted interpretation be approximately correct? Why? (c) The odds of survival for females equaled 2.9. For each gender, find the proportion who survived. 5. Explain what is meant by overdispersion, and explain how it can occur for Poisson generalized linear models for count data. 6. Explain two ways in which the generalized linear model extends the ordinary regression model that is commonly used for quantitative response variables.

STA 4504/5503 Sample Exam 1

3

7. In a recent General Social Survey, gender was cross-classified with party identification. The output below shows some results. (a) Explain what the numbers in the “expected” table represent. Show how to obtain 261.42. (b) Explain how to interpret the p-value given for the Chi-square statistic. (c) Explain how to interpret the output of the last command (myadjresids). Which counts were significantly higher than one would expect if party identification were independent of gender? > gp party gender dem indep rep female 279 73 225 male 165 47 191 > addmargins(gp) party gender dem indep rep Sum female 279 73 225 577 male 165 47 191 403 Sum 444 120 416 980 > gp.chisq gp.chisq Pearson’s Chi-squared test data: gp X-squared = 7.0095, df = 2, p-value = 0.03005

> gp.chisq$expected party gender dem indep rep female 261.42 70.653 244.93 male 182.58 49.347 171.07 > round(myadjresids(gp), 2) party gender dem indep rep female 2.29 0.46 -2.62 male -2.29 -0.46 2.62

STA 4504/5503 Sample Exam 1

4

8. For the 23 space shuttle flights that occurred before the Challenger mission in 1986, the table below shows the temperature (◦ F ) at the time of the flight and whether at least one of the six primary O-rings suffered thermal distress (1 = yes, 0 = no). The R shows the results of fitting various models to these data. (a) For the logistic regression model using temperature as a predictor for the probability of thermal distress, calculate the estimated probability of thermal distress at 31◦ , the temperature at the time of the Challenger flight. (b) At the temperature at which the estimated probability equals 0.5, give a linear approximation for the change in the estimated probability per degree increase in temperature. (c) Interpret the estimated effect of temperature on the odds of thermal distress. (d) Test the hypothesis that temperature has no effect, using the likelihood-ratio test. Interpret results. (e) Suppose we treat the (0, 1) response as if it has a normal distribution, and fit a linear model for the probability. Report the prediction equation, and find the estimated probability of thermal distress at 31◦ . Comment on the suitability of this model. (f) Suppose you also wanted to include in the model the month during which the launch occurred (January, February, etc.). Show how you could add indicator variables to the model to allow this. Explain how to interpret the coefficients of the indicator variables. (g) Refer to the previous part. Explain how you could further generalize the model to allow interaction between temperature and month of the launch, and explain how you could conduct a test to investigate whether you need the interaction terms. Space shuttle data Ft

Temp

TD

Ft

Temp

TD

Ft

Temp

TD

Ft

Temp

TD

1 5 9 13 17 21

66 67 57 67 70 75

0 0 1 0 0 1

2 6 10 14 18 22

70 72 63 53 81 76

1 0 1 1 0 0

3 7 11 15 19 23

69 73 70 67 76 58

0 0 1 0 0 1

4 8 12 16 20

68 70 78 75 79

0 0 0 0 0

Note: Ft = flight no., Temp = temperature, TD = thermal distress (1 = yes, 0 = no). Data based on Table 1 in J. Amer. Statist. Assoc, 84: 945-957, (1989), by S. R. Dalal, E. B. Fowlkes, and B. Hoadley.

STA 4504/5503 Sample Exam 1

5

---------------------------------------------------------------------Call: glm(formula = TD ~ Temp, family = binomial, data = shuttle) Deviance Residuals: Min 1Q Median -1.061 -0.761 -0.378

3Q 0.452

Max 2.217

Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 15.043 7.379 2.04 0.041 Temp -0.232 0.108 -2.14 0.032 (Dispersion parameter for binomial family taken to be 1) Null deviance: 28.267 Residual deviance: 20.315 AIC: 24.32

on 22 on 21

degrees of freedom degrees of freedom

Number of Fisher Scoring iterations: 5 ----------------------------------------------------------------------

---------------------------------------------------------------------Call: glm(formula = TD ~ 1, family = binomial, data = shuttle) Deviance Residuals: Min 1Q Median -0.852 -0.852 -0.852

3Q 1.542

Max 1.542

Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.827 0.453 -1.82 0.068 (Dispersion parameter for binomial family taken to be 1) Null deviance: 28.267 Residual deviance: 28.267 AIC: 30.27

on 22 on 22

degrees of freedom degrees of freedom

Number of Fisher Scoring iterations: 4 ----------------------------------------------------------------------

STA 4504/5503 Sample Exam 1

6

---------------------------------------------------------------------Call: lm(formula = TD ~ Temp, data = shuttle) Residuals: Min 1Q Median -0.4376 -0.3068 -0.0638

3Q 0.1745

Max 0.8988

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.9048 0.8421 3.45 0.0024 Temp -0.0374 0.0120 -3.10 0.0054 Residual standard error: 0.399 on 21 degrees of freedom Multiple R-squared: 0.314,Adjusted R-squared: 0.282 F-statistic: 9.63 on 1 and 21 DF, p-value: 0.00538 ----------------------------------------------------------------------

STA 4504/5503 Sample Exam 1

7

Formulas Binomial: P (y) =

Poisson: P (y) =

N! π y (1 − π)N −y , y = 0, 1, 2, ..., N, y!(N − y)!

µy e−µ , y!

π , 1−π

π=

π1 /(1 − π1 ) θ= , π2 /(1 − π2 )

odds , 1 + odds

rij = p

relative risk =

n11 n22 θˆ = , n12 n21

X (nij − µ ˆij )2 X = , µ ˆ ij ij 2

p N π(1 − π)

y = 0, 1, 2, 3, . . .

   n1+ n2+ n11 n −n  +1 11 , Hypergeometric: P (n11 ) = n n+1

odds =

µ = N π, σ =

2

G =2

X

π1 π2

ˆ = SE(log θ)

 nij log

ij

nij µ ˆij

  a a! where = b b!(a − b)!

r

1 1 1 1 + + + n11 n12 n21 n22

 ,

µ ˆij =

ni+ n+j , n

df = (I − 1)(J − 1)

nij − µ ˆij µ ˆij (1 − pi+ )(1 − p+j )

LR statistic = −2(L0 − L1 ) = difference in deviances

For H0 : β = 0, Wald statistic = z =

βˆ SE

Simple logistic regression: logit[π(x)] = α + βx

α ˆ π ˆ = 0.5 at x = − , βˆ

π(x) =

exp(α + βx) 1 + exp(α + βx)

incremental rate of change = βˆπ ˆ (1 − π ˆ ),

logit(π) = α + β1 x1 + · · · + βk xk ,

π=

ˆ

eβ = estimated odds ratio

exp(α + β1 x1 + · · · + βk xk ) 1 + exp(α + β1 x1 + · · · + βk xk )

STA 4504/5503 Sample Exam 1

8

Chi-Squared Distribution Values for Various Right-Tail Probabilities Right-Tail Probability df 1 2 3 4 5 6 7 8 9 10

0.250 1.32 2.77 4.11 5.39 6.63 7.84 9.04 10.22 11.39 12.55

0.100 2.71 4.61 6.25 7.78 9.24 10.64 12.02 13.36 14.68 15.99

0.050 3.84 5.99 7.81 9.49 11.07 12.59 14.07 15.51 16.92 18.31

0.025 5.02 7.38 9.35 11.14 12.83 14.45 16.01 17.53 19.02 20.48

0.010 6.63 9.21 11.34 13.28 15.09 16.81 18.48 20.09 21.67 23.21

0.005 7.88 10.60 12.84 14.86 16.75 18.55 20.28 21.95 23.59 25.19

0.001 10.83 13.82 16.27 18.47 20.52 22.46 24.32 26.12 27.88 29.59

11 12 13 14 15 16 17 18 19 20

13.70 14.85 15.98 17.12 18.25 19.37 20.49 21.60 22.72 23.83

17.28 18.55 19.81 21.06 22.31 23.54 24.77 25.99 27.20 28.41

19.68 21.03 22.36 23.68 25.00 26.30 27.59 28.87 30.14 31.41

21.92 23.34 24.74 26.12 27.49 28.85 30.19 31.53 32.85 34.17

24.72 26.22 27.69 29.14 30.58 32.00 33.41 34.81 36.19 37.57

26.76 28.30 29.82 31.32 32.80 34.27 35.72 37.16 38.58 40.00

31.26 32.91 34.53 36.12 37.70 39.25 40.79 42.31 43.82 45.31

25 30 40 50 60 70 80 90 100

29.34 34.38 37.65 40.65 44.31 46.93 52.62 34.80 40.26 43.77 46.98 50.89 53.67 59.70 45.62 51.81 55.76 59.34 63.69 66.77 73.40 56.33 63.17 67.50 71.42 76.15 79.49 86.66 66.98 74.40 79.08 83.30 88.38 91.95 99.61 77.58 85.53 90.53 95.02 100.43 104.21 112.32 88.13 96.58 101.88 106.63 112.33 116.32 124.84 98.65 107.57 113.15 118.14 124.12 128.30 137.21 109.14 118.50 124.34 129.56 135.81 140.17 149.45

Source: Calculated using R, available for free on the net.