DOC PREVIEW
UIUC STAT 420 - HW #3

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Boyang DaiSTAT 6120HW #3#3.10data=read.table("http://www.stat.lsu.edu/exstweb/statlab/datasets/KNNLData/CH03PR10.txt")Fitted= data[,1]Residuals= data[,2]plot(Fitted,Residuals,xlab=expression(hat(Y)),ylab="Semistudentized Residuals",main="Semistudentized residuals vs. (hat(Y))")abline(h = 0, col = "red")abline(h = c(-1,1), col = "red", lwd = 2) There are 4 semistudentized residuals outside ±1 standard deviation. Since a plot of semistudentized residuals vs. Fitted value shows the property of nonlinearity of regression function, this plot appears as a random cloud of points centered at 0 under linearity, and they follows normal distribution.#3.15a) data=read.table("http://www.stat.lsu.edu/exstweb/statlab/datasets/KNNLData/CH03PR15.txt")y = data[,1]x = data[,2]lm = lm(y ~ x)lmCall:lm(formula = y ~ x)Coefficients:(Intercept) x 2.575 -0.324b)Alternatives: H0: β1 = 0 vs Ha: β1 ≠ 0Decision Rule: F* > F(0.975; 3, 10), we conclude H1F* < F(0.975; 3, 10), we conclude H0Conclusion: F value = 55.994; F(0.975; 3, 10) = 3.71F* > F(0.975; 3, 10), we conclude that β1 ≠ 0The regression function is linear.c)We can conclude that there is a lack of fit of a linear regression function exists.#3.16a)plot(x,y, xlab = "Time",ylab = "Concentration of Solution", main = "Scatter Plot of the Data")lines(x,y, type = "o")The scatter plot suggests a Y’ = log10Y transformations on Y. b)sse <- c()lambda <- c()i <- 1gmean <- exp(mean(log(y)))for (lam in seq(-.2, .2,0.1)){if(lam != 0){tY <- (y^lam - 1)/(lam*gmean^(lam - 1))}else{tY <- log(y)*gmean}test <- anova(lm(tY ~ x))sse[i] <- test['Residuals','Sum Sq']lambda[i] <- lami <- i+1}cbind(lambda,sse) lambda sse[1,] -0.2 0.12353047[2,] -0.1 0.06505067[3,] 0.0 0.03897303[4,] 0.1 0.04396062[5,] 0.2 0.08131793In this case, the best box-cox transformation of the data is given by = 0, corresponding to the Y’ = lnY λtransformation. c)d <- cbind(data, log10(y))Y = d[,3]NewModel <- lm(Y ~ x)NewModelCall:lm(formula = Y ~ x)Coefficients:(Intercept) x 0.6549 -0.1954 => Y’ = Log10Y = 0.6549 – 0.1954Xd)plot(Y ~ x, main = "Estimated Regression Line", xlab = "Year", ylab = "Predicted Y")abline(NewModel, col = "red")The regression line appears to be a good fit.e)concentration.res = resid(NewModel)plot(x, concentration.res, ylab = "Residuals", xlab = "Time", main = "Predicted Concentration")abline(0,0, pch = 22, lty = 2, col = "red")concentration.stdres = rstandard(NewModel)qqnorm(concentration.stdres, ylab = "Cumulative Distribution of Residaul", xlab = "Normal Cumulative Distributions", main = "Predicted Concentration")qqline(concentration.stdres)The residual plot shows fairly constant variability and the normal probability plot shows normality since it is fairly linear. f)Since Y’ = log10Y = 0.6549 – 0.1954X, we can obtain:Y =


View Full Document

UIUC STAT 420 - HW #3

Documents in this Course
Load more
Download HW #3
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view HW #3 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view HW #3 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?