https://github.com/lebebr01/simglm
Simulate regression models
https://github.com/lebebr01/simglm
power r simulation
Last synced: 10 months ago
JSON representation
Simulate regression models
- Host: GitHub
- URL: https://github.com/lebebr01/simglm
- Owner: lebebr01
- License: other
- Created: 2013-01-25T20:35:03.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T16:37:21.000Z (over 1 year ago)
- Last Synced: 2025-02-25T06:41:15.537Z (11 months ago)
- Topics: power, r, simulation
- Language: R
- Homepage: https://simglm.brandonlebeau.org/
- Size: 3.17 MB
- Stars: 43
- Watchers: 9
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
# `simglm`: Tidy simulation and power analyses
[](https://github.com/lebebr01/simglm/actions?workflow=R-CMD-check)
[](https://ci.appveyor.com/project/lebebr01/simglm)
[](https://codecov.io/github/lebebr01/simglm?branch=main)
[](https://cran.r-project.org/package=simglm)
## Package Installation
This package can be directly installed through CRAN:
```{r cran_install, eval = FALSE}
install.packages("simglm")
```
The development version of the package can be installed by using the devtools package.
```{r install, eval=FALSE}
library(devtools)
install_github("lebebr01/simglm")
```
## Introduction to the simglm package
The best way to become oriented with the `simglm` package is through the package vignette. There are two ways to get to the vignettes (both will open a browser to view the vignette). Below is an example loading the "Intro" vignette directly:
```{r vignette, eval=FALSE}
browseVignettes()
vignette("Intro", package = "simglm")
```
Note: If you install the development version of the package, you may need to tell R to build the vignettes when installing the `simglm` package by doing the following:
```{r install2, eval = FALSE}
install_github("lebebr01/simglm", build_vignettes = TRUE)
```
## Features
A flexible suite of functions to simulate nested data.
Currently supports the following features:
* Longitudinal data simulation
* Three levels of nesting
* Specification of distribution of random components (random effects and random error)
* Specification of serial correlation
* Specification of the number of variables
+ Ability to add time-varying covariates
+ Specify the mean and variance of fixed covariate variables
+ Specify floor or ceiling aspects of continuous attributes
+ Factor variable simulation
+ Ordinal variable simulation
* Generation of mixture normal distributions
* Cross sectional data simulation
* Single level simulation
* Power by simulation
+ Vary parameters for a factorial simulation design.
+ Can vary model fitted to the data to misspecify directly.
* Simulation of missing data
* Include other distributions for covariate simulation.
* Continuous, Logistic (dichotomous), Poisson (count), ordinal (rating scale) outcome variables.
* Cross classified simulation and power
## Bugs/Feature Requests
Bugs and feature requests are welcomed. Please track these on GitHub here: . I'm also open to pull requests.
Enjoy!