BaşlayınÜcretsiz Başlayın

Intercepts-comparisons versus means

This exercise will show you how R's formulas allow two types of intercepts to be estimated. You will use data for the number of goals per game for two players, "Scoring Sam" and "Unlucky Lou". Because these are counts, use a glm() with a Poisson family.

First, fit a model that estimates an intercept and the difference between the two players. This is the default formula option in R and looks like formula = response ~ intercept.

Second, fit a model that estimates the effect (or intercept) of both players. This formula option in R requires a - 1, for example formula = response ~ intercept - 1.

Bu egzersiz

Generalized Linear Models in R

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Fit a glm() that estimates the difference between players
summary(glm(___))
Kodu Düzenle ve Çalıştır