Question
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 I don’t think it’s right if anyone can help me please resolve this code so I can do the same thing with 10 different values of n.


and of that n I need to know the mean, the min, max, range, sd, skew, kurtosis, ad.test and p-value


**the second picture is how it should look the table but that table is with a binomial distribution and I need it with a poisson
Untitledl x 71尤1日□Source on Save a 7. 1 set.seed (1) RunSource #data-rpoi s (n-300, 1 ambda-0.8) 3 data-rt (n-50,df-2) 4 sort
-2 0 Theoretical Quantiles T-Test Réplican Mean Std Dev Median Min Max Range Skew Kurtosis AD p value 1 10 1238 2408 214 6414
Untitledl x 71尤1日□Source on Save a 7. 1 set.seed (1) RunSource #data-rpoi s (n-300, 1 ambda-0.8) 3 data-rt (n-50,df-2) 4 sortedData-sort (data) 5 sortedData 6 7 1-1: length(data) 8 f cum-(i-0.5/1ength(data)) 9 10 theo quantiles-qnorm(p-f_cum, mean-mean(data), sd- sd (data)) 12 sample-quantiles sortedbata 13 theo quantiles, main "Normal probability Plot", 14 head(plot (x-sample quantiles, y 15 xlab sample quantiles", ylab "Theorical quantiles>) 16 17 abline(1m(theo_quantiles-sample quantiles)) 18 19 qqnorm(data) 20 qqline (data) 21 22 1ibrary(nortest) 23 ad.test (data) 24 25 1ibrary(nortest) 26 kurtosis (data) 27 28 1ibrary(moments) 29 skewness (data) 30 31 sd (data) 32 mean (data) 33 median(data) 34 min(data) 35 max (data) 36 2:30 (Top Level a
-2 0 Theoretical Quantiles T-Test Réplican Mean Std Dev Median Min Max Range Skew Kurtosis AD p value 1 10 1238 2408 214 641415 1195 3229 0731 0037 10 0.711 1529 0.383 0829 4370 5199 1327 4357568 104 0418 1.214 .3923023 1.358 4.381 068932828 0598 10 0,087 166 09 20581390 3448 0592 2218 0351 0393 5 10 0.189 1590444 3137 2449032642 0211 0801 6 10 0.522 0130.455 0563 1452 201516 259 062 7 10 0462 1.039.343 1828 1313 314 0502019 290036 0 0.86-1.844|1.576 3.420 -0994 2597- 0773 ーー110-10.451 1.14 9 10 02241.470 0.511 1.227 2.658 3.885 0474 1.561 0.7390.036 0.413 -6.422 2.337 8.7591.9656.159 1.134 0.003 4n n109 2.474
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Add a comment
Know the answer?
Add Answer to:
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...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT