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

laRs

Convenience package for personal use

Installation

You can install the the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Agasax/laRs")

Tricolor plot

library(laRs)
library(tidyverse)
library(tidybayes)
data(posterior)
posterior %>% 
  tidy_cmdstanr() %>% #changes variable names to fit tidybayes
  spread_draws(a[gid]) %>% 
  compare_levels(a,by=gid) %>% 
  tricolor(x = a, y = gid, ul = 0.1, ll = -0.1) #halfeye ditribution plot

Cohen's kappa

x <- matrix(c(106, 10,4,22,28, 10,2, 12,  6),ncol=3,byrow=TRUE)
cohenkappa(x,weights="quadratic")

Beta test for difference of proportions

test <- beta_diff(8,11,6,11,prior="uniform",sample=1e4)
test

test$post.samples %>% 
  tricolor(x=diff)


Agasax/laRs documentation built on Oct. 21, 2022, 3:09 p.m.