关于数据挖掘:R语言代做编程辅导因子实验设计STA3051004-Assignment附答案

6次阅读

共计 1911 个字符,预计需要花费 5 分钟才能阅读完成。

全文链接:http://tecdat.cn/?p=30896

(Adapted from Wu, Hamada, 2009) The following experiment was performed at a pulp mill. Plant performance is based on pulp brightness as
measured by a reflective meter. Each of the shift operators (dentoted A, B, C, and D) made five pulp handsheets from unbleached pulp.
Reflectance was read for each of the handsheets using a brightness tester as reported in the table below:

The goal of the experiment is to determine whether there are differences between the operators in making the handsheets and reading thier
brightness.
a. What is the null and alternative hypothesis corresponding to the experimental goal. Calculate the means and standard deviations for each
operator. Based on these summary statistics is there evidence of difference between operators?
b. Use R to fit the following model to the data using the default coding contr. treatment (4)

wherei= 1…,4,j= 1…..5 , where yij is the jfh
observation with operator i.
●Interpret the model parameters η, Ti, Eij and their associated p-values.
●What do you assume about Eij? Check if these assumptions are fuflilled.

sapply(split(reflect,operator),mean)
sapply(split(reflect,operator),sd)

contrasts(pulpdat$operator) <- contr.treatment(4)

contrasts(pulpdat$operator) <- contr.sum(4)
 

pairwise.t.test(reflect,ope

Sample R Code for STA305/1004 Assignment 3



# Question 1

# Read in data for question #1
pulpdat <- read.csv("/Users/nathantaback/Dropbox/Docs/sta305/2015/assignments/Assignment3/pulpdat.csv")
attach(pulpdat)

#Calculate means and sd for each operator
sapply(split(reflect,operator),mean)
sapply(split(reflect,operator),sd)

# Model using treatment contrasts
contrasts(pulpdat$operator) <- contr.treatment(4)
mod1 <- lm(reflect~operator,data=pulpdat)
summary(mod1)

# Model using deviation coding
contrasts(pulpdat$operator) <- contr.sum(4)
mod2 <- lm(reflect~operator,data=pulpdat)
summary(mod2)

#
pairwise.t.test(reflect,operator,conf.level=0.95,p.adj = "bonf")
TukeyHSD(aov(reflect~operator),conf.level=0.95)

# Question 3

# Read in BHH Data from chapter 5, problem 6 
prb0506 <- read.table("~/Dropbox/Docs/sta305/BHHData/BHH2-Data/prb0506.dat", header=TRUE, quote="\"")
正文完
 0