


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



X <- c (12,12,16,16,16,20,20,20,24,24,24,28,28) Y <- c (130.5,129.6,142.5,140.3,143.4,145.2,144.9,144.2,147.8,146.6,148.4,134.8,135.1) model <- lm (Y ~ X + I (X ห 2)) summary (model)
The coefficient for X , ฮฒ ห 1 , represents the instantaneous rate of change in yield for a one-unit increase in planting rate, assuming X^2 is held constant. However, since this is a quadratic model, ฮฒ 1 alone does not capture the full marginal effect, which depends on both X and X^2.
Y_adj <- Y - 9 ***** X X2 <- X ห 2
model_revised <- lm (Y_adj ~ X2)
summary (model_revised)
n <- length (X) x_star_vals <- numeric (B)
for (i in 1 : B) { idx <- sample (1 : n, replace = TRUE) Xb <- X[idx] Yb <- Y[idx]
model_boot <- lm (Yb - 9 ***** Xb ~ I (Xb ห 2)) beta_b_hat <- coef (model_boot)[2]
x_star_vals[i] <- - 9 / (2 ***** beta_b_hat) }
ci_boot <- quantile (x_star_vals, probs = c (0.025, 0.975)) print (ci_boot)