LoginSignup
0
0

More than 3 years have passed since last update.

RのlmerTestのsummaryからEstimate effectsを抽出して保存する

Posted at

lmerTestとは

lmerの拡張パッケージ
GLMMの結果をsummary()で取得でき,fixed effectのEstimate-effectなどを確認できる.

やりたいこと

得られる結果から,特定のestimate-effectを抽出したい

やったこと

summary_analy = summary(analy)の内容を見ると,Estimate-effectは,
summary_analy[["coefficients"]]
に格納されている.
これをデータフレームに変換して
df_coef = as.data.frame(summary_analy[["coefficients"]])
求めたいfixed effect(今回は'X1')の行のEstimateを取りたいので.
df_coef$Estimate[rownames(df_coef) == 'X1']
で完了.
データフレームで列名指定する場合は
df$colname[rownames(df) == 'rowname']
で取得

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0