问题描述:

I have a dataset consisting of x number of variables, var1, var2, ..., varx

I am interested in variable 1, var1, a factor with three levels;"a","b","c", and how this is affected by the other variables.

I have done some descriptive statistics with

`describeBy(dataset, group=var1)`

and now I want to look at each variable and see if the means for varj in the different grops "a","b","c".

EDIT 1:

Sorry for not being as clear as I thought I was..

Actually my problem is this, cause I do know that I want to use a two-sided t-test

`t.test(varj, alternative="two.sided",conf.level = 0.95,`

subset=var1)

I do get a result, but only for the mean of varj, and not for the difference in the different groups.

What am I doing wrong?

EDIT 2:

Think I am a bit to tired for this.

But this is what I have figured out I have to do

`anova(lm(var1 ~ varj))`

And it seems to work out just fine.

It sounds like a One-Way ANOVA!?

Try this:

`model1 = aov(var1 ~ varj)`

`summary(model1)`

If you want to know which pairs/groups are significantly different from each other you can use for instance Bonferroni

`pairwise.t.test(var1, varj, p.adj = "bonf")`

您可能感兴趣的文章：

- ruby - Organize by Month/Artist and Add Song Prices
- javascript - Bootstrap3 model overlap by the Slider
- json - BackboneJS - Additional Menu on View + Clean URLs
- sql - Query - Error assigning value to variable in VB
- ignoring the error output of a script ran from tcl
- php - Reading a specific line from a text file
- clr - Any implementation of an Unrolled Linked List in C#?
- Finding Hudson Log Files
- Forward to a payment-gateway together with POST data using cURL (or any other PHP server side solution)
- WCF in Winforms app - is it always single-threaded?

随机阅读：

**推荐内容**-

**热点内容**