1-way anova in R help -


i new in r (statistic packet) programming , make 1way anova.

my frame of data

     q1 sex 1    n   m 2    y   f 3    u   f    ... 1000 y   m 

could me please ?

following on @thilo's , @dwin's comments above: if want analyze relationship between 2 categorical variables, might try this:

## make random data (no real pattern) dat <- data.frame(q1=sample(c("n","y","u"),size=1000,replace=true),                   sex=sample(c("m","f"),size=1000,replace=true)) dtab <- with(dat,table(q1,sex)) chisq.test(dtab) mosaicplot(dtab) 

it helpful point of view of answering questions have more context: question trying answer? also, always, it's nice have reproducible example (just save time of coming own way of generating fake data play with).

one small point pearson chi-square test testing association; doesn't distinguish between response , predictor variables anova framework does.

of course, if have continuous response variable you're neglecting tell about, won't useful ...


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -