Description Usage Arguments Value See Also Examples
View source: R/nauf_trms_fr_x_z.R
The same as the lme4 modular functions
glFormula and lFormula, but implementing
nauf_contrasts.  nauf_lFormula is used for linear mixed
effects regressions (i.e. those that would be fit with
nauf_lmer) and nauf_glFormula is used for genarlized
linear mixed effects regressions (i.e. those that would be fit with
nauf_glmer or nauf_glmer.nb).  Both of the
functions contain a call to nauf_mkReTrms, which serves the same
purpose as the lme4 function mkReTrms, but with
nauf_contrasts, and, while mkReTrms is
exported by lme4, nauf_mkReTrms is an internal function in the
nauf package.
1 2 3 4 5 6 7 8 9  | nauf_glFormula(formula, data = NULL, family = gaussian, subset, weights,
  na.action = na.pass, offset, contrasts = NULL, mustart, etastart,
  control = lme4::glmerControl(), ncs_scale = attr(formula,
  "standardized.scale"), ...)
nauf_lFormula(formula, data = NULL, REML = TRUE, subset, weights,
  na.action = na.pass, offset, contrasts = NULL,
  control = lme4::lmerControl(), ncs_scale = attr(formula,
  "standardized.scale"), ...)
 | 
formula, data, family, REML, subset, weights, offset, control, mustart, etastart, ... | 
 See   | 
na.action, contrasts | 
 Changes from default values are ignored.  See
  | 
ncs_scale | 
 A positive number to be passed as the   | 
A list with the following elements:
The model frame (with class nauf.frame).
See nauf_model.frame.
The fixed effects model matrix with nauf_contrasts
applied. See nauf_model.matrix.
A list containing the random effects model matrix and other
information about the random effects structure.  The elements of the list
have the same structure as that returned by mkReTrms,
but incorportating nauf_contrasts.
(nauf_lFormula only): A logical indicating if restricted
maximum likelihood was used (copy of argument).
(nauf_glFormula only): The regression family (copy
of argument).
The formula argument, but with any double vertical
bars expanded (e.g. (1 + x || subj) becomes
(1 | subj) + (0 + x | subj)).
Warning messages (if any).
nauf_contrasts for a description of the contrasts
applied to unordered factors; nauf_model.frame and
nauf_model.matrix for the creation of the fr and
X elements of the returned list, respectively; and
nauf_lmer, nauf_glmer.nb, and
nauf_glmer for fitting mixed effects regressions with gaussian,
negative binomial, and all other families, respectively.
1 2 3 4 5 6 7 8 9 10 11 12 13  | dat <- plosives
dat$spont[dat$dialect == "Valladolid"] <- NA
dat_form <- intdiff ~ voicing * dialect * spont +
  (1 + voicing * spont | speaker) + (1 + dialect | item)
sobj <- standardize(dat_form, dat)
lmod <- nauf_lFormula(sobj$formula, sobj$data)
vless <- droplevels(subset(dat, voicing == "Voiceless"))
vless$fully_voiced <- vless$vdur == 0
vless_form <- fully_voiced ~ dialect * spont +
  (1 + spont | speaker) + (1 + dialect | item)
svless <- standardize(vless_form, vless, family = binomial)
glmod <- nauf_glFormula(svless$formula, svless$data, family = binomial)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.