ボックス プロットが 10 個あります。
boxplot( Daten$weight~interaction(Daten$Dosis,Daten$sex, drop=TRUE))
それらの手段が必要なので、試しました:
means<-tapply(Daten$weight, Daten$Dosis, mean)
points(means, pch=5, col="red", lwd=5)
しかし、結果は、男性の手段の点しか得られませんでした。女性はどうなりましたか?
ボックス プロットが 10 個あります。
boxplot( Daten$weight~interaction(Daten$Dosis,Daten$sex, drop=TRUE))
それらの手段が必要なので、試しました:
means<-tapply(Daten$weight, Daten$Dosis, mean)
points(means, pch=5, col="red", lwd=5)
しかし、結果は、男性の手段の点しか得られませんでした。女性はどうなりましたか?
あなたのプロットでは、 への呼び出しはinteraction(Dosis, sex)
、線量と性別の 1 つのレベルの組み合わせで因子を生成します。
への呼び出しに同じものを含める必要がありますtapply
:
# use of `with` to save typing Daten$ over and over again
means <- with(Daten, tapply(weight, interaction(Dosis, sex), mean))
(注:すべての入力を節約するboxplot
ことができるため)boxplot(weight ~ interaction(Dosis, sex, drop=T), dat=Daten)
Daten$