Title | Statistikkoderi R - Necessary R-commands - Introduktion til statistik |
---|---|
Author | Alexander Andersen |
Course | Introduktion til statistik |
Institution | Danmarks Tekniske Universitet |
Pages | 12 |
File Size | 89.1 KB |
File Type | |
Total Downloads | 114 |
Total Views | 381 |
statistik koder i Rmeanmean()#standard deviationsd()#variancevar()#covariancecov(,)#correlationcor(,)plotplot()#quantilesquantile()#histogramhist()#sum of ....sum()#pdf, cdf, quantile and RNG for binom distribution (x=mængde, n=træk,p=sandsynlighed)dbinom(x,n,p)pbinom(x,n,p)qbinom(x,n,p)rbinom(x,n,p...
statistik koder i R # mean mean()
#standard deviation sd()
#variance var()
#covariance cov(,) #correlation cor(,) # plot plot()
#quantiles quantile()
#histogram hist()
#sum of .... sum()
#pdf, cdf, quantile and RNG for binom distribution (x=mængde, n=træk,p=sandsynlighed) dbinom(x,n,p) pbinom(x,n,p)
qbinom(x,n,p) rbinom(x,n,p)
#pdf, cdf, quantile and RNG for normal distribution dnorm() pnorm() qnorm() rnorm()
#pdf, cdf, quantile and RNG for t distribution dt() pt() qt() rt()
#pdf, cdf, quantile and RNG for ki distribution dchisq() pchisq() qchisq() rchisq()
#pdf, cdf, quantile and RNG for poisson distribution (x=mængde, lambda=frekvens) dpois(x,lambda) ppois(x,lambda) qpois(x,lambda) rpois(x,lambda)
#pdf, cdf, quantile and RNG for hypergeometric distribution (x=mængden, n=træk, a=antal successer, N=populationsstørrelse) dhyper(x,a,N-a,n)
phyper(x,a,N-a,n) qhyper(x,a,N-a,n) rhyper(x,a,N-a,n)
#pdf, cdf, quantile and RNG for log-normal distribution dlnorm() plnorm() qlnorm() rlnorm()
#pdf, cdf, quantile and RNG for exponential distribution dexp() pexp() qexp() rexp()
#pdf, cdf, quantile and RNG for uniform distribution dunif() punif() qunif() runif()
#pdf, cdf, quantile and RNG for f distribution df() pf() qf() rf()
# P(>x) for n 1-pt(x,df=n-1)
# p(z>x) 1-pnorm(x) # P(t>x) for n-værdierne 100,200,....500 1-pt(x,df=seq(99,499,by=100)) # p(t>x) for n-værdierne n,.....y*n 1-pt(x,df=seq(n-1,y*n-1,by=n)) # standard normal n% fraktilen qnorm(n) #t-fraktilerne for n-værdierne n,....y*n til z decimaler round(qt(0.975,df=seq(n-1,y*n-1,by=n)),z)
kritisk værdi for en t-test med alpha 5% qt(1-alpha/2,df=n-1)
# en-prøve t-test og p-værdi for en to-sidet hypotese U=U0 tobs...