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...
I am having an issue with my school's math program but first want to ensure it...
I am having an issue with my school's math program but first want to ensure it is the program and not my process. Question- You want to obtain a sample to estimate a population proportion. At this point in time, you have no reasonable preliminary estimation for the population proportion. You would like to be 99% confident that you estimate is within 3.5% of the true population proportion. How large of a sample size is required? (1-0.99)/2 = 0.005 invNorm...