前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >R语言代做编程辅导因子实验设计STA305/1004 Assignment(附答案)

R语言代做编程辅导因子实验设计STA305/1004 Assignment(附答案)

原创
作者头像
拓端
发布2022-12-14 22:19:28
2040
发布2022-12-14 22:19:28
举报
文章被收录于专栏:拓端tecdat

全文链接: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.

代码语言:javascript
复制
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

代码语言:javascript
复制
# 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, q

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 全文链接:http://tecdat.cn/?p=30896
  • Sample R Code for STA305/1004 Assignment 3
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档