より多くの観測値を追加すると、安定したグループの平均値がどのようになるかを知りたい。R:グループ内のmean/sdを計算する方法。常に行単位で行を1つ追加する
のは、私は次のようなデータを持っているとしましょう:
email score
<chr> <int>
1 [email protected] 4
2 [email protected] 3
3 [email protected] 3
4 [email protected] 4
5 [email protected] 1
6 [email protected] 4
7 [email protected] 5
8 [email protected] 5
次に、([email protected]、[email protected])2つの異なるグループのために、私は行で平均& SD行を計算したいです、 1行ずつ追加します。 3行目のために - mean(4,3), sd(4,3)
:mean(4,3,3), sd(4,3,3)
のように...だろう、この例の
所望の出力は次のようになります。私はこれを実装するにはどうすればよい
email score mean sd
<chr> <int> <dbl> <dbl>
1 [email protected] 4 4.000000 NA
2 [email protected] 3 3.500000 0.7071068
3 [email protected] 3 3.333333 0.5773503
4 [email protected] 4 3.500000 0.5773503
5 [email protected] 1 1.000000 NA
6 [email protected] 4 2.500000 2.1213203
7 [email protected] 5 3.333333 2.0816660
8 [email protected] 5 3.750000 1.8929694
だから、行2のためにそれがあるべきR? おかげ
fantastic!どうもありがとう! – maxtenzin
ようこそ。 – CPak