Question

I want to confirm that my data is fit on the Poisson distribution or not. I...

I want to confirm that my data is fit on the Poisson distribution or not. I think I should use qqplot, but I can't figure out how show it by R code

count frequency
0 229
1 221
2 93
3 35
4 7
7 1

Homework Answers

Answer #1

:Use the following code to plot qqplot

#import excel file of data in R

>D1=read.table("<FileName>.txt",header = TRUE)

Attach(D1)

>ybar=mean(D1)

> p=ncol(D1)

> sig=matrix(nrow=p,ncol=p)

> for(i in 1:p)

+ {

+ for(j in 1:p)

+ {

+ sig[i,j]=cov(D1[,i],D1[,j])

+ }

+ }

> sig

> #to find sample quantiles

> chisq=c()

> for(i in 1:n)

+ {

+ chisq[i]=t(D1[i,]-ybar)%*%solve(sig)%*%(D1[i,]-ybar)

+ }

> chisq

> sq=sort(chisq)

> #to find population quantiles

> i=1:n

> s=(i-0.5)/n

> pq=qchisq(s,p)

> #QQ plot

> plot(sq,pq)

> abline(0,1)

#Output given following

Know the answer?
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
Similar Questions
So, I am trying to perform a goodness of fit test on a set of data....
So, I am trying to perform a goodness of fit test on a set of data. The data consists of one thousand samples with values that range between 3.9 to 15.5. In the problem it is stated that this data could have either a gamma or normal distribution and I am meant to figure out which of these distributions it is closer to due to the results of two goodness of fit tests (one assuming gamma distribution and the other...
Data yi, i = 1, . . . , n arise from a Poisson distribution with...
Data yi, i = 1, . . . , n arise from a Poisson distribution with rate parameter λ. Show that the posterior distribution for λ|y1,...,yn is also Gamma distributed when a Gamma(α,β) prior is used.
Data yi, i = 1, . . . , n arise from a Poisson distribution with...
Data yi, i = 1, . . . , n arise from a Poisson distribution with rate parameter λ. If the data are y = 17,25,25,21,13,22,23 find the posterior for λ given the above specified Gamma prior. Comment on the posterior, data, and prior means.
I am using forecast package for time series analysis. I have a dataset with hourly data...
I am using forecast package for time series analysis. I have a dataset with hourly data from oct 3 2016 to oct 23 2016. I used the following code to convert my data into a time series object. Dataset is about citibike stations I’m only using 6 stations I’m not sure if Im supposed to use my time column or include my time column. This is what i have so far. data.ts <- ts(CitiBike[,2:7], freq = 504, start = 2016)...
Data yi, i = 1, . . . , n arise from a Poisson distribution with...
Data yi, i = 1, . . . , n arise from a Poisson distribution with rate parameter λ. (a) Write down the likelihood for the model, up to the constant of proportionality. (b) A Gamma distribution is proposed as the prior. How can we use such a prior to include our belief that λ is 10±1 i.e. mean 10 and standard deviation 1?
Data yi, i = 1, . . . , n arise from a Poisson distribution with...
Data yi, i = 1, . . . , n arise from a Poisson distribution with rate parameter λ. (a) Write down the likelihood for the model, up to the constant of proportionality. (b) A Gamma distribution is proposed as the prior. How can we use such a prior to include our belief that λ is 10±1 i.e. mean 10 and standard deviation 1?
What would i use in R to analyze this data and show it in a graph?...
What would i use in R to analyze this data and show it in a graph? Frequency Daily Weekly Monthly Never I prefer not to Comment Yes 12 3 1 1 0 No 75 33 7 1 1
Using R and the data in the table below, perform the regression of D on C...
Using R and the data in the table below, perform the regression of D on C (i.e., report the regression equation). Hint: The code to enter the vectors C and D into R is: C <- c(3, 6, 8, 9, 1, 3) D <- c(2, 7, 5, 4, 0, 4) C D 3 2 6 7 8 5 9 4 1 0 3 4 You must figure out how to obtain the regression equation from R. Enter the code below...
1. The test statistic for goodness of fit has a chi-square distribution with k - 1...
1. The test statistic for goodness of fit has a chi-square distribution with k - 1 degrees of freedom provided that the expected frequencies for all categories are​ a. ​k or more. b. ​10 or more. c. ​5 or more. d. ​2k. 2. The owner of a car wash wants to see if the arrival rate of cars follows a Poisson distribution. In order to test the assumption of a Poisson distribution, a random sample of 150 ten-minute intervals was...
Hello, I feel like I am super close but I can not figure out why my...
Hello, I feel like I am super close but I can not figure out why my C++ code it not displaying the proper medium. Thank you! Here is an example of the output: Input : a[] = {1, 3, 4, 2, 6, 5, 8, 7} Output : Mean = 4.5 Median = 4.5 Code so far:   #include <iostream> using namespace std; int main() { int a[100]; int n,i,sum=0; float mean, medium; //read array size // read array cout<<"Enter array size:...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT