knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

roistats

R-CMD-check Codecov test coverage CRAN status

The goal of this package is to apply t-tests and basic data description across several sub-groups, with the output being a nice arranged data.frame instead of detailed listed information. Multiple comparison and significance symbols are wrapped in as options.

This kind of analyses are commonly seen in ROI (Region-of-interest) analyses for brain imaging data and this is why the package is called roistats.

Installation

You can install the released version of roistats from CRAN with:

install.packages("roistats")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Irisfee/roistats")

Usage

See Get Started page for detailed usage

Get some basic description about the data by brain region

library(roistats)
library(dplyr)
color_index %>% 
  group_by(roi_id) %>%   
  df_sem(color_index) 

One-sample t-tests for all sub-groups

color_index %>% 
  group_by(roi_id) %>% 
  t_test_one_sample(color_index)

With significance symbol as output

color_index_one_sample_t_with_sig <- color_index %>% 
  group_by(roi_id) %>% 
  t_test_one_sample(color_index, p_adjust = c("bonferroni","fdr")) %>% 
  mutate(sig_origin_p = p_range(p))

knitr::kable(color_index_one_sample_t_with_sig, digits = 3)

Two-sample t-tests for all sub-groups

color_index_two_sample %>% 
  group_by(roi_id) %>% 
  t_test_two_sample(x = color_effect, y = group, paired = TRUE)


Irisfee/roistats documentation built on Dec. 17, 2021, 11:31 p.m.