0

多変量多重線形回帰モデルの変数によって説明される増分分散を計算しようとしましたが、多重線形回帰のような二乗和パラメーターがありません。次のようなものが欲しいです:

library(car) 

#Create variables and adjusted the model
set.seed(123)
N  <- 100
X1 <- rnorm(N, 175, 7)
X2 <- rnorm(N, 30, 8)
X3 <- abs(rnorm(N, 60, 30))
Y1 <- 0.2*X1 - 0.3*X2 - 0.4*X3 + 10 + rnorm(N, 0, 10)
Y2 <- -0.3*X2 + 0.2*X3 + rnorm(N, 10)
Y  <- cbind(Y1, Y2)
dfRegr <- data.frame(X1, X2, X3, Y1, Y2)
(fit <- lm(cbind(Y1, Y2) ~ X1 + X2 + X3, data=dfRegr))

#How do we get the proportion now? 

af <- Anova(fit)
afss <- af$"test stat"
print(cbind(af,PctExp=afss/sum(afss)*100))
#

明らかに機能しません。これには何らかのアプローチがありますか?

4

0 に答える 0