ComenzarEmpieza gratis

Estimate parameter lambda

In the video you learned how the log link function provides for the linear combination in the parameters defining the Poisson regression model of the form

$$ log(\lambda)=\beta_0+\beta_1x_1 $$

To obtain the response function in terms of lambda we exponentiated the model function to obtain

$$ \lambda=E(y)=exp(\beta_0 + \beta_1x_1) $$ $$ \lambda=E(y)=exp(\beta_0) \times exp(\beta_1x_1) $$

In this exercise, you will use this formulation with the horseshoe crab data to compute the estimate of the mean \(y\) for the female crab width.

Dataset crab is preloaded in the workspace.

Este ejercicio forma parte del curso

Generalized Linear Models in Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Import libraries
import ____.____ as sm
from ____.formula.api import ____

# Fit Poisson regression of sat by width
model = ____('____ ~ ____', data = ____, family = ____.____.____).____

# Display model results
____(model.____)
Editar y ejecutar código