Repeat the below procedure for 10 times to get the desired result
set.seed(1)
#data = rpois(n=300,lambda = 0.8)
data = rt(n=50,df=2)
head(data)
sortedData = sort(data)
head(sortedData)
i = 1:length(data)
f_cum = (i-0.5)/length(data) # Here is the error in your
program
theo_quantiles =
qnorm(p=f_cum,mean=mean(data),sd=sd(data))
sample_quantiles = sortedData
head(plot(x=sample_quantiles,y=theo_quantiles,main = "Normal
Probability Plot",
xlab = "Sample Quantiles", ylab = "Theoritical Quantilies"))
abline(lm(theo_quantiles~sample_quantiles))
qqnorm(data)
qqline(data)
install.packages("nortest")
install.packages("moments")
library(nortest)
ADT <- ad.test(data)
pvalue <- ADT$p.value
p.value <- zapsmall(pvalue)
AD <- ADT$statistic
library(moments)
Mean <- mean(data)
Std.Dev <- sd(data)
Median <- median(data)
Min <- min(data)
Max <- max(data)
Range <- Max - Min
Skew <- skewness(data)
Kurtosis <- kurtosis(data)
n <- 50
summary_data <-
cbind(n,Mean,Std.Dev,Median,Min,Max,Range,Skew,Kurtosis,AD,p.value)
summary_data
what code in R should I use if I want to achieve 10 different outputs with the same n. n= a number that doesnt satisfies the CLT my distributions are pois(0.8) and t(2) the one I used is below but...