2017-05-24 10 views
-3

nlmeパッケージを使用して線形混合モデルで私の論文の統計解析を行っています。今私はいくつかの向き(西、東、北)で作業し、Rは推定値をアルファベット順の最初の値として取ります。しかし、私は見積もりを最低価値にしたい。誰かがこれを行う方法を知っていますか?線形モデルのRの推定変化

+4

はSOへようこそ。良い質問をする方法をお読みください** [ここ](https://stackoverflow.com/help/how-to-ask)** – KoenV

+0

「最低価値」とは、応答変数は最低ですか? –

+0

私はあなたがしたいと思っていることをどうやって行うのか考えていますが、最初に質問を明確にしてください... –

答えて

1

@BenBolkerに似ていますが、私はあなたが心に留めていることを知っていると思います。いくつかのおもちゃのデータをシミュレート

まず、...

lme()利回り...

library(nlme) 
summary(lme(x~orientation, random=~1|site, data=df)) 
# .... just looking at fixed effects ... 
# Fixed effects: x ~ factor(orientation) 
#      Value Std.Error DF t-value p-value 
# (Intercept)  1.9305041 0.4729373 13 4.081945 0.0013 
# orientationnorth -0.6704868 0.6688344 13 -1.002471 0.3344 
# orientationwest -1.6855218 0.6688344 13 -2.520088 0.0256 

を実行

site <- rep(1:3, each=6) 
orientation <- rep(c("west","east","north"), 6) 
x <- rnorm(18) 
x[orientation=="north"] <- x[orientation=="north"] + 1 
x[orientation=="east"] <- x[orientation=="east"] + 2 
df <- data.frame(site, orientation, x) 
df 
# site orientation   x 
# 1  1  west 0.9554461 
# 2  1  east 4.1742621 
# 3  1  north 0.8901404 
# 4  1  west -0.5998719 
# 5  1  east 1.8279064 
# 6  1  north 1.0984336 
# 7  2  west 1.1020786 
# 8  2  east 2.7994980 
# 9  2  north 0.9158762 
# 10 2  west 1.2512472 
# 11 2  east 0.1200988 
# 12 2  north 1.3584406 
# 13 3  west 0.6602157 
# 14 3  east 0.6226468 
# 15 3  north 0.9409308 
# 16 3  west -1.8992221 
# 17 3  east 2.0386123 
# 18 3  north 2.3562818 

...あなたはwestではなくeastの基準レベルになりたいですそれは最も効果が低いからです。

一つの可能​​な解決策:あなたがそれらをになりたいためにレベルで、あなたの姿勢変動の要因バージョンを使用

df$orientation1 <- factor(df$orientation, levels=c("west","north","east")) 
summary(lme(x~orientation1, random=~1|site, data=df)) 
# ... again just looking at fixed effects ... 
#      Value Std.Error DF t-value p-value 
# (Intercept)  0.2449823 0.4729373 13 0.5180016 0.6132 
# orientation1north 1.0150350 0.6688344 13 1.5176178 0.1530 
# orientation1east 1.6855218 0.6688344 13 2.5200884 0.0256 
関連する問題