实验设计与分析(第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)

相关推荐
weixin_4932026316 小时前
R语言错误处理方法大全
开发语言·r语言
lishaoan7717 小时前
实验设计与分析(第6版,Montgomery)第4章随机化区组,拉丁方, 及有关设计4.5节思考题4.1~4.4 R语言解题
r语言·统计分析·方差分析·实验设计与分析·随机化区组
lishaoan7718 小时前
实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.5 R语言解题
r语言·方差分析·实验设计与分析·残差分析·正态性假设·交互作用·析因实验
lishaoan771 天前
实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.2 R语言解题
r语言·统计分析·方差分析·实验设计与分析·残差分析·交互作用·析因实验
南瓜胖胖2 天前
【R语言编程绘图-plotly】
开发语言·plotly·r语言
Chef_Chen2 天前
从0开始学习R语言--Day12--泊松分布
开发语言·学习·r语言
开开心心就好2 天前
高效合并 Excel 表格实用工具
开发语言·javascript·python·qt·r语言·ocr·excel
lishaoan772 天前
实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.7 R语言解题
r语言·方差分析·实验设计与分析·残差分析·正态假设·析因实验·等值线图
lishaoan773 天前
实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.8 R语言解题
r语言