[vsni.co.uk] Contact us
Author Message
Post new topic

  ASReml  ~  Bug with asreml R 4 - rotate.fa not working?

kwstat
Posted: Tue Apr 21, 2020 7:10 pm Reply with quote
Joined: 18 Aug 2008 Posts: 25 Location: U.S.
Code:

When I fit a factor analytic model, I get the same results with rotate.fa=FALSE and rotate.fa=TRUE.  If I understand the manual, I expect to get different results. Am I doing something wrong?

library(agridat)
library(asreml) # version 4

dat <- besag.met
dat <- transform(dat, xf=factor(col), yf=factor(row))
dat <- dat[order(dat$county, dat$xf, dat$yf), ]

# ---
asreml.options(rotate.fa=FALSE)
# First, AR1xAR1
m1 <- asreml(yield ~ county, data=dat,
             random = ~ gen:county,
             resid = ~ dsum( ~ ar1(xf):ar1(yf)|county))
# Add FA1
m2 <- update(m1, random=~gen:fa(county,1)) # rotate.FA=FALSE
# FA2
m3 <- update(m2, random=~gen:fa(county,2))
asreml.options(extra=100)
m3 <- update(m3, maxit=100)
asreml.options(extra=0)

v3 <- summary(m3)$varcomp
v3[13:18,]
sum( v3[7:12,1] * v3[13:18,1] )

gen:fa(county, 2)!C1!fa1   8.9280685          NA           NA     F 0.0
gen:fa(county, 2)!C2!fa1   3.4138813  1.44655165  2.360013423     P 0.0
gen:fa(county, 2)!C3!fa1   6.4681237  1.49612348  4.323255277     P 0.0
gen:fa(county, 2)!C4!fa1   6.1091640  6.44926570  0.947265044     P 0.0
gen:fa(county, 2)!C5!fa1   9.2815434  5.96665609  1.555568688     P 0.0
gen:fa(county, 2)!C6!fa1   3.0671903  4.26143390  0.719755461     P 0.0
gen:fa(county, 2)!C1!fa2  -0.1029065 14.32967412 -0.007181359     P 0.8
gen:fa(county, 2)!C2!fa2   0.6094157  5.63006905  0.108243028     P 0.1
gen:fa(county, 2)!C3!fa2   0.2541841 10.50137099  0.024204847     P 0.2
gen:fa(county, 2)!C4!fa2   3.9401840  9.86942202  0.399231480     P 0.0
gen:fa(county, 2)!C5!fa2  -3.7116785 14.87131329 -0.249586464     P 0.0
gen:fa(county, 2)!C6!fa2   2.4622861  5.37691282  0.457936768     P 0.0


#---
asreml.options(rotate.fa=TRUE)
# First, AR1xAR1
m5 <- asreml(yield ~ county, data=dat,
             random = ~ gen:county,
             resid = ~ dsum( ~ ar1(xf):ar1(yf)|county))
# Add FA1
m6 <- update(m5, random=~gen:fa(county,1))
# FA2
m7 <- update(m6, random=~gen:fa(county,2), rotate.fa=TRUE)
asreml.options(extra=100)
m7 <- update(m7, maxit=100)
asreml.options(extra=0)

v7 <- summary(m7)$varcomp
v7[13:18,]
gen:fa(county, 2)!C1!fa1   8.9280685          NA           NA     F 0.0
gen:fa(county, 2)!C2!fa1   3.4138813  1.44655165  2.360013423     P 0.0
gen:fa(county, 2)!C3!fa1   6.4681237  1.49612348  4.323255277     P 0.0
gen:fa(county, 2)!C4!fa1   6.1091640  6.44926570  0.947265044     P 0.0
gen:fa(county, 2)!C5!fa1   9.2815434  5.96665609  1.555568688     P 0.0
gen:fa(county, 2)!C6!fa1   3.0671903  4.26143390  0.719755461     P 0.0
gen:fa(county, 2)!C1!fa2  -0.1029065 14.32967412 -0.007181359     P 0.8
gen:fa(county, 2)!C2!fa2   0.6094157  5.63006905  0.108243028     P 0.1
gen:fa(county, 2)!C3!fa2   0.2541841 10.50137099  0.024204847     P 0.2
gen:fa(county, 2)!C4!fa2   3.9401840  9.86942202  0.399231480     P 0.0
gen:fa(county, 2)!C5!fa2  -3.7116785 14.87131329 -0.249586464     P 0.0
gen:fa(county, 2)!C6!fa2   2.4622861  5.37691282  0.457936768     P 0.0

# dot product of FA1 and FA2 is NOT 0, so these vectors are NOT orthogonal
sum( v7[7:12,1] * v7[13:18,1] )
[/code]

_________________
Kevin Wright
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
Post new topic

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum