Skip to content

Commit

Permalink
version 0.15.0 on CRAN, update website
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 6, 2018
1 parent ef5112d commit fbec1e7
Show file tree
Hide file tree
Showing 92 changed files with 1,119 additions and 1,329 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ Package: sjstats
Type: Package
Encoding: UTF-8
Title: Collection of Convenient Functions for Common Statistical Computations
Version: 0.14.3.9000
Date: 2018-05-03
Author: Daniel Lüdecke <[email protected]>
Version: 0.15.0
Date: 2018-06-06
Authors@R: person("Daniel", "Lüdecke", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-8895-3206"))
Maintainer: Daniel Lüdecke <[email protected]>
Description: Collection of convenient functions for common statistical computations,
Expand Down
5 changes: 3 additions & 2 deletions R/check_model_assumptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
#' < 0.05 indicates a significant deviation from normal distribution.
#' Note that this formal test almost always yields significant results
#' for the distribution of residuals and visual inspection (e.g. qqplots)
#' are preferable (see \code{\link[sjPlot]{sjp.lm}} with \code{type = "ma"}).
#' are preferable (see \code{\link[sjPlot]{plot_model}} with
#' \code{type = "diag"}).
#' \cr \cr
#' \code{multicollin()} wraps \code{\link[car]{vif}} and returns
#' the logical result as tibble. \code{TRUE}, if multicollinearity
Expand All @@ -74,7 +75,7 @@
#' @note These formal tests are very strict and in most cases violation of model
#' assumptions are alerted, though the model is actually ok. It is
#' preferable to check model assumptions based on visual inspection
#' (see \code{\link[sjPlot]{sjp.lm}} with \code{type = "ma"}).
#' (see \code{\link[sjPlot]{plot_model}} with \code{type = "diag"}).
#'
#' @examples
#' data(efc)
Expand Down
8 changes: 4 additions & 4 deletions R/mean_n.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#' @title Row means with min amount of valid values
#' @name mean_n
#' @description This function is similar to the SPSS \code{MEAN.n} function and computes
#' row means from a \code{\link{data.frame}} or \code{\link{matrix}} if at least \code{n}
#' values of a row are valid (and not \code{\link{NA}}).
#' row means from a \code{data.frame} or \code{matrix} if at least \code{n}
#' values of a row are valid (and not \code{NA}).
#'
#' @param dat A data frame with at least two columns, where row means are applied.
#' @param n May either be
#' \itemize{
#' \item a numeric value that indicates the amount of valid values per row to calculate the row mean;
#' \item or a value between 0 and 1, indicating a proportion of valid values per row to calculate the row mean (see 'Details').
#' }
#' If a row's sum of valid values is less than \code{n}, \code{\link{NA}} will be returned as row mean value.
#' If a row's sum of valid values is less than \code{n}, \code{NA} will be returned as row mean value.
#' @param digits Numeric value indicating the number of decimal places to be used for rounding mean
#' value. Negative values are allowed (see ‘Details’).
#'
#' @return A vector with row mean values of \code{df} for those rows with at least \code{n}
#' valid values. Else, \code{\link{NA}} is returned.
#' valid values. Else, \code{NA} is returned.
#'
#' @details Rounding to a negative number of \code{digits} means rounding to a power of
#' ten, so for example mean_n(df, 3, digits = -2) rounds to the
Expand Down
9 changes: 7 additions & 2 deletions R/merMod_p.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' conditional F-tests with Kenward-Roger approximation for the df (see
#' 'Details').
#'
#' @return A \code{\link{tibble}} with the model coefficients' names (\code{term}),
#' @return A \code{data.frame} with the model coefficients' names (\code{term}),
#' p-values (\code{p.value}) and standard errors (\code{std.error}).
#'
#' @details For linear mixed models (\code{lmerMod}-objects), the computation of
Expand All @@ -23,6 +23,10 @@
#' \cr \cr
#' If p-values already have been computed (e.g. for \code{merModLmerTest}-objects
#' from the \CRANpkg{lmerTest}-package), these will be returned.
#' \cr \cr
#' The \code{print()}-method has a \code{summary}-argument, that - in
#' case \code{p.kr = TRUE} - also prints information on the approximated
#' degrees of freedom (see 'Examples').
#'
#' @examples
#' data(efc)
Expand All @@ -38,7 +42,8 @@
#'
#' # lme4-fit
#' library(lme4)
#' fit <- lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)
#' sleepstudy$mygrp <- sample(1:45, size = 180, replace = TRUE)
#' fit <- lmer(Reaction ~ Days + (1 | mygrp) + (1 | Subject), sleepstudy)
#' pv <- p_value(fit, p.kr = TRUE)
#'
#' # normal output
Expand Down
2 changes: 1 addition & 1 deletion R/mwu.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @title Mann-Whitney-U-Test
#' @name mwu
#' @description This function performs a Mann-Whitney-U-Test (or Wilcoxon rank sum test,
#' see \code{\link{wilcox.test}} and \code{\link[coin]{wilcox_test}})
#' see \code{\link[stats]{wilcox.test}} and \code{\link[coin]{wilcox_test}})
#' for \code{x}, for each group indicated by \code{grp}. If \code{grp}
#' has more than two categories, a comparison between each combination of
#' two groups is performed. \cr \cr
Expand Down
2 changes: 1 addition & 1 deletion R/pseudo_r2.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' an alternative to other Pseudo-R-squared values
#' like Nakelkerke's R2 or Cox-Snell R2.
#'
#' @param x Fitted \code{\link{glm}} or \code{\link[lme4]{glmer}} model.
#' @param x Fitted \code{\link[stats]{glm}} or \code{\link[lme4]{glmer}} model.
#'
#' @return The \code{D} Coefficient of Discrimination, also known as
#' Tjur's R-squared value.
Expand Down
4 changes: 2 additions & 2 deletions R/rmse.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#' @description Compute root mean squared error, residual standard error or
#' mean square error of fitted linear (mixed effects) models.
#'
#' @param fit Fitted linear model of class \code{\link{lm}},
#' \code{\link[lme4]{merMod}} (\pkg{lme4}) or \code{\link[nlme]{lme}} (\pkg{nlme}).
#' @param fit Fitted linear model of class \code{lm}, \code{merMod} (\pkg{lme4})
#' or \code{lme} (\pkg{nlme}).
#' @param normalized Logical, use \code{TRUE} if normalized rmse should be returned.
#'
#' @seealso \code{\link{r2}} for R-squared or pseude-R-squared values, and
Expand Down
7 changes: 4 additions & 3 deletions R/sjStatistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#' @description This function calculates a table's cell, row and column percentages as
#' well as expected values and returns all results as lists of tables.
#'
#' @param tab Simple \code{\link{table}} or \code{\link{ftable}} of which cell, row and column percentages
#' as well as expected values are calculated. Tables of class \code{\link{xtabs}} and other will
#' be coerced to \code{\link{ftable}} objects.
#' @param tab Simple \code{\link{table}} or \code{\link[stats]{ftable}} of which
#' cell, row and column percentages as well as expected values are calculated.
#' Tables of class \code{\link[stats]{xtabs}} and other will be coerced to
#' \code{ftable} objects.
#' @param digits Amount of digits for the table percentage values.
#'
#' @return (Invisibly) returns a list with four tables:
Expand Down
6 changes: 3 additions & 3 deletions R/std_b.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#' @description Returns the standardized beta coefficients, std. error and confidence intervals
#' of a fitted linear (mixed) models.
#'
#' @param fit Fitted linear (mixed) model of class \code{lm} or
#' \code{\link[lme4]{merMod}} (\CRANpkg{lme4} package).
#' @param fit Fitted linear (mixed) model of class \code{lm} or \code{merMod}
#' (\CRANpkg{lme4} package).
#' @param type If \code{fit} is of class \code{lm}, normal standardized coefficients
#' are computed by default. Use \code{type = "std2"} to follow
#' \href{http://www.stat.columbia.edu/~gelman/research/published/standardizing7.pdf}{Gelman's (2008)}
Expand All @@ -31,7 +31,7 @@
#' \cr \cr and \cr \cr
#' \code{head(model.matrix(nlme::gls(neg_c_7 ~ as.factor(e42dep), data = efc, na.action = na.omit)))}.
#' \cr \cr
#' In such cases, use \code{\link{to_dummy}} to create dummies from
#' In such cases, use \code{\link[sjmisc]{to_dummy}} to create dummies from
#' factors.
#'
#' @references \href{http://en.wikipedia.org/wiki/Standardized_coefficient}{Wikipedia: Standardized coefficient}
Expand Down
2 changes: 1 addition & 1 deletion R/weight.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @details \code{weight2()} sums up all \code{weights} values of the associated
#' categories of \code{x}, whereas \code{weight()} uses a
#' \code{\link{xtabs}} formula to weight cases. Thus, \code{weight()}
#' \code{\link[stats]{xtabs}} formula to weight cases. Thus, \code{weight()}
#' may return a vector of different length than \code{x}.
#'
#' @note The values of the returned vector are in sorted order, whereas the values'
Expand Down
4 changes: 2 additions & 2 deletions R/xtab_statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#' to be a data frame. If \code{x1} and \code{x2} are not specified,
#' the first two columns of the data frames are used as variables
#' to compute the crosstab.
#' @param tab A \code{\link{table}} or \code{\link{ftable}}. Tables of class
#' \code{\link{xtabs}} and other will be coerced to \code{\link{ftable}}
#' @param tab A \code{\link{table}} or \code{\link[stats]{ftable}}. Tables of class
#' \code{\link[stats]{xtabs}} and other will be coerced to \code{ftable}
#' objects.
#' @param x1 Name of first variable that should be used to compute the
#' contingency table. If \code{data} is a table object, this argument
Expand Down
Loading

0 comments on commit fbec1e7

Please sign in to comment.