[R] Density plots for Chi-square and F-distribution on my data

Bert Gunter gunter.berton at gene.com
Thu Feb 19 17:51:22 CET 2015


I think you might do well to consult a local statistical expert, as
you appear to be out of your statistical depth here.

Also, is this homework? If so, this is not a homework site (although
posters sometimes get help anyway).

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll




On Thu, Feb 19, 2015 at 8:36 AM, varin sacha <varinsacha at yahoo.fr> wrote:
> Dear R-helpers,
>
> I want to compute the density plot (probability plot) of the Chi-square distribution.
> My 2 categorical variables are gender (male, female) and colors of the eyes (blue, green and brown).
>
> The sample size n = 100. The proportions are the following :
>
> male and blue eyes : 10%
> male and green eyes : 20%
> male and brown eyes : 22%
> female and blue eyes : 20%
> female and green eyes : 13%
> female and brown eyes : 15%
>
> There are k-1 df = 6-1= 5
>
> I don't know how to take into consideration the percents here above in my R code here below ?
>
> x <- rchisq(100, 5)
> hist(x, prob=TRUE)
> curve( dchisq(x, df=5), col='red', add=TRUE)
>
>
> Second point, I want to do the same, to compute the density plot, but this time for the Fisher distribution.
> My categorical variable is gender again (male, female)
> My numerical variable is the mark in Mathematics test (3; 4; 5; 5.5)
> The proportions are the following :
> male and 3 : 10%
> male and 4 : 15%
> male and 5 : 10%
> male and 5.5 : 15%
> female and 3 : 12%
> female and 4: 0%
> female and 5 : 25%
> female and 5.5 : 13%
>
> There are df1=2-1= 1 and df2=8-2= 6
>
> Again, I don't know how to take into consideration the percents here above in my R code here below ?
>
>
> df(100, 1, 6, log = FALSE)
> x <- rf(100, 1, 6)
> hist(x, prob=TRUE)
> curve( df(x,1,6), col='red', add=TRUE)
>
> Best,
> Thanks for your help.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list