set.seed(12345) n<-10000; z<-rnorm(n,0,1) z1<-rnorm(n,0,1) z2<-rnorm(n,0,1) z3<-rnorm(n,0,1) z4<-rnorm(n,0,1) z5<-rnorm(n,0,1) chi5<-z1^2+z2^2+z3^2+z4^2+z5^2 sqchi5<-sqrt(chi5/5) t5<-z/sqchi5 hist(t5, breaks=100,xlim=c(-5, 5)) par(new=T) plot(density(t5), axes=F, main="", xlim=c(-5, 5), lwd=2, col="blue") df_list<-c(5,10,15,30) par(mfrow=c(2,2)) for (i in 1:length(df_list)) { hist(rt(n, df=df_list[i], ncp=0), breaks=100, xlab="t", main=paste("df=", df_list[i])) } library(tigerstats) n_list<-c(2,5,10,30) # Ç¥º»¼ö(n) df_list<-n_list-1 # ÀÚÀ¯µµ par(mfrow=c(1,1)) curve(dt(x, 1, ncp=0), col="blue", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") curve(dt(x, 4, ncp=0), add=T, col="red", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") curve(dt(x, 9, ncp=0), add=T, col="green", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") curve(dt(x, 29, ncp=0), add=T, col="black", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") qnormGC(0.99997,region="below",m=0,s=1, graph=T) curve(dt(x, 1, ncp=0), add=T, col="blue", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") qnormGC(0.99997,region="below",m=0,s=1, graph=T) curve(dt(x, 4, ncp=0), add=T, col="blue", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") qnormGC(0.99997,region="below",m=0,s=1, graph=T) curve(dt(x, 9, ncp=0), add=T, col="blue", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") qnormGC(0.99997,region="below",m=0,s=1, graph=T) curve(dt(x, 29, ncp=0), add=T, col="blue", xlim=c(-4, 4), ylim=c(0, 0.5), xlab="t", ylab="f(t)") t11<-rep(NA,9) t12<-rep(NA,9) t13<-rep(NA,9) t14<-rep(NA,9) t15<-rep(NA,9) for(i in 1:9) {t11[i]<-qt(0.9, i)} for(i in 1:9) {t12[i]<-qt(0.95, i)} for(i in 1:9) {t13[i]<-qt(0.975,i)} for(i in 1:9) {t14[i]<-qt(0.99, i)} for(i in 1:9) {t15[i]<-qt(0.995, i)} round((poi<-cbind(t11,t12,t13,t14,t15)), digits=3)