vendredi 16 novembre 2018

R compare group to full sample

Sample data

df <- data.frame("id"=c(1,2,3,4,5), "group"=c(0,0,1,1,1), "score"=c(10,14,15,13,12))

My goal is to compare the scores for group = 1 to the complete sample.

I figured how to do the t test:

t.test(df$score ~ df$group)

But is this for group = 1 versus group = 0?

Aucun commentaire:

Enregistrer un commentaire