重命名方差分析中的因素 Table
Renaming Factors in an ANOVA Table
我想重命名我的双向方差分析 table 的输出。这是 table:
的代码
```{r complete model anova weld}
weld$fgage = as.factor(weld$gage); weld$ftime = as.factor(weld$time)
wmoda = aov(weld$strength ~ weld$fgage*weld$ftime); waova = anova(wmoda)
waova2 = round(waova, 2)
options(knitr.kable.NA = '-')
kable(waova2, col.names = c("Df", "Sum Sq", "Mean Sq", "F-Value", "P-
Value"),
caption = '\label{tab:waova}The two-way ANOVA table for the welding
experiment (complete model).')
```
下面是 table 打印时的样子:
我想更改最左侧列中的名称(weld$fgage、weld$ftime 和 weldfgage : weldftime), 因为它们阻止了 table 更 presentable.
有人知道我会怎么做吗?
谢谢!
对于此示例,您可以在
之前使用以下代码
```{r complete model anova weld}
weld$fgage = as.factor(weld$gage); weld$ftime = as.factor(weld$time)
wmoda = aov(weld$strength ~ weld$fgage*weld$ftime); waova = anova(wmoda)
waova2 = round(waova, 2)
options(knitr.kable.NA = '-')
row.names(waova2)[1:3] = c("Factor A", "Factor B", "Interaction")
kable(waova2, col.names = c("Df", "Sum Sq", "Mean Sq", "F-Value", "P-
Value"),
caption = '\label{tab:waova}The two-way ANOVA table for the welding
experiment (complete model).')
```
我想重命名我的双向方差分析 table 的输出。这是 table:
的代码```{r complete model anova weld}
weld$fgage = as.factor(weld$gage); weld$ftime = as.factor(weld$time)
wmoda = aov(weld$strength ~ weld$fgage*weld$ftime); waova = anova(wmoda)
waova2 = round(waova, 2)
options(knitr.kable.NA = '-')
kable(waova2, col.names = c("Df", "Sum Sq", "Mean Sq", "F-Value", "P-
Value"),
caption = '\label{tab:waova}The two-way ANOVA table for the welding
experiment (complete model).')
```
下面是 table 打印时的样子:
我想更改最左侧列中的名称(weld$fgage、weld$ftime 和 weldfgage : weldftime), 因为它们阻止了 table 更 presentable.
有人知道我会怎么做吗?
谢谢!
对于此示例,您可以在
之前使用以下代码```{r complete model anova weld}
weld$fgage = as.factor(weld$gage); weld$ftime = as.factor(weld$time)
wmoda = aov(weld$strength ~ weld$fgage*weld$ftime); waova = anova(wmoda)
waova2 = round(waova, 2)
options(knitr.kable.NA = '-')
row.names(waova2)[1:3] = c("Factor A", "Factor B", "Interaction")
kable(waova2, col.names = c("Df", "Sum Sq", "Mean Sq", "F-Value", "P-
Value"),
caption = '\label{tab:waova}The two-way ANOVA table for the welding
experiment (complete model).')
```