Skip to content

Commit 192a91f

Browse files
committed
documentation updates
1 parent 29479ce commit 192a91f

21 files changed

Lines changed: 78 additions & 76 deletions

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: multilevelTools
22
Title: Multilevel and Mixed Effects Model Diagnostics and Effect Sizes
3-
Version: 0.2.0
3+
Version: 0.2.1
44
Authors@R:
55
person(given = "Joshua F.",
66
family = "Wiley",

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# multilevelTools 0.2.1
2+
3+
## Changes
4+
* Improved documentation links to functions in other packages.
5+
16
# multilevelTools 0.2.0
27

38
## New Features

R/descriptives.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ meanDeviations <- function(x, na.rm = TRUE) {
265265
#' @param na.function A character string giving the name of the function
266266
#' to use to address any missing data. Functions come from the
267267
#' \pkg{zoo} package, and must be one of:
268-
#' \dQuote{na.approx}, \dQuote{na.spline}, \dQuote{na.locf}.
269-
#' @param ... Additional arguments passed to \code{zoo}.
268+
#' \code{\link[zoo]{na.approx}}, \code{\link[zoo]{na.spline}}, \code{\link[zoo]{na.locf}}.
269+
#' @param ... Additional arguments passed on.
270270
#' @return A data.table of the estimated autocorrelations by ID and lag
271271
#' @keywords multivariate
272272
#' @importFrom data.table copy is.data.table as.data.table data.table

R/diagnostics.R

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ if(getRversion() >= "2.15.1") {
77

88
#' residualDiagnostics methods for merMod objects
99
#'
10-
#' @param object An object with class \code{merMod}. Currently only
11-
#' \code{lmer()} models are supported.
10+
#' @param object An object with class \code{\link[lme4]{merMod-class}}. Currently only
11+
#' \code{\link[lme4]{lmer}} models are supported.
1212
#' @param ev.perc The extreme value percentile to use. Defaults to
1313
#' .001.
1414
#' @param robust A logical value, whether to use robust estimates or not.
1515
#' Defaults to \code{FALSE}.
1616
#' @param distr A character string specifying the assumed distribution.
1717
#' Currently \dQuote{normal}, but may expand in the future if
18-
#' \code{glmer()} models are supported.
18+
#' \code{\link[lme4]{glmer}} models are supported.
1919
#' @param standardized A logical value whether to use standardized
2020
#' residual values or not. Defaults to \code{TRUE}.
2121
#' @param cut An integer, how many unique predicted values
@@ -132,10 +132,10 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c(".SD", "isEV", "Original
132132
#' modelDiagnostics method for merMod objects
133133
#'
134134
#' This function creates a number of diagnostics
135-
#' for \code{merMod} models.
135+
#' for \code{\link[lme4]{merMod-class}} models.
136136
#'
137-
#' @param object A fitted model object, either of class merMod from
138-
#' the lme4 package or merModLmerTest from the lmerTest package.
137+
#' @param object A fitted model object, either of \code{\link[lme4]{merMod-class}} from
138+
#' the \pkg{lme4} package or merModLmerTest from the \pkg{lmerTest} package.
139139
#' @param ev.perc A real number between 0 and 1 indicating the
140140
#' proportion of the theoretical distribution beyond which
141141
#' values are considered extreme values (possible outliers).
@@ -149,7 +149,7 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c(".SD", "isEV", "Original
149149
#' Defaults to \code{TRUE} generally where possible but may depend on
150150
#' method.
151151
#' @param ... Additional arguments, passed to \code{\link[JWileymisc]{residualDiagnostics}}.
152-
#' @return A logical (\code{is.modelDiagnostics}) or
152+
#' @return A logical \code{\link[JWileymisc]{is.modelDiagnostics}} or
153153
#' a modelDiagnostics object (list) for
154154
#' \code{\link[JWileymisc]{as.modelDiagnostics}} and
155155
#' \code{\link[JWileymisc]{modelDiagnostics}}.
@@ -263,9 +263,9 @@ modelDiagnostics.merMod <- function(object, ev.perc = .001,
263263
as.modelDiagnostics(out)
264264
}
265265

266-
#' residualDiagnostics methods for lme objects
266+
#' residualDiagnostics methods for \code{\link[nlme]{lme}} objects
267267
#'
268-
#' @param object An object with class \code{lme}.
268+
#' @param object An object from \code{\link[nlme]{lme}}.
269269
#' @param ev.perc The extreme value percentile to use. Defaults to
270270
#' .001.
271271
#' @param robust A logical value, whether to use robust estimates or not.
@@ -389,9 +389,9 @@ residualDiagnostics.lme <- function(object, ev.perc = .001,
389389
#' modelDiagnostics method for lme objects
390390
#'
391391
#' This function creates a number of diagnostics
392-
#' for \code{lme} models.
392+
#' for \code{\link[nlme]{lme}} models.
393393
#'
394-
#' @param object A fitted model object of class lme.
394+
#' @param object A fitted model object from \code{\link[nlme]{lme}}.
395395
#' @param ev.perc A real number between 0 and 1 indicating the
396396
#' proportion of the theoretical distribution beyond which
397397
#' values are considered extreme values (possible outliers).
@@ -531,4 +531,3 @@ modelDiagnostics.lme <- function(object, ev.perc = .001,
531531

532532
as.modelDiagnostics(out)
533533
}
534-

R/models.R

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' @param id A character string giving the name of the variable that
1111
#' indicates which rows of the dataset belong to the same person
1212
#' or group for the multilevel analysis.
13-
#' @param data A data table or data frame to be used for analysis.
13+
#' @param data A \code{data.table} or \code{data.frame} to be used for analysis.
1414
#' @param savemodel A logical value indicating whether the underlying model
1515
#' should be saved and returned. Defaults to \code{FALSE}.
1616
#' @return a list with two elements, the first, \dQuote{Results} contains the
@@ -23,7 +23,6 @@
2323
#' @export
2424
#' @importFrom lavaan sem parameterEstimates
2525
#' @examples
26-
#'
2726
#' data(aces_daily, package = "JWileymisc")
2827
#' omegaSEM(
2928
#' items = c("COPEPrb", "COPEPrc", "COPEExp"),
@@ -316,8 +315,8 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c("Estimator", "N_Groups",
316315
#' This function provides fit statistics and effect sizes for
317316
#' model comparisons. The models must be nested.
318317
#'
319-
#' @param model1 A model estimated by \code{lmer}.
320-
#' @param model2 A model estimated by \code{lmer}.
318+
#' @param model1 A model estimated by \code{\link[lme4]{lmer}}.
319+
#' @param model2 A model estimated by \code{\link[lme4]{lmer}}.
321320
#' @param ... Additional arguments, not currently used but included to match generic.
322321
#' @return a data table with the fit indices for each model
323322
#' and comparing models to each other.
@@ -429,13 +428,13 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c("var1", "var2", "sdcor",
429428

430429
#' estimate detailed results per variable and effect sizes for both fixed and random effects from lmer models
431430
#'
432-
#' This function extends the current \code{drop1} method for
431+
#' This function extends the current \code{\link[stats]{drop1}} method for
433432
#' \code{merMod} class objects from the lme4 package. Where
434433
#' the default method to be able to drop both fixed and random
435434
#' effects at once.
436435
#'
437-
#' At the moment, the function is aimed to \code{lmer} models
438-
#' and has very few features for \code{glmer} or \code{nlmer}
436+
#' At the moment, the function is aimed to \code{\link[lme4]{lmer}} models
437+
#' and has very few features for \code{\link[lme4]{glmer}} or \code{\link[lme4]{nlmer}}
439438
#' models. The primary motivation was to provide a way to
440439
#' provide an overall test of whether a variable
441440
#' \dQuote{matters}. In multilevel data, a variable may be
@@ -453,9 +452,9 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c("var1", "var2", "sdcor",
453452
#' mixed effects models do not accomodate all types of models. For example,
454453
#' if a model includes only a random slope with no random intercept,
455454
#' if the random slope was dropped, there would be no more random effects,
456-
#' and at that point, \code{lmer} or \code{glmer} will not run the model.
455+
#' and at that point, \code{\link[lme4]{lmer}} or \code{\link[lme4]{glmer}} will not run the model.
457456
#' It is theoretically possible to instead fit the model using
458-
#' \code{lm} or \code{glm} but this becomes more complex for certain
457+
#' \code{\link[stats]{lm}} or \code{\link[stats]{glm}} but this becomes more complex for certain
459458
#' model comparisons and calculations and is not currently implemented.
460459
#' Marginal and conditional R2 values are calculated for each term,
461460
#' and these are used also to calculate something akin to an
@@ -474,12 +473,12 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c("var1", "var2", "sdcor",
474473
#' main effect but keeping the interaction term, so present
475474
#' and interpret these with caution.
476475
#'
477-
#' @param object A \code{merMod} class object, the fitted result of
478-
#' \code{lmer}.
476+
#' @param object A \code{link[lme4]{merMod-class}} object, the fitted result of
477+
#' \code{\link[lme4]{lmer}}.
479478
#' @param method A character vector indicating the types of confidence
480479
#' intervals to calculate. One of \dQuote{Wald}, \dQuote{profile}, or
481480
#' \dQuote{boot}.
482-
#' @param control A \code{lmerControl()} results used to control how
481+
#' @param control A \code{\link[lme4]{lmerControl}} results used to control how
483482
#' models are estimated when updating.
484483
#' @param ... Additional arguments passed to \code{confint}
485484
#' @importFrom JWileymisc modelTest as.na as.modelTest
@@ -495,7 +494,7 @@ if(getRversion() >= "2.15.1") utils::globalVariables(c("var1", "var2", "sdcor",
495494
#' ## these examples are slow to run
496495
#' library(JWileymisc)
497496
#' m1 <- lme4::lmer(extra ~ group + (1 | ID),
498-
#' data = sleep, REML=FALSE)
497+
#' data = sleep, REML = FALSE)
499498
#' modelTest(m1)
500499
#'
501500
#' \donttest{
@@ -748,7 +747,7 @@ modelTest.merMod <- function(object, method = c("Wald", "profile", "boot"), cont
748747
#'
749748
#' Currently only linear mixed effects models are allowed.
750749
#'
751-
#' @param formula A \code{character} string giving the \code{lmer()} formula
750+
#' @param formula A \code{character} string giving the \code{\link[lme4]{lmer}} formula
752751
#' to use as a base. The variable to be tested with lags gets added as fixed effects
753752
#' only to this, currently.
754753
#' @param lagvar A \code{character} string giving the name of the variable to test lags for.

R/plotting.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
## clear R CMD CHECK notes
44
if(getRversion() >= "2.15.1") utils::globalVariables(c("EffectType", "OriginalOrder"))
55

6-
#' Plot Diagnostics for an lmer model
6+
#' Plot Diagnostics for an \code{\link[lme4]{lmer}} model
77
#'
88
#' This function creates a number of diagnostic plots
9-
#' from lmer models.
9+
#' from \code{\link[lme4]{lmer}} models.
1010
#'
11-
#' @param x A fitted model object from \code{lmer()}.
11+
#' @param x A fitted model object from \code{\link[lme4]{lmer}}.
1212
#' @param y Included to match the generic. Not used.
1313
#' @param plot A logical value whether or not to plot the results or
1414
#' simply return the graphical objects.
@@ -88,12 +88,12 @@ plot.modelDiagnostics.merMod <- function(x, y, plot = TRUE, ask = TRUE, ncol = 1
8888
}
8989

9090

91-
#' Plot Diagnostics for an lme model
91+
#' Plot Diagnostics for an \code{\link[nlme]{lme}} model
9292
#'
9393
#' This function creates a number of diagnostic plots
9494
#' from lme models.
9595
#'
96-
#' @param x A fitted model object from \code{lme()}.
96+
#' @param x A fitted model object from \code{\link[nlme]{lme}}.
9797
#' @param y Included to match the generic. Not used.
9898
#' @param plot A logical value whether or not to plot the results or
9999
#' simply return the graphical objects.

R/ranef.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ if (getRversion() >= "2.15.1") utils::globalVariables(c("iteration"))
4242
if (getRversion() >= "2.15.1") utils::globalVariables(c("e", ".x", "A", "B",
4343
"interceptA", "interceptB", "sigmaA", "sigmaB", "x", "y", "vars"))
4444

45-
#' Create data and plots for brms random effect models
45+
#' Create data and plots for \code{\link[brms]{brm}} random effect models
4646
#'
47-
#' @param object a \code{brmsfit} objectx
47+
#' @param object a \code{\link[brms]{brmsfit-class}} object
4848
#' @param usevars a character vector of random effects to plot
49-
#' @param newdata a data.table object with the data used to generate the random effects, this is used as an anchor for the random intercepts so they have a meaningful 0 point
49+
#' @param newdata a \code{data.table} object with the data used to generate the random effects, this is used as an anchor for the random intercepts so they have a meaningful 0 point
5050
#' @param idvar a character string specifying the grouping variable name for the random effects
5151
#' @param CI a numeric value between 0 and 1 specifying the interval to use. Defaults to 0.95.
5252
#' @param robust a logical value indicating whether to use robust estimates or not. Defaults to FALSE.

R/styler.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if(getRversion() >= "2.15.1") {
2121
#' change all parts of the output (which default to 2 decimals per
2222
#' APA style).
2323
#' @param pcontrol A list controlling how p values are formatted.
24-
#' @param ... Additional arguments passed to \code{confint}. Notably
24+
#' @param ... Additional arguments passed to \code{\link[stats]{confint}}. Notably
2525
#' \code{nsim} and \code{boot.type} if the bootstrap method is used.
2626
#' @return a data table of character data
2727
#' @keywords misc

man/APAStyler.modelTest.merMod.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/acfByID.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)