Skip to content

Commit

Permalink
Fixed up a few more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
wviechtb committed May 13, 2019
1 parent 88937cb commit 0e54b31
Show file tree
Hide file tree
Showing 21 changed files with 161 additions and 151 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metafor
Version: 2.1-0
Date: 2019-05-10
Date: 2019-05-13
Title: Meta-Analysis Package for R
Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "wvb@metafor-project.org", comment = c(ORCID = "0000-0003-3463-4063"))
Depends: R (>= 3.5.0), methods, Matrix
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Changes in Version 2.1-0 (2019-05-10)
Changes in Version 2.1-0 (2019-05-13)
=====================================

o added formula() method for objects of class 'rma'
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# metafor 2.1-0 (2019-05-10)
# metafor 2.1-0 (2019-05-13)

- added `formula()` method for objects of class `rma`

Expand Down
8 changes: 4 additions & 4 deletions R/confint.rma.mv.r
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ confint.rma.mv <- function(object, parm, level, fixed=FALSE, sigma2, tau2, rho,
con$vc.min <- 0 ### TODO: 0 basically always fails
con$vc.max <- max(10, vc*10)
}
if (is.element(x$struct[1], c("PHYPL"))) {
if (is.element(x$struct[1], c("PHYPL","PHYPD"))) {
con$vc.min <- 0
con$vc.max <- max(2, vc*2)
}
Expand All @@ -307,7 +307,7 @@ confint.rma.mv <- function(object, parm, level, fixed=FALSE, sigma2, tau2, rho,
con$vc.min <- 0 ### TODO: 0 basically always fails
con$vc.max <- max(10, vc*10)
}
if (is.element(x$struct[2], c("PHYPL"))) {
if (is.element(x$struct[2], c("PHYPL","PHYPD"))) {
con$vc.min <- 0
con$vc.max <- max(2, vc*2)
}
Expand Down Expand Up @@ -371,7 +371,7 @@ confint.rma.mv <- function(object, parm, level, fixed=FALSE, sigma2, tau2, rho,
if (is.element(comp, c("rho", "phi")) && con$vc.min > -1)
lb.sign <- "<"

if (((comp == "rho" && is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) || (comp == "phi" && is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")))) && con$vc.min > 0)
if (((comp == "rho" && is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) || (comp == "phi" && is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")))) && con$vc.min > 0)
lb.sign <- "<"

} else {
Expand Down Expand Up @@ -423,7 +423,7 @@ confint.rma.mv <- function(object, parm, level, fixed=FALSE, sigma2, tau2, rho,
if (is.element(comp, c("rho", "phi")) && con$vc.max < 1)
ub.sign <- ">"

if ((comp == "rho" && is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) || (comp == "phi" && is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))))
if ((comp == "rho" && is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) || (comp == "phi" && is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))))
ub.sign <- ">"

} else {
Expand Down
89 changes: 50 additions & 39 deletions R/misc.func.hidden.r
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
### turn each variable in mf.g into a factor (not for SP structures or GEN)
### if a variable was a factor to begin with, this drops any unused levels, but order of existing levels is preserved

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
mf.g <- data.frame(mf.g[-nvars], outer=factor(mf.g[[nvars]]))
} else {
mf.g <- data.frame(inner=factor(mf.g[[1]]), outer=factor(mf.g[[2]]))
Expand All @@ -402,7 +402,7 @@
### get number of levels of each variable in mf.g (vector with two values, for the inner and outer factor)

#g.nlevels <- c(nlevels(mf.g[[1]]), nlevels(mf.g[[2]])) ### works only for factors
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
g.nlevels <- c(length(unique(apply(mf.g[-nvars], 1, paste, collapse=" + "))), length(unique(mf.g[[nvars]])))
} else {
g.nlevels <- c(length(unique(mf.g[[1]])), length(unique(mf.g[[2]])))
Expand All @@ -411,7 +411,7 @@
### get levels of each variable in mf.g

#g.levels <- list(levels(mf.g[[1]]), levels(mf.g[[2]])) ### works only for factors
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
g.levels <- list(sort(unique(apply(mf.g[-nvars], 1, paste, collapse=" + "))), sort(unique((mf.g[[nvars]]))))
} else {
#g.levels <- list(sort(unique(as.character(mf.g[[1]]))), sort(unique(as.character(mf.g[[2]]))))
Expand All @@ -422,7 +422,7 @@
### note: if g.nlevels[1] is 1, then technically there is no correlation, but we still need one
### rho for the optimization function (this rho is fixed to 0 further in the rma.mv() function)

if (is.element(struct, c("CS","ID","AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(struct, c("CS","ID","AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {
tau2s <- 1
rhos <- 1
}
Expand Down Expand Up @@ -477,9 +477,9 @@
stop(mstyle$stop(paste0("Specified value(s) of ", ifelse(isG, 'tau2', 'gamma2'), " must be >= 0.")), call.=FALSE)
if (is.element(struct, c("CAR")) && any(rho > 1 | rho < 0, na.rm=TRUE))
stop(mstyle$stop(paste0("Specified value(s) of ", ifelse(isG, 'rho', 'phi'), " must be in [0,1].")), call.=FALSE)
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")) && any(rho < 0, na.rm=TRUE))
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")) && any(rho < 0, na.rm=TRUE))
stop(mstyle$stop(paste0("Specified value(s) of ", ifelse(isG, 'rho', 'phi'), " must be >= 0.")), call.=FALSE)
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")) && any(rho > 1 | rho < -1, na.rm=TRUE))
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")) && any(rho > 1 | rho < -1, na.rm=TRUE))
stop(mstyle$stop(paste0("Specified value(s) of ", ifelse(isG, 'rho', 'phi'), " must be in [-1,1].")), call.=FALSE)

### create model matrix for inner and outer factors of mf.g
Expand All @@ -498,7 +498,7 @@

}

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {

if (sparse) {
Z.G1 <- Diagonal(k)
Expand Down Expand Up @@ -560,7 +560,7 @@
### redo: turn each variable in mf.g into a factor (not for SP structures or GEN)
### (reevaluates the levels present, but order of existing levels is preserved)

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
mf.g <- data.frame(mf.g[-nvars], outer=factor(mf.g[[nvars]]))
} else {
mf.g <- data.frame(inner=factor(mf.g[[1]]), outer=factor(mf.g[[2]]))
Expand All @@ -569,7 +569,7 @@
### redo: get number of levels of each variable in mf.g (vector with two values, for the inner and outer factor)

#g.nlevels <- c(nlevels(mf.g[[1]]), nlevels(mf.g[[2]])) ### works only for factors
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
g.nlevels <- c(length(unique(apply(mf.g[-nvars], 1, paste, collapse=" + "))), length(unique(mf.g[[nvars]])))
} else {
g.nlevels <- c(length(unique(mf.g[[1]])), length(unique(mf.g[[2]])))
Expand All @@ -578,7 +578,7 @@
### redo: get levels of each variable in mf.g

#g.levels <- list(levels(mf.g[[1]]), levels(mf.g[[2]])) ### works only for factors
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
g.levels <- list(sort(unique(apply(mf.g[-nvars], 1, paste, collapse=" + "))), sort(unique((mf.g[[nvars]]))))
} else {
#g.levels <- list(sort(unique(as.character(mf.g[[1]]))), sort(unique(as.character(mf.g[[2]]))))
Expand All @@ -589,9 +589,9 @@

g.levels.r <- !is.element(g.levels.f[[1]], g.levels[[1]])

### warn if any levels were removed (not for "AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN")
### warn if any levels were removed (not for "AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN")

if (any(g.levels.r) && !is.element(struct, c("AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN")))
if (any(g.levels.r) && !is.element(struct, c("AR","CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN")))
warning(mstyle$warning("One or more levels of inner factor removed due to NAs."), call.=FALSE)

### for "ID" and "DIAG", fix rho to 0
Expand All @@ -608,12 +608,12 @@

### if there is only a single arm for SP structures or GEN (either to begin with or after removing NAs), cannot fit model

if (g.nlevels[1] == 1 && is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN")))
if (g.nlevels[1] == 1 && is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN")))
stop(mstyle$stop("Cannot fit model since inner term only has a single level."), call.=FALSE)

### k per level of the inner factor

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
g.levels.k <- table(factor(apply(mf.g[-nvars], 1, paste, collapse=" + "), levels=g.levels.f[[1]]))
} else {
g.levels.k <- table(factor(mf.g[[1]], levels=g.levels.f[[1]]))
Expand All @@ -638,13 +638,13 @@
rho <- 0
warning(mstyle$warning(paste0("Each level of the outer factor contains only a single level of the inner factor, so fixed value of ", ifelse(isG, 'rho', 'phi'), " to 0.")), call.=FALSE)
}
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")))
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")))
stop(mstyle$stop("Cannot fit model since each level of the outer factor contains only a single level of the inner term."), call.=FALSE)
}

g.levels.comb.k <- NULL

if (!is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (!is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {

### create matrix where each row (= study) indicates how often each arm occurred
### then turn this into a list (with each element equal to a row (= study))
Expand Down Expand Up @@ -755,7 +755,7 @@
diag(G) <- tau2
}

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {

### remove the '| outer' part from the formula and add '- 1'
formula <- as.formula(paste0(strsplit(paste0(formula, collapse=""), "|", fixed=TRUE)[[1]][1], "- 1", collapse=""))
Expand Down Expand Up @@ -799,28 +799,28 @@
}

if (struct == "SPEXP") {
Rmat <- tau2 * exp(-Dmat/rho)
G <- Rmat * tcrossprod(Z.G2)
Rmat <- exp(-Dmat/rho)
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

if (struct == "SPGAU") {
Rmat <- tau2 * exp(-Dmat^2/rho^2)
G <- Rmat * tcrossprod(Z.G2)
Rmat <- exp(-Dmat^2/rho^2)
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

if (struct == "SPLIN") {
Rmat <- tau2 * ((1 - Dmat/rho) * I(Dmat < rho))
G <- Rmat * tcrossprod(Z.G2)
Rmat <- (1 - Dmat/rho) * I(Dmat < rho)
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

if (struct == "SPRAT") {
Rmat <- tau2 * (1 - (Dmat/rho)^2 / (1 + (Dmat/rho)^2))
G <- Rmat * tcrossprod(Z.G2)
Rmat <- 1 - (Dmat/rho)^2 / (1 + (Dmat/rho)^2)
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

if (struct == "SPSPH") {
Rmat <- tau2 * ((1 - 3/2*Dmat/rho + 1/2*(Dmat/rho)^3) * I(Dmat < rho))
G <- Rmat * tcrossprod(Z.G2)
Rmat <- (1 - 3/2*Dmat/rho + 1/2*(Dmat/rho)^3) * I(Dmat < rho)
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

if (struct == "PHYPL") {
Expand All @@ -830,14 +830,20 @@
G <- tau2 * Rmat * tcrossprod(Z.G2)
}

### for spatial structures, compute a much more sensible initial value for rho
if (struct == "PHYPD") {
Rmat <- 1 - Dmat/2
G <- tau2 * Rmat^rho * tcrossprod(Z.G2)
}

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (struct == "PHYPL") {
rho.init <- .75
} else {
### for spatial and phylogeny structures, compute a much more sensible initial value for rho

if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {
if (struct == "PHYPL")
rho.init <- .50
if (struct == "PHYPD")
rho.init <- 1
if (!is.element(struct, c("PHYPL","PHYPD")))
rho.init <- suppressMessages(quantile(Dmat[upper.tri(Dmat)], 0.25)) # suppressMessages() to avoid '<sparse>[ <logic> ] : .M.sub.i.logical() maybe inefficient' messages when sparse=TRUE
}
} else {
rho.init <- NULL
}
Expand Down Expand Up @@ -930,9 +936,9 @@
v <- ifelse(is.na(v.val), exp(v), v.val) ### variances are optimized in log space, so exponentiate
if (struct == "CAR")
r <- ifelse(is.na(r.val), plogis(r), r.val) ### CAR correlation is optimized in qlogis space, so use plogis
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")))
r <- ifelse(is.na(r.val), exp(r), r.val) ### spatial 'correlation' is optimized in log space, so exponentiate
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL")))
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")))
r <- ifelse(is.na(r.val), exp(r), r.val) ### spatial and phylogenetic 'correlation' parameter is optimized in log space, so exponentiate
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD")))
r <- ifelse(is.na(r.val), tanh(r), r.val) ### other correlations are optimized in atanh space, so use tanh
} else {
### for Hessian computation, can choose to leave as is
Expand All @@ -943,10 +949,10 @@
r[r < 0] <- 0
r[r > 1] <- 1
}
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {
r[r < 0] <- 0
}
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (!is.element(struct, c("CAR","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {
r[r < -1] <- -1
r[r > 1] <- 1
}
Expand Down Expand Up @@ -1052,9 +1058,14 @@
E <- v * E * tcrossprod(Z2)
}

if (struct == "PHYPD") {
E <- 1 - Dmat/2
E <- v * E^r * tcrossprod(Z2)
}

### set variance and corresponding correlation value(s) to 0 for any levels that were removed

if (!is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN")) && any(levels.r)) {
if (!is.element(struct, c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN")) && any(levels.r)) {
E[levels.r,] <- 0
E[,levels.r] <- 0
}
Expand Down
12 changes: 6 additions & 6 deletions R/print.rma.mv.r
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ print.rma.mv <- function(x, digits, showfit=FALSE, signif.stars=getOption("show.
### note: use g.nlevels.f[1] since the number of arms is based on all data (i.e., including NAs), but use
### g.nlevels[2] since the number of studies is based on what is actually available (i.e., excluding NAs)

if (is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
inner <- trimws(paste0(strsplit(paste0(x$formulas[[1]], collapse=""), "|", fixed=TRUE)[[1]][1], collapse=""))
if (nchar(inner) > 15)
inner <- paste0(substr(inner, 1, 15), "[...]", collapse="")
Expand All @@ -88,15 +88,15 @@ print.rma.mv <- function(x, digits, showfit=FALSE, signif.stars=getOption("show.

cat(mstyle$text(paste0("outer factor: ", paste0(outer, paste(rep(" ", max(0,mng-nchar(outer))), collapse=""), collapse=""), " (nlvls = ", x$g.nlevels[2], ")")))
cat("\n")
if (is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(x$struct[1], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
cat(mstyle$text(paste0("inner term: ", paste0(inner, paste(rep(" ", max(0,mng-nchar(inner))), collapse=""), collapse=""), " (nlvls = ", x$g.nlevels.f[1], ")")))
} else {
cat(mstyle$text(paste0("inner factor: ", paste0(inner, paste(rep(" ", max(0,mng-nchar(inner))), collapse=""), collapse=""), " (nlvls = ", x$g.nlevels.f[1], ")")))
}

cat("\n\n")

if (is.element(x$struct[1], c("CS","AR","CAR","ID","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(x$struct[1], c("CS","AR","CAR","ID","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {

vc <- cbind(tau2, tau, ifelse(x$vc.fix$tau2, "yes", "no"))
vc <- rbind(vc, c(rho, "", ifelse(x$vc.fix$rho, "yes", "no")))
Expand Down Expand Up @@ -196,7 +196,7 @@ print.rma.mv <- function(x, digits, showfit=FALSE, signif.stars=getOption("show.
### note: use h.nlevels.f[1] since the number of arms is based on all data (i.e., including NAs), but use
### h.nlevels[2] since the number of studies is based on what is actually available (i.e., excluding NAs)

if (is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
inner <- trimws(paste0(strsplit(paste0(x$formulas[[2]], collapse=""), "|", fixed=TRUE)[[1]][1], collapse=""))
if (nchar(inner) > 15)
inner <- paste0(substr(inner, 1, 15), "[...]", collapse="")
Expand All @@ -209,15 +209,15 @@ print.rma.mv <- function(x, digits, showfit=FALSE, signif.stars=getOption("show.

cat(mstyle$text(paste0("outer factor: ", paste0(outer, paste(rep(" ", max(0,mng-nchar(outer))), collapse=""), collapse=""), " (nlvls = ", x$h.nlevels[2], ")")))
cat("\n")
if (is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","GEN"))) {
if (is.element(x$struct[2], c("SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD","GEN"))) {
cat(mstyle$text(paste0("inner term: ", paste0(inner, paste(rep(" ", max(0,mng-nchar(inner))), collapse=""), collapse=""), " (nlvls = ", x$h.nlevels.f[1], ")")))
} else {
cat(mstyle$text(paste0("inner factor: ", paste0(inner, paste(rep(" ", max(0,mng-nchar(inner))), collapse=""), collapse=""), " (nlvls = ", x$h.nlevels.f[1], ")")))
}

cat("\n\n")

if (is.element(x$struct[2], c("CS","AR","CAR","ID","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL"))) {
if (is.element(x$struct[2], c("CS","AR","CAR","ID","SPEXP","SPGAU","SPLIN","SPRAT","SPSPH","PHYPL","PHYPD"))) {

vc <- cbind(gamma2, gamma, ifelse(x$vc.fix$gamma2, "yes", "no"))
vc <- rbind(vc, c(phi, "", ifelse(x$vc.fix$phi, "yes", "no")))
Expand Down
Loading

0 comments on commit 0e54b31

Please sign in to comment.