README.md

makilab

Lifecycle: experimental CRAN status

The goal of makilab is to provide a collection of helpful functions for the use of projects and testing specific to the lab of Pauline Maki at the Unversity of Illinois, Chicago. Includes useful MS Excel exports, raw data parsing, and cognitive test grading.

Installation

You can install the development version of makilab like so:

install.packages("devtools")
devtools::install_github("jvandoorn/makilab")

Example

This is a basic example which shows you how to use the Excel export functions:

Make a Pearson Correlation

library(makilab)

data(iris)
x = c("Sepal.Width", "Sepal.Length")
y = c("Petal.Width", "Petal.Length", "Species")
makilabCor(df = iris, x, y) # No export
makilabCor(df = iris, x, y, excel_export = TRUE) # Exports to excel

Export a hierarchical LM model to Excel

data(iris)
m1 <- lm(Petal.Length~Petal.Width, data = iris)
m2 <- lm(Petal.Length~Petal.Width+Sepal.Length, data = iris)
m3 <- lm(Petal.Length~Petal.Width+Sepal.Length+Species, data = iris)

makilabHLM(m1,m2,m3, excel_export = TRUE, filename = "makilabTest.xlsx")

mlist <- list(m1,m2,m3)
makilabHLM(mlist, excel_export = TRUE, filename = "makilabTest.xlsx")

mlist <- list(m1,m2)
makilabHLM(mlist,m3, excel_export = TRUE, filename = "makilabTest.xlsx")

Export a non-hierarchical set of LM models to Excel

data(iris)
m1 <- lm(Petal.Length~Petal.Width+Species, data = iris)
m2 <- lm(Sepal.Length~Petal.Width+Sepal.Width, data = iris)
m3 <- lm(Petal.Width~Petal.Length+Sepal.Length+Species, data = iris)

makilabReg(m1,m2,m3, excel_export = TRUE, filename = "makilabTest.xlsx")

mlist <- list(m1,m2,m3)
makilabReg(mlist, excel_export = TRUE, filename = "makilabTest.xlsx")

mlist <- list(m1,m2)
makilabReg(mlist,m3, excel_export = TRUE, filename = "makilabTest.xlsx")


jvandoorn/makilab documentation built on Oct. 8, 2022, 3:33 a.m.