An operation research analyst investing the relationship between production lot size (x) and the average production cost per unit (y). A study of recent operations provides the following data:
x 100 120 140 160 180 200 220 240 260 280 300
y $9.73 9.61 8.15 6.98 5.87 4.98 5.09 4.79 4.02 4.46 3.82
The analyst suspects that a piecewise linear regression model should be fit to these data. Estimate the parameters in such a model assuming that the slope of the line changes at x = 200 units. Do the data support the use of this model?
Please show all your work with R code
> x=c(100,120,140,160,180,200,220,240,260,280,300);x
[1] 100 120 140 160 180 200 220 240 260 280 300
>
y=c(9.73,9.61,8.15,6.98,5.87,4.98,5.09,4.79,4.02,4.46,3.82);y
[1] 9.73 9.61 8.15 6.98 5.87 4.98 5.09 4.79 4.02 4.46 3.82
> dataset=data.frame(x,y);dataset
x y
1 100 9.73
2 120 9.61
3 140 8.15
4 160 6.98
5 180 5.87
6 200 4.98
7 220 5.09
8 240 4.79
9 260 4.02
10 280 4.46
11 300 3.82
> model=lm(y~x,data=dataset);model
Call:
lm(formula = y ~ x, data = dataset)
Coefficients:
(Intercept) x
12.29091 -0.03077
Regression equation is
yest=12.29091-0.03077*x
for x=200
yest=6.1369
Get Answers For Free
Most questions answered within 1 hours.