Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

I have two different classes in one column. How to test normality of each of them?

$
0
0

A newbie in R. Considering this is my situation:(Actually my real situation is much more complex)

set.seed(100)
df = data.frame(SEX=sample(c("M","F"),100,replace=TRUE),BW = rnorm(100,80,2))

One column is SEX(male and female), another one is BW(body weight). I want to test male's body weight normality and female's body weight normality. Then I can test equlity of variances respectively. At last, T test or other test for this situation. But shapiro.test can't be used in this situation. (like shapiro.test(BW~SEX,data=df))

What should I do? I don't want to seperate the data frame or make new subsets.

Thanks in advance~!


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>