Question: A data.frame: 1 5 times 5 pH nisin temp brix growth 1 5 . 5 7 0 4 3 1 9 0 2 5
A data.frame: times
pH nisin temp brix growth
Call:
glmformula growth ~ pH nisin temp brix, family "binomial",
data apple.data
Deviance Residuals:
Min Q Median Q Max
Coefficients:
Estimate Std Error z value Prz
Intercept
pH
nisin
temp
brix
Signif. codes:
Dispersion parameter for binomial family taken to be
Null deviance: on degrees of freedom
Residual deviance: on degrees of freedom
AIC:
Number of Fisher Scoring iterations:
The Effects of Temp The correct code for question is shown below. Please help me answer question
What if we want to determine how a specific predictor affects the probability or odds, in the Logistic Regression case of growth One idea would be to calculate the odds of growth, given different levels of that predictor, while keeping all other predictors constant. Then we could compare the difference between the odds, to see if a larger predictor resulted in a larger probability.
Using your model, calculate the odds of growth with a temperature at the first quartile and at the third quartile, assuming all other features are held constant. Then calculate the difference between the two and store that value as temp.odds.diff.
To calculate this difference, it may be helpful to first think through this equation. Note that oi is the odds of growth for the it quantile.
doo explogoo expnn
If we let this difference be d then this value can be interpreted as "The odds of showing evidence of growth is d moreless when the temperature is in the first quantile than in the third quantile, when adjusted for other predictors."
mod predictglmodapple, newdata data.frametemp quantileappledata$temp,
pH meanappledata$pH
nisin meanappledata$nisin
brix meanappledata$brix
mod predictglmodapple, newdata data.frametemp quantileappledata$temp,
pH meanappledata$pH
nisin meanappledata$nisin
brix meanappledata$brix
oddsfirst expmod
oddsthird expmod
temp.odds.diff oddsfirst oddsthird
temp.odds.diff
But there's more than that.
Remember, we're assuming all of our predictors come from some distribution, meaning there is some inherent randomness in our values and calculations. A pointvalue is only so helpful. If we really want to understand the difference, we should calculate the range of values that the difference could potentially fall within.
Calculate the confidence interval for this difference. Store the lower bound in temp.odds.lower and the upper bound in temp.odds.upper.
Hint: You can get the Standard Error of temp from your model.
temp.odds.lower NA
temp.odds.upper NA
# your code here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
