Publications by lukewm2, section 4UG
lukewm2 ASRM 450 HW 2
set.seed(6733) QUESTION 1 Part (a) lukewm2 <- function(Y0, mu, phi, sigma, N) { outputArray <- rep(1, 200) Y1 <- mu + phi * (Y0 - mu) + rnorm(1, mean = 0, sd = sigma) outputArray[1] <- Y1 Ycount <- Y1 for (i in 2:N) { Ycount <- mu + phi * (Ycount - mu) + rnorm(1, mean = 0, sd = sigma) outputArray[i] <- Ycount } ou...
157 sym R (1411 sym/19 pcs) 3 img
Luke Miller lukewm2 ASRM 450 HW 2
set.seed(6733) QUESTION 1 Part (a) lukewm2 <- function(Y0, mu, phi, sigma, N) { outputArray <- rep(1, 200) Y1 <- mu + phi * (Y0 - mu) + rnorm(1, mean = 0, sd = sigma) outputArray[1] <- Y1 Ycount <- Y1 for (i in 2:N) { Ycount <- mu + phi * (Ycount - mu) + rnorm(1, mean = 0, sd = sigma) outputArray[i] <- Ycount } ou...
157 sym R (1411 sym/19 pcs) 3 img
HW 3
set.seed(6733) Question 1 Part (a) Input the data for x and y x = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) y = c(420,570,590,610,660,780,890,930,950,1010,1050,1060,1090,1100,1200,1186) n = length(x) Calculate the three sums of squares SXX = sum((x-mean(x))^2) SXY = sum((x-mean(x))*(y-mean(y))) SYY = sum((y-mean(y))^2) Output the sums of squares S...
1567 sym R (2786 sym/48 pcs) 4 img
lukewm2 HW 5
Question 2 x1 = c(2.4,0.7,1.5,3.7,1.6,1.2,3.3,3.4,2.9,1.8,2.0,2.0,0.8,1.6,2.6,0.5) x2 = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) x3 = c(1.9,1.6,1.8,1.7,1.7,1.6,1.6,2.1,2.0,2.2,1.9,2.0,2.1,1.9,2.4,1.9) y = c(415,570,580,615,645,760,890,925,950,1010,1035,1060,1085,1095,1180,1185) Part (b) and (c) fit = lm(y ~ x1 + x2 +x3) summary(fit) ## ## Call: ...
82 sym R (1577 sym/11 pcs)
hw 5.1
Question 2 x1 = c(2.4,0.7,1.5,3.7,1.6,1.2,3.3,3.4,2.9,1.8,2.0,2.0,0.8,1.6,2.6,0.5) x2 = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) x3 = c(1.9,1.6,1.8,1.7,1.7,1.6,1.6,2.1,2.0,2.2,1.9,2.0,2.1,1.9,2.4,1.9) y = c(415,570,580,615,645,760,890,925,950,1010,1035,1060,1085,1095,1180,1185) Part (b) and (c) fit = lm(y ~ x1 + x2 +x3) summary(fit) ## ## Call: ...
82 sym R (1577 sym/11 pcs)
lukewm2 hw 4
Question 2 The data set is below x = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) y = c(420,570,590,610,660,780,890,930,950,1010,1050,1060,1090,1100,1200,1186) fit = lm(y~x) Part (h) and part (i) summary(fit) ## ## Call: ## lm(formula = y ~ x) ## ## Residuals: ## Min 1Q Median 3Q Max ## -271 -87 -1 100 305 ## ##...
150 sym R (1682 sym/19 pcs)
Publish Document
Question 2 The data set is below x = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) y = c(420,570,590,610,660,780,890,930,950,1010,1050,1060,1090,1100,1200,1186) fit = lm(y~x) Part (h) and part (i) summary(fit) ## ## Call: ## lm(formula = y ~ x) ## ## Residuals: ## Min 1Q Median 3Q Max ## -271 -87 -1 100 305 ## ##...
150 sym R (1682 sym/19 pcs)
lukewm2 ASRM 450 HW 3
set.seed(6733) Question 1 Part (a) Input the data for x and y x = c(2,2,2,3,2,2,3,4,3,4,3,4,3,4,4,3) y = c(420,570,590,610,660,780,890,930,950,1010,1050,1060,1090,1100,1200,1186) n = length(x) Calculate the three sums of squares SXX = sum((x-mean(x))^2) SXY = sum((x-mean(x))*(y-mean(y))) SYY = sum((y-mean(y))^2) Output the sums of squares S...
1567 sym R (2786 sym/48 pcs) 4 img
lukewm2 hw 7
B1 = c(20,24,27,26,33) B2 = c(27,38,32,39,34) B3 = c(22,24,19,26,29) Yield = c(B1,B2,B3) Crop = c(rep("B1",5), rep("B2",5), rep("B3",5)) Part a y1_bar = mean(B1) s1_squared = (sum((B1-y1_bar)^2))/(length(B1)-1) s1_squared ## [1] 22.5 Part b results = glm(Yield ~ factor(Crop)) summary(aov(results)) ## Df Sum Sq Mean Sq F valu...
42 sym R (908 sym/9 pcs)
lukewm2 hw 8
Question 2 ygatorade = c(20,27,22) ypowerade = c(24,38,24) yaccelerade = c(27,32,19) ypedialyte = c(26,39,26) ypropel = c(33,34,29) y = c(ygatorade, ypowerade, yaccelerade, ypedialyte, ypropel) drink = c(rep(1,3), rep(2,3), rep(3,3), rep(4,3), rep(5,3)) drink ## [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 brand = c(rep(1:3,5)) brand ## [1] 1 2 3 ...
371 sym R (1536 sym/9 pcs) 1 img