Re: [R] empirical null distribution

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Tue, 29 Apr 2008 08:45:27 -0400

On 29/04/2008 8:09 AM, mad_bassie wrote:
> I'm using F-distributions :)
> I allready found some things...I could plot the qqplot as you say and that
> gives me clear results.
> Allthough I still want a clear graphic and I 'll explain it as good as I
> can...
>
> I plotted 2 graphics
> plot(density(rf(10000,2,49)))
> plot(density(disttest))
>
> (the "disttest" is a distribution i simulated myself like this:
> for(i in 1:100){
>
> X<-rnorm(50,20,4)
> Y<-rnorm(50,20,5)
> Z<-rnorm(50,20,4)
>
> vector<-c (X, Y, Z)
> vector2<-rep(c('X','Y','Z'),c(50,50,50))
> data1<-data.frame(waarde=vector, soort = vector2)
> library(mvtnorm)
>
> library(multcomp)
> data1$soort<-as.factor(data1$soort)
>
> disttest<-c(disttest,summary(aov(waarde~soort,data=data1))[[1]][1,4])
> }
> (I want to compare the theroretical F-distribution with a distribution where
> the variances are not equal...)
>
> Thos are 2 fine plots but I just can't figure out how to put them together
> in one graphic...is this possible in R...it would make things much clearer
> because the window setting are not really equal wich makes it difficult to
> compare...

You'd be better off comparing p-values than densities, but you can do what you're trying by using lines(density(disttest)) instead of calling plot() again.

Duncan Murdoch



R-help_at_r-project.org mailing list
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. Received on Tue 29 Apr 2008 - 13:06:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Apr 2008 - 13:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive