Professional Documents
Culture Documents
Logistics Models: Question One (Exercise 6.1)
Logistics Models: Question One (Exercise 6.1)
Solution to Exercises
()
¿
πR
(a) We are to find a prediction equation for log ¿
πD
() ( )
¿ ¿ ¿
πR π R/ πI
log ¿ =log ¿ ¿
πD π D /π I
() ()
¿ ¿
πR πD
¿ log ¿ −log ¿
πI πI
This gives
is equivalent to $46,000. For tis reason, we can conclude that the x range for which
¿ ¿
π R > π D is x > $46,000
¿
(c) State the prediction equation for π I
∑ e α +β x i i
i=1
0+ 0 x
e
¿ 1.0 +0.3 x 3.3−0.2 x 0+0 x
e +e +e
1
¿ 1.0 +0.3 x 3.3−0.2 x
e +e +1
Since I is the baseline category, we take α I and β I as zero
Question Two (Exercise 6.2)
We want to use the model fit to estimate the odd ratio that describes the effect of length on
primary food choice being either invertebrate or other.
require(foreign)
require(nnet)
food= read.csv("Alligator.csv")
test=multinom(y ~ x, data=food)
## # weights: 9 (4 variable)
## initial value 64.818125
## iter 10 value 49.170710
## final value 49.170622
## converged
summary(test)
## Call:
## multinom(formula = y ~ x, data = food)
##
## Coefficients:
## (Intercept) x
## I 4.079701 -2.3553303
## O -1.617713 0.1101012
##
## Std. Errors:
## (Intercept) x
## I 1.468640 0.8032870
## O 1.307274 0.5170823
##
## Residual Deviance: 98.34124
## AIC: 106.3412
summary(test)$coefficients/summary(test)$standard.errors
## (Intercept) x
## I 2.777877 -2.9321155
## O -1.237471 0.2129279
Interpretation: The odd ratio/ risk ratio of one unit increase in length is 0.0948 for food
choice being Invertebrate and the old ratio of a unit increase in the length is 1.116 for food
choice being others
#Extra Point
require(foreign)
require(nnet)
food2= read.csv("attachment.csv")
test2= multinom(Naltrexone~ Sex, data= food2)
## # weights: 3 (2 variable)
## initial value 604.424341
## final value 604.220528
## converged
summary(test2)$coefficients/summary(test2)$standard.errors
## (Intercept) Sex
## -0.3819357 0.1898454
plot(test2$residuals)
plot(test2$fitted.values)
Question Three (Exercise 6.20)
(a) FALSE. Although it is better for one to treat an ordinal variable with methods that use
the ordering in testing effects, the Chi-square statistic does not put ordering into
considerartion because even if any row is interchanged for the the other, the test
statistic remain unchanged. Therefore chi-square is not the most powerful tool here
just because of its lower degree of freedom.
(b) TRUE. The assumption holds that the cummulative logit takes Y as ordinal and
therfore a nominal Y shouldn't be used.
(c) TRUE. This is becasue the catogories indicate that Y is ordinal (i.e a categorical
variable); hence, the proportional odd assumption will fit well here.