Displaying 1 result from an estimated 1 matches for "dataunord".
2013 Jan 22
0
ordering in 'gnls' with 'corCompSymm' corStruct
...Ni <- 1 + rpois(M, lambda = 4); N <- sum(Ni)
grp <- factor(rep(1:M, times = Ni))
x <- lapply(Ni, function(n) 1:n)
y <- lapply(x, function(x) 1 + 2*x + rnorm(1) + rnorm(length(x)))
dataOrd <- data.frame(grp = grp, x = unlist(x), y = unlist(y))
## change order
ind <- sample(1:N); dataUnOrd <- dataOrd[ind, ]
library(nlme)
cS1 <- corCompSymm(0.2, form = ~ 1 | grp)
fit1 <- gnls(model = y ~ a + b*x, data = dataUnOrd, start = c(a = 0.1, b
= 0.3),
correlation = cS1)
## the same with 'Initialize'
cS2 <- corCompSymm(0.2, form = ~ 1 | grp)
cS2 <- Ini...