# データの読み込み
url <- 'https://raw.githubusercontent.com/ozt-ca/tjo.hatenablog.samples/master/r_samples/public_lib/jp/poisson_negbinom_sample.txt'
sample <- read.table(url, header = T)
# データの概要
head(sample)
sum(is.na(sample))
# 負の二項分布のパッケージ用意
install.packages("MASS")
library(MASS)
# モデルの学習
model.glmnb <- glm.nb(click ~ ., sample)
summary(model.glmnb)
# 説明変数の絞り込み 変数減少法
stepAIC(model.glmnb)
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme