Question

In: Statistics and Probability

Say I have a random data that consists of crab’s color (C), spine condition (S), weight...

Say I have a random data that consists of crab’s color (C), spine condition (S), weight (Wt), and carapace width (W). The response outcome for each female crab is her number of satellites (Sa).

And the following code I have done is:

model=glm(carb$Sa~1+carb$W,family=poisson(link=log))

Now my main question is, how to do a Rcode on:

I am trying to use a two variable minimization rule and I need help finding the first and second derivatives of poisson so that i could also input the guesses of X and Y variables such as:

X Y~Poisson

0 1

1 1

2 3

Solutions

Expert Solution

#### Poisson Regression of Sa on W

model=glm(crab$Sa~1+crab$W,family=poisson(link=log))

Note that the specification of a Poisson distribution in R is “family=poisson” and “link=log”. You can also get the predicted count for each observation and the linear predictor values from R output by using specific statements such as:

#### to get the predicted count for each observation: 
#### e.g. for the first observation E(y1)=3.810

print=data.frame(crab,pred=model$fitted)
print

#### note the linear predictor values
#### e.g., for the first observation, exp(1.3378)=3.810

model$linear.predictors
exp(model$linear.predictors)

In the output below, you should be able to identify the relevant parts:

  • What do you learn from "summary(model)"? How is this different from when we fitted logistic regression models?
  • Does the model fit well? What does the Value/DF tell you?
  • Is width the significant predictor?

Here is the output:

The estimated model is: log(μi^) = -3.30476 + 0.16405Wi

The ASE of estimated β = 0.164 is 0.01997 which is small, and the slope is statistically significant given its z-value of 8.216 and its low p-value.

Interpretation: Since estimate of β > 0, the wider the female crab, the greater expected number of male satellites on the multiplicative order as exp(0.1640) = 1.18. More specifically, for one unit of increase in the width, the number of Sa will increase and it will be multiplied by 1.18.


Related Solutions

I have the data for corn color and texture. These are the follow up questions for...
I have the data for corn color and texture. These are the follow up questions for the data. Color of Corn Grains Number of Purple (Red) Grains: 75 Number of Yellow (White) Grains: 30 Ratio of Purple (Red) Grains: Yellow (White) Grains: 2.5:1 Probable Genotypes of Parents:   Texture of Corn Grains Number of Smooth Grains: 85 Number of Wrinkled Grains: 20 Ratio of Smooth Grains: Wrinkled Grains: 4.25:1 Probable Genotypes of Parents: Grain color is one trait. Grain texture is...
Say we have a continuous random variable X with density f(x) = c (1+x3) (where c...
Say we have a continuous random variable X with density f(x) = c (1+x3) (where c is a constant) with support Sx = [0,3] a. What value of c will make f(x) a valid probability density function? b. What is the probability that X=2? What is the probability that X is greater than 2? Now say we have an infinite sequence of independent random variables Xi (that is to say X1, X2, X3, ....)  with density f(x) stated earlier. c. What...
Say I have and Array so MyArray starts off as S A Q W A R...
Say I have and Array so MyArray starts off as S A Q W A R .... I want to sort the Array alphabetically using ascii codes to sort. However in Ascii code capital letters come first and then lower case letters are sorted after. My goal is to not only sort the array, but also make lowercase sorted in its proper place. I am using visual basics and I cant use a built in sorter that does it the...
Hi, I have a question. The paper say, " The video "Bigger than Enron" 's states...
Hi, I have a question. The paper say, " The video "Bigger than Enron" 's states Enron's collapse was more than the story of just one company. What does this statement mean? How-far reaching are the implications of a corporate fraud of this magnitude? Please provide examples of inured parties and explain how they are affected." ?I understand the first question saying that Enron's scandal affect a lot of business. But I don't know understand the rest of the question....
Say we have a continuous random variable X with density function f(x)=c(1+x3) (where c is a...
Say we have a continuous random variable X with density function f(x)=c(1+x3) (where c is a constant)with support SX =[0,3]. a.) What value of c will make f(x) a valid probability density function. b. )What is the probability that X=2? What is the probability that X is greater than 2? Now say we have an infinite sequence of independent random variables Xi (that is to say X1, X2, X3, ....) with density f(x) stated earlier. c. What is the probability...
I have a C problem. I need to read the data of a txt file to...
I have a C problem. I need to read the data of a txt file to array by struct, then use these data to sum or sort. The txt file and the struct like aa.txt 1 2 3 4 ***************************** struct aaa{ int num1,num2; }bbb[2]; num1 for 1,3, num2 for 2 4 I made a void readfile () function for read data. How can I pass the numbers to another function ( void sum () and void sort() ) for...
Using C programming I have a file that contains earthquake data that I will copy and...
Using C programming I have a file that contains earthquake data that I will copy and paste below. I want to use either bubble or insertion sort to sort the file by latitude in ascending order, then create a new file containing the sorted data. example file to sort: time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net 2020-10-17T17:22:03.840Z,32.877,-116.2991667,0.31,1.16,ml,21,119,0.07747,0.26,ci 2020-10-17T17:17:29.980Z,34.1611667,-116.452,2.75,0.87,ml,17,66,0.05224,0.22,ci 2020-10-17T17:03:54.460Z,33.5396667,-116.4613333,8.66,0.63,ml,18,126,0.06084,0.16,ci 2020-10-17T16:55:01.080Z,63.254,-151.5232,8,1.4,ml,,,,0.9,ak
The data set is height in inches and weight in pounds of random patients at the...
The data set is height in inches and weight in pounds of random patients at the Dr's office. Predict the weight of a patient that is 67 inches tall. Is it possible to predict using linear regression? Support your answer Linear regression was completed with the following results: Equation: Weight = -281.847 + 6.335*Height p-value = 0.00161 Height Weight 68 148 69 126 66 145 70 158 66 140 68 126 64 120 66 119 70 182 62 127 68...
Consider the following data. I/S 2015 2016 Sales (S) 1,200 1,320 (+10%) - Costs (C) (COGS...
Consider the following data. I/S 2015 2016 Sales (S) 1,200 1,320 (+10%) - Costs (C) (COGS &  SG&A) 1,000 = EBITDA (=EBIT) 200 - Interest 20 =EBT 180 - Tax (T) 40 =      NI 140 Dividend 40 Plowback 100 B/S Assets (A) 2,000 Debt (D) 800 Equity (E) 1,200 Common stock (CS)            800 Retained earnings (RE)                 400(+100) From these data, calculate the following ratios, showing all work: Margin (Cost) = Turnover (TO) = Interest Rate = Tax Rate = Leverage = Assume...
C++... How do I separate a C String, entered by a user, by commas? Say they...
C++... How do I separate a C String, entered by a user, by commas? Say they enter Frog,Wolf,Spider... I want a array containing the elements {Frog, Wolf, Spider} thanks Here's my idea so far... cout << "Enter the column names (c of them), each name seperated by a comma" << endl; char colNames[100]; cin >> colNames; for (int i = 0; i < 99; ++i){ if (colNames[i] == ','){ //parse the string, assign that string name to that column }...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT