59.0k views
4 votes
An article reports the following data on yield (y), mean temperature over the period between date of coming into hops and date of picking (x1), and mean percentage of sunshine during the same period (x2) for the Fuggle variety of hop:

x1: 16.7 17.4 18.4 16.8 18.9 17.1 17.3 18.2 21.3 21.2 20.7 18.5
x2: 30 42 47 47 43 41 48 44 43 50 56 60
y: 210 110 103 103 91 76 73 70 68 53 45 31

Use the following R Code to complete the regression analysis:
x1 = c(16.7, 17.4, 18.4, 16.8, 18.9, 17.1, 17.3, 18.2, 21.3, 21.2, 20 7, 18.5)
x2 = c(30, 42, 47, 47, 43, 41, 48, 44, 43, 50, 56, 60)
y = c(210, 110, 103, 103, 91, 76, 73, 70, 68, 53, 45, 31)

Required:
According to the output, what is the least squares regression equation ŷ = bo + b1x1 + b2x2:

1 Answer

2 votes

Answer:


y = 415.113 -6.593 x_1 -4.504 x_2

Explanation:

Given


x_1: 16.7\ 17.4\ 18.4\ 16.8\ 18.9\ 17.1\ 17.3\ 18.2\ 21.3\ 21.2\ 20.7\ 18.5


x_2: 30\ 42\ 47\ 47\ 43\ 41\ 48\ 44\ 43\ 50\ 56\ 60


y: 210\ 110\ 103\ 103\ 91\ 76\ 73\ 70\ 68\ 53\ 45\ 31

Required

Use R code to determine the regression equation


y = b_o + b_1x_1 + b_2x_2

First, write the following code in a R program


x1 <- c(16.7,17.4,18.4,16.8,18.9,17.1,17.3,18.2,21.3,21.2,20.7,18.5)


x2 <- c(30,42,47,47,43,41,48,44,43,50,56,60)


y <- c(210,110,103,103,91,76,73,70,68,53,45,31)


mod <- lm(y~
x1+x2)\\


summary(mod)

Next, run the program

See attachment for program and output

From the output, go to coefficients:

Check Estimate Std. column, you have the following:


(Intercept) = 415.113


x_1 = -6.593


x_2 = -4.504


y = b_o + b_1x_1 + b_2x_2 implies that:


b_o \to Intercept


b_1 \to x_1


b_2 \to x_2

Hence, the least square regression equation is:


y = 415.113 -6.593 x_1 -4.504 x_2

An article reports the following data on yield (y), mean temperature over the period-example-1
User Nikolay Kovalenko
by
5.7k points