library(readr)
d12_16<-read_csv("~/Downloads/exp12-16.csv")
## Rows: 16 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): x, y
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
x<-d12_16$x
y<-d12_16$y
plot(x, y)+abline(lm(y ~ x, data = d12_16), col = "blue")
## integer(0)
###It does seem like the data has a linear relationship, thus it does support the use of simplear linear regression model.
LinearMod<-lm(y~x, data=d12_16)
summary(LinearMod)
##
## Call:
## lm(formula = y ~ x, data = d12_16)
##
## Residuals:
## Min 1Q Median 3Q Max
## -224.80 -153.36 -6.17 120.30 388.90
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1163.45 783.14 -1.486 0.175682
## x 245.15 45.91 5.340 0.000694 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 205.3 on 8 degrees of freedom
## (6 observations deleted due to missingness)
## Multiple R-squared: 0.7809, Adjusted R-squared: 0.7535
## F-statistic: 28.52 on 1 and 8 DF, p-value: 0.0006941
12.19
d12_19<-read_csv("~/Downloads/exp12-19.csv")
## Rows: 16 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): x, y
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
x<-d12_19$x
y<-d12_19$y
LM<-lm(y~x, data=d12_19)
summary(LM)
##
## Call:
## lm(formula = y ~ x, data = d12_19)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.0507 -0.9754 -0.4972 0.8232 3.5319
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -12.7369 7.8359 -1.625 0.126
## x 1.1942 0.1135 10.525 4.94e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.61 on 14 degrees of freedom
## Multiple R-squared: 0.8878, Adjusted R-squared: 0.8798
## F-statistic: 110.8 on 1 and 14 DF, p-value: 4.94e-08
12.35 ### B_1=(2759.6-((222.1)(193))/17)/(3056.69-((222.1)^2/17))=1.536 B_0=((193/17)-(1.536(222.1/17))) SSE=2975-(-8.7145)193-1.536(2759.6)=418.1529 sd=5.2799 SEslope=0.4241 CI=(0.6327, 2.4393 ###H0:B_1=0 Ha:B_1≠0 t=((1.536)/0.4241)=3.6218 ### It would not be sensible to use linear model for predicting percentage of nausea when the does equals 5 as this dose is out of range (extrapolation) ###B_1=(2744.6-((216.1)(190.5))/16)/(3020.69-((216.1)^2/16))=1.683 B_0=((216.1/16)-(1.638(190.5/16))) SSE=2968.75-(-10.83)190.5-1.683(2744.6)=412.7 sd=5.4294 SEslope=0.5376 CI=(0.5298, 2.8362)