r - verify the central limit theorem of chi sq distribution -
r - verify the central limit theorem of chi sq distribution -
hi have question on verifying central limit theorem using r.
the question utilize info generated different statistical distribution n see if sample means follow normal distribution .
i using code
x <- replicate(20, rchisq(20,20)) x_bar <- colmeans(x) hist(x_bar)
and increasing number of samples 5 in each interval. ie. 20, 25, 30, 25, ... using ks test shapiro test available in r test normality.
question should first define population of 1000 first take different samples of size 20 , running tests or possible using codes have written above? because read defnition clt takes different combination of sample size n population create population of means.
any help appreciated! give thanks !
anyone?!!???
update: saw video on utube verify clt uses rnorm n not rchisq.
pop_size<-1000 sample_size<-15 repeated_sample<-100 x<-rchisq(20,20) par(mfrow=c(2,2)) (i in 1:repeated_sample){ temp_xx<-sample(x,size=sample_size,replace=true) if(exists("smpl_x")==true){ temp_xx1<-data.frame(x_bar=c(mean(temp_xx)),var_x=c(var(temp_xx))) smpl_x<-rbind(smpl_x,temp_xx1) rm(temp_xx1) }else{ smpl_x<-data.frame(x_bar=c(mean(temp_xx)),var_x=c(var(temp_xx))) } plot(hist(temp_xx))
will code work observe normality of chi sq distributions?
r statistics distribution
Comments
Post a Comment