Question

In: Statistics and Probability

*** Please solve in R *** You now pull another sample of 20 policyholders. See “Prob...

*** Please solve in R ***

You now pull another sample of 20 policyholders. See “Prob 11-2 claims data.csv” for the data. For this data set, assume a negative binomial distribution is your first choice as a data generating process that could have produced the counts of claims. Perform a negative binomial regression to analyze the data; report your findings.

Claims Years
1 1.042191
7 2.497906
2 3.676603
4 3.798047
1 4.870992
9 7.689958
1 8.02383
6 8.305029
2 9.052364
9 10.44021
5 11.44318
5 12.12458
2 13.32714
4 14.65696
11 14.78745
5 16.20412
0 16.27578
13 16.48458
21 16.94984
22 18.3575

Solutions

Expert Solution

Answer --> To Perform the negative binomial regression in R, Below is the stepwise process and also the finding

#### data import /Input data ######

> Claims <- c(1,7,2,4,1,9,1,6,2,9,5,5,2,4,11,5,0,13,21,22)

> Years <- c(1.042191,2.497906,3.676603,3.798047,4.870992,7.689958,8.02383,8.305029,9.052364,10.44021,11.44318,12.12458,13.32714,14.65696,14.78745,16.20412,16.27578,16.48458,16.94984,18.3575)

> Policy_Data <- data.frame(Claims,Years) # Make the data table

> dim(Policy_Data) # check dimention of data( 20 obs with 2 variables)

[1] 20 2

##### Import library ‘MASS’ required to Perform the negative binomial regression ########

> library (MASS)

##### Syntax of To Perform the negative binomial regression ############

> negBinomModel <- glm.nb(Claims ~ Years, data = Policy_Data) # negative Binomial model

> negBinomModel

Call: glm.nb(formula = Claims ~ Years, data = Policy_Data, init.theta = 2.359874145,

    link = log)

Coefficients:

(Intercept)       Years

    0.74543      0.09494

Degrees of Freedom: 19 Total (i.e. Null); 18 Residual

Null Deviance:     30.44

Residual Deviance: 21.81      AIC: 115.8

After performing the negative binomial regression below is the our finding / R output.

> summary (negBinomModel) # Model summary

Call:

glm.nb(formula = Claims ~ Years, data = Policy_Data, init.theta = 2.359874145,

    link = log)

Deviance Residuals:

    Min       1Q   Median       3Q      Max

-2.7874 -0.8940 -0.3172   0.4420   1.3660

Coefficients:

            Estimate Std. Error z value Pr(>|z|)  

(Intercept) 0.74543    0.42534   1.753 0.07968 .

Years        0.09494    0.03441   2.759 0.00579 **

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Negative Binomial(2.3599) family taken to be 1)

    Null deviance: 30.443 on 19 degrees of freedom

Residual deviance: 21.806 on 18 degrees of freedom

AIC: 115.85

Number of Fisher Scoring iterations: 1

              Theta: 2.36

          Std. Err.: 1.10

2 x log-likelihood: -109.849


Related Solutions

Avogadro’s Law. Now imagine that you open the jar and pull the balloon out. Now imagine...
Avogadro’s Law. Now imagine that you open the jar and pull the balloon out. Now imagine that you put 3.00 g of the same gas in another balloon at the same pressure and temperature. (a) The volume of the second balloon is _____ times _______________than the volume of the first balloon at the same conditions. In this experiment (pressure/temperature/amount) (is/are) constant. (b) Calculate the new volume using the ideal gas law. (c) Now explain the change in volume from behavior...
2020 will see another presidential election! Did you see the pun there (2020, see)? For this...
2020 will see another presidential election! Did you see the pun there (2020, see)? For this assignment, prepare a short write up about who the presidential candidates for 2020 are and what forms of media, including social media, that you are seeing. Include in your write up if there are any of the ads that are resonating with you in terms of candidate electability.
It have a lot of error. please see it and solve it for me. run it...
It have a lot of error. please see it and solve it for me. run it please. Thank you a lot. #define MAXWORDLENGTH 20 #include <stdlib.h> #include <stdio.h> #include <string.h> #include "getline.inc" struct entry { char name[81]; }; struct entry part; struct tnode { char *name; int record_number; struct tnode *left; struct tnode *right; }; void lookup(struct tnode *root,char *s); void treeprint2(struct tnode *root,char *searchkey); int c; int n; FILE *stream; struct tnode *root, *tree(struct tnode *, char *, int),*dtree(struct...
Solve the following boundary value problem by Laplace Transform. (If you solve with another method you...
Solve the following boundary value problem by Laplace Transform. (If you solve with another method you will NOT get credit. There is nothing wrong about the conditions.) d2y dt2 + y = cos(2t); y0(0) = 0; y0( 2 ) = ?1:
I see the mathematical formula to solve: Now we have a new borrower, with 5.2 credit...
I see the mathematical formula to solve: Now we have a new borrower, with 5.2 credit score and 3.1 net worth. Would you classify the new borrow into the Good standing class or the Default class? I am trying to write an excel formula for this but the instructions and coursework do not show how to do this. Any help would be appreciated. From the history, we know the following. There are two classes: Good Standing and Default Credit Score...
I see the mathematical formula to solve: Now we have a new borrower, with 5.2 credit...
I see the mathematical formula to solve: Now we have a new borrower, with 5.2 credit score and 3.1 net worth. Would you classify the new borrow into the Good standing class or the Default class? I am trying to write an excel formula for this but the instructions and coursework do not show how to do this. Any help would be appreciated. From the history, we know the following. There are two classes: Good Standing and Default Credit Score...
Please solve it within 20 minutes (updated) Solve the following       A company is considering a machine...
Please solve it within 20 minutes (updated) Solve the following       A company is considering a machine that will cost $(705 *1000) to buy. After seven years its salvage value will be $1000. $3000 cost of overhauling will be needed in the year 4th. maintenance costs will be $2500 per year. Draw the cash flow diagram. Suppose you start a project and invest $5000 now, how much you obtain as a result after 5 years. Find the future value and the...
Using R Studio Now, set the seed to 348 with `set.seed()`. Then take a sample of...
Using R Studio Now, set the seed to 348 with `set.seed()`. Then take a sample of size 10,000 from a normal distribution with a mean of 82 and a standard deviation of 11. (a) Using sum() on a logical vector, how many draws are less than 60? Using mean() on a logical vector, what proportion of the total draws is that? How far is your answer from pnorm() in 1.1 above? ```{R} set.seed(348) x=rnorm(10000,82,11) sum(ifelse(x<60,1,0)) mean(ifelse(x<60,1,0)) pnorm(60,82,11) Using sum() function...
Please solve it by R (1) Find the mean and variance of the variable of ’volume’...
Please solve it by R (1) Find the mean and variance of the variable of ’volume’ in ’lung’ dataset in package ’ISwR’. (2) Check the normality of the variable of ’volume’ in ’lung’ dataset in package ’ISwR’ with significance level α = 0.1. (3) Test if the mean of ’volume’ is less than 3.3 with significance level α = 0.05.
1. You have the choice of receiving $80,000 now or $33,000 now and another $56,000 four...
1. You have the choice of receiving $80,000 now or $33,000 now and another $56,000 four years from now. In terms of​ today's dollar, which choice is better and by how​ much? Money is worth 4.8% compounded annually. Which choice is​ better? A. The choice of $80,000 now is better. B. They are equal in value. C. The choice of $33,000 now and $56,000 in four years is better. 2. Jane is purchasing a membership in a fitness centre. She...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT