Summary
順序はあるが、定量的ではないデータに適用される統計モデル。例えば、環境状態を良い順に1-5のスコアで評価したデータなどが考えられる。詳細はこちらで解説されている。
Sponsored link
function “polr”
パッケージ:MASS
ランダム効果:不可
その他:なし
# sample data
plot(as.numeric(dat1$Y) ~ X, dat1)
# fitting with "polr"
fit <- polr(Y ~ X, data = dat1)
summary(fit)
## ## Re-fitting to get Hessian
## Call: ## polr(formula = Y ~ X, data = dat1) ## ## Coefficients: ## Value Std. Error t value ## X 1.475 0.2079 7.093 ## ## Intercepts: ## Value Std. Error t value ## 1|2 2.9686 0.5940 4.9972 ## 2|3 4.6355 0.7638 6.0692 ## 3|4 7.4940 1.0686 7.0128 ## ## Residual Deviance: 112.7585 ## AIC: 120.7585
function “clmm”
パッケージ:ordinal
ランダム効果:可
その他:なし
# sample data
Col <- rainbow(10)
plot(as.numeric(dat2$Y) ~ X, data = dat2, pch = 21, bg = Col[dat2$groupID], col = NA)
# fitting with "clmm"
fit <- clmm(Y ~ X + (1|factor(dat2$groupID)), data = dat2)
summary(fit)
## Cumulative Link Mixed Model fitted with the Laplace approximation ## ## formula: Y ~ X + (1 | factor(dat2$groupID)) ## data: dat2 ## ## link threshold nobs logLik AIC niter max.grad cond.H ## logit flexible 100 -57.12 124.23 160(484) 5.13e-05 1.8e+02 ## ## Random effects: ## Groups Name Variance Std.Dev. ## factor(dat2$groupID) (Intercept) 2.712 1.647 ## Number of groups: factor(dat2$groupID) 10 ## ## Coefficients: ## Estimate Std. Error z value Pr(>|z|) ## X 1.3195 0.2316 5.696 1.23e-08 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Threshold coefficients: ## Estimate Std. Error z value ## 1|2 2.0640 0.8328 2.478 ## 2|3 3.5995 0.9769 3.685 ## 3|4 5.0874 1.1127 4.572
Related Posts
Sponsored link