Learn R Programming

petersenlab

Package Overview

The petersenlab package contains a collection R functions that are widely used by the Petersen Lab (the Developmental Psychopathology Lab at the University of Iowa). Included are functions for various purposes, including evaluating the accuracy of judgments and predictions, performing scoring of assessments, generating correlation matrices, conversion of data between various types, data management, psychometric evaluation, extensions related to latent variable modeling, various plotting capabilities, and other miscellaneous useful functions. By making the package available, we hope to make our methods reproducible and replicable by others and to help others perform their data processing and analysis methods more easily and efficiently. The package website is here: https://devpsylab.github.io/petersenlab/. The source code for the package is here: https://github.com/DevPsyLab/petersenlab.

Installing the Package

To install the latest stable release from CRAN, run the following in R:

install.packages("petersenlab")

To install the latest development version from GitHub, run the following in R:

install.packages("remotes")
remotes::install_github("DevPsyLab/petersenlab")

Package Functions

A list of the functions included in the package is here: https://devpsylab.github.io/petersenlab/reference/

Citing the Package

To obtain the citation for the petersenlab package, run citation("petersenlab"); the citation is:

Petersen, I. T. (2024). petersenlab: A collection of R functions by the Petersen Lab. R package version 1.1.0. https://github.com/DevPsyLab/petersenlab, https://doi.org/10.32614/CRAN.package.petersenlab

A BibTeX entry for LaTeX users is:

@software{petersenlab,
  author = {Isaac T. Petersen},
  title = {{petersenlab}: A collection of {R} functions by the {Petersen Lab}},
  url = {https://github.com/DevPsyLab/petersenlab},
  doi = {10.32614/CRAN.package.petersenlab},
  version = {1.1.0},
  year = {2024}
}

License

License: MIT

This work is licensed under The MIT License.

MIT License

Copy Link

Version

Install

install.packages('petersenlab')

Monthly Downloads

438

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Isaac T. Petersen

Last Published

February 3rd, 2025

Functions in petersenlab (1.1.0)

getDependencies

Package Dependencies.
imputationModelCompare

Compare Mixed Effect Imputation Models.
imputationCombine

Combine Results from Mixed Effect Imputation Models.
equiv_chi

Chi-Square Equivalence Test for Structural Equation Models.
dropRowsWithAllNA

Drop NA rows.
load_or_install

Load or Install Packages.
discriminationToFactorLoading

Discrimination (IRT) to Standardized Factor Loading.
lmCombine

Combine Results from Multiple Regression Imputation Models.
crossTimeCorrelation

Cross-Time Correlations.
dropColsWithAllNA

Drop NA columns.
make_esem_model

Make ESEM Model.
itemInformation

Item Information.
fourPL

4-Parameter Logistic Curve.
timesPerInterval

Frequency Per Duration.
lmeSummary

Summarize mixed effects model.
deriv_d_negBinom

Item and Test Information from Zero-Inflated Negative Binomial Model.
%ni%

NOTIN Operator.
meanSum

Mean Sum.
mortgage

Mortgage Principal and Interest.
imputationPRV

Proportional Reduction of Variance from Imputation Models.
not_any_na

Not Any NA.
optimalCutoff

Optimal Cutoff.
nomogrammer

Create Nomogram.
not_all_na

Any Rows Not NA.
mySum

My Sum.
my_loadings_sorter

Sorts loadings from exploratory factor analysis.
is.nan.data.frame

NaN (Not a Number).
pValue

p-values.
partialcor.table

Partial Correlation Matrix.
plot2WayInteraction

Plot 2-way interaction.
reliabilityIRT

Reliability (IRT).
reliabilityOfDifferenceScore

Reliability of Difference Score.
recode_intensity

Recode Intensity.
redcapProgressBar

Progress Bar for REDCap.
pom

Proportion of Maximum (POM).
satorraBentlerScaledChiSquareDifferenceTestStatistic

Satorra-Bentler Scaled Chi-Square Difference Test Statistic.
semPlotInteraction

Plot interaction from SEM model.
repeatability

Repeatability.
ppPlot

PP Plot.
posttestOdds

Posttest Odds & Probability.
percentEffort

Person Months.
puc

Percent of Uncontaminated Correlations (PUC).
standardErrorIRT

Standard Error of Measurement (IRT).
percentileToTScore

Percentile to T-Score Conversion.
read.aes

Read Encrypted Data.
suppressLeadingZero

Suppress Leading Zero.
reverse_score

Reverse Score Variables.
varsDifferentTypes

Identify Variables of Different Types.
vwReg

Visually Weighted Regression.
simulateIndirectEffect

Simulate Indirect Effect.
specify_decimal

Specify Decimals.
kish_ess

Weighted Quantiles.
write.aes

Write Encrypted Data.
setLabPath

Set Lab Path.
simulateAUC

Simulate Area Under the ROC Curve (AUC).
update_nested

Update Nested Models in Hierarchical Regression.
test_info_4PL

Test Information from Logistic IRT Model.
accuracyAtEachCutoff

Accuracy at Each Cutoff.
attenuationCorrelation

Attenuation of True Correlation Due to Measurement Error.
addText

Add Correlation to Scatterplot.
columnBindFill

Column Bind and Fill.
Mode

Statistical Mode.
accuracyOverall

Overall Accuracy.
pA

Bayes' Theorem.
cleanUpNames

Clean Up Player Names For Merging.
apa

APA Format
accuracyAtCutoff

Accuracy at a Given Cutoff.
convertHoursAMPM

Convert AM and PM Hours.
cor.table

Correlation Matrix.
disattenuationCorrelation

Disattenuation of Observed Correlation Due to Measurement Error.
convertToHours

Convert Time to Hours.
convertToSeconds

Convert Time to Seconds.
convertToMinutes

Convert Time to Minutes.
complement

Simulate Complement Variable.
crossTimeCorrelationDF

Cross-Time Correlations Dataframe.
convert.magic

Convert Variable Types.