File: semstandmsem.R

package info (click to toggle)
r-cran-semplot 1.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Original code from sem package, by John Fox and Adam Kramer.

standcoefmsem <- function (object, ...) 
{
  Res <- list()
  groups <- object$groups
  G <- length(groups)
  param.names <- object$param.names
  ram <- object$ram
  A <- object$A
  P <- object$P
  par <- coef(object)
  for (g in 1:G) {
    par.names <- param.names[ram[[g]][, 4]]
    par.gr <- par[par.names]
    t <- length(par.gr)
    par.posn <- ram[[g]][, 4] != 0
    ram[[g]][par.posn, 4] <- 1:t
    group <- list(coeff = par.gr, t = t, ram = ram[[g]], 
                  A = A[[g]], P = P[[g]], par.posn = par.posn, param.names = par.names)
    class(group) <- "sem"
    Res[[g]] <- standardizedCoefficients(group, ...)
  }
  return(Res)
}