实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.13 R语言解题

本文是实验设计与分析(第6版,Montgomery著,傅珏生译) 第5章析因设计引导5.7节思考题5.13 R语言解题。主要涉及方差分析,正态假设检验,残差分析,交互作用图。

dataframe<-data.frame(

y=c(36,18,30,39,20,37,36,22,33,32,20,34),

column=gl(4,3,12),

row=gl(3,1,12))

summary (dataframe)

dataframe.aov2 <- aov(y~column+row,data=dataframe)

summary (dataframe.aov2)

> summary (dataframe.aov2)

Df Sum Sq Mean Sq F value Pr(>F)

column 3 28.9 9.64 2.006 0.214717

row 2 580.5 290.25 60.399 0.000106 ***

Residuals 6 28.8 4.81


Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

with(dataframe,interaction.plot(column,row,y,type="b",pch=19,fixed=T,xlab="column",ylab="y"))

plot.design(y~column*row,data=dataframe)

fit <-lm(y~column+row,data=dataframe)

anova(fit)

summary(fit)

par(mfrow=c(2,2))

plot(fit)

par(mfrow=c(2,2))

plot(as.numeric(dataframecolumn), fitresiduals, xlab="column", ylab="Residuals", type="p", pch=16)

plot(as.numeric(dataframerow), fitresiduals, xlab="row", ylab="Residuals", pch=16)

相关推荐
Tiger Z2 天前
《R for Data Science (2e)》免费中文翻译 (第7章) --- Data import(1)
r语言·数据科学·中文翻译
魔力之心2 天前
R notes[2]
开发语言·r语言
Tiger Z4 天前
R 语言科研绘图第 71 期 --- 散点图-边际
r语言·论文·科研·绘图·研究生
小丑尽欢4 天前
R语言根据经纬度获得对应样本的省份
开发语言·r语言
czhc11400756636 天前
Linux 830 shell:expect,ss -ant ,while IFS=read -r line,
linux·运维·r语言
Morpheon6 天前
Intro to R Programming - Lesson 4 (Graphs)
开发语言·r语言
医工交叉实验工坊9 天前
R 语言 ComplexUpset 包实战:替代 Venn 图的高级集合可视化方案
算法·r语言
青春不败 177-3266-05209 天前
R语言贝叶斯方法在生态环境领域中的高阶技术应用
r语言·贝叶斯·生态学·科研绘图·结构方程·环境科学·混合效应
love530love10 天前
怎么更新 cargo.exe ?(Rust 工具链)
人工智能·windows·python·rust·r语言
烟锁池塘柳013 天前
【R语言】R语言中 rbind() 与 merge() 的区别详解
sql·r语言