Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opensdp/OpenSDPsynthR
Codebase to generate simulated data for OpenSDP project
https://github.com/opensdp/OpenSDPsynthR
education r simulation synthetic
Last synced: 3 months ago
JSON representation
Codebase to generate simulated data for OpenSDP project
- Host: GitHub
- URL: https://github.com/opensdp/OpenSDPsynthR
- Owner: OpenSDP
- License: mit
- Created: 2017-02-28T19:12:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-16T21:11:29.000Z (over 4 years ago)
- Last Synced: 2024-04-08T02:29:54.613Z (7 months ago)
- Topics: education, r, simulation, synthetic
- Language: HTML
- Homepage:
- Size: 1.99 MB
- Stars: 15
- Watchers: 9
- Forks: 5
- Open Issues: 12
-
Metadata Files:
- Readme: README.Rmd
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-data-synthesis - OpenSDPsynthR
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/figs/README-",
message = FALSE,
warning = FALSE
)
```# OpenSDPsynthR
![](tools/figs/open_sdp_logo_red.png)
A project to generate realistic synthetic unit-level longitudinal education data
to empower collaboration in education analytics.## Design Goals
1. Generate synthetic education data that is realistic for use by analysts
across the education sector. Realistic means messy, and reflective of the
general pattern of relationships found in the U.S. education sector.
2. Synthetic data should be able to be generated on-demand and responsive to
inputs from the user. These inputs should allow the user to configure the
process to produce data that resembles the patterns of data in their agency.
3. The package should be modular and extendable allowing new data topics to be
generated as needed so synthetic data coverage can grow.## Structure
The package is organized into the following functions:
- `simpop()` is the overall function that runs the simulation, this function calls
many subfunctions to simulate different elements of the student data
- `cleaners` are functions which take the output from the `simpop` function and
reshape it into data formats for different analyses. Currently only two cleaners
are supported -- `CEDS` and `sdp_cleaner()` which prepare the data into a CEDS
like format and into the Strategic Data Project college-going analysis file
specification respectively.
- `sim_control()` -- a function that controls all of the parameters of the `simpop`
simulation. The details of this function are covered in the vignettes.# Get Started
To use `OpenSDPsynthR`, follow the instructions below:
## Install Package
The development version of the package is able to be installed using the
`install_github()`. To use this command you will need to install the `devtools`
package.```{r eval=FALSE}
devtools::install_github("opensdp/OpenSDPsynthR")
```## Make some data
Load the package
```{r, message=TRUE}
library(OpenSDPsynthR)
```The main function of the package is `simpop` which generates a list of data
elements corresponding to simulated educational careers, K-20, for a user
specified number of students. In R, a list is a data structure that can contain
multiple data elements of different structures. This can be used to emulate
the multiple tables of a Student Information System (SIS).```{r, message=TRUE}
out <- simpop(nstu = 500, seed = 213, control = sim_control(nschls = 3))
```Currently ten tables are produced:
```{r}
names(out)
```Data elements produced include:
- **Student demographics:** age, race, and sex
- **Student participation:** grade advancement, ELL status, IEP status,
FRPL status, gifted and talented status, attendance
- **Student enrollment status:** exit type, enrollment type, transfer, graduation,
dropout, etc.
- **School attributes:** name, school category, school size, Title I and Title III status, etc.
- **Student assessment:** math assessment, reading assessment, grade level assessed
- **High school outcomes:** graduation, cumulative GPA, graduation type, cohort,
class rank, postsecondary enrollment
- **High school progression:** annual class rank, cumulative credits earned, credits
earned, credits by English Language Arts and by Mathematics, credits attempted,
ontrack status
- **Postsecondary enrollment:** year of enrollment, transfer indicator, name and ID of
postsecondary institution, type of institution
- **Postsecondary institution:** name, city, state, online only, average net price,
Pell grant rate, retention four year full time, share of part time enrollment,
enrollment by race, SAT and ACT score distribution for admitted studentsThere are two tables of metadata about the assessment data above to be used in
cases where multiple types of student assessment are analyzed together.- **Assessment information:** grade, subject, ID, type, and name of assessment
- **Proficiency information:** mean score, error of score, number of students tested```{r, echo=FALSE, message=FALSE, warning=FALSE, include=FALSE}
table_names <- data.frame(table = NULL, column = NULL)
for(i in seq_along(out)){
table_name <- names(out)[[i]]
columns <- names(out[[i]])
tmp <- data.frame(table = table_name, column = columns,
stringsAsFactors = FALSE)
table_names <- bind_rows(table_names, tmp)
}```
```{r, inclue=FALSE}
head(out$demog_master %>% arrange(sid) %>% select(1:4))
head(out$stu_year, 10)
```## Cleaners
You can reformat the synthetic data for use in specific types of projects.
Currently two functions exist to format the simulated data into an analysis
file matching the SDP College-going data specification and a CEDS-like
data specification. More of these functions are planned in the future.```{r eval=FALSE}
cgdata <- sdp_cleaner(out)
ceds <- ceds_cleaner(out)
```## Control Parameters
By default, you only need to specify the number of students to simulate to the
`simpop` command. The package has default simulation parameters that will result
in creating a small school district with two schools.```{r demonstrateOptionList}
names(sim_control())
```These parameters can have complex structures to allow for conditional and random
generation of data. Parameters fall into four categories:- **vectors:** a single list of parameters like school names, category names, or
school IDs
- **conditional probability list:** an R list that contains a variable to group by,
a function to generate data with, and a list of parameters for that function for
each group in the grouping variable
- **outcome simulation parameters:** an R list of arguments to pass to the `simglm`
function
- **outcome adjustments:** an R list of lists, with functions that modify a variable
in an existing data setFor more details, see the simulation control vignette.
```{r, eval=FALSE}
vignette("Controlling the Data Simulation", package = "OpenSDPsynthR")
```## Package Dependencies
- `dplyr`
- `lubridate`
- [wakefield](https://www.github.com/trinker/wakefield)
- [simglm](https://www.github.com/lebebr01/simglm)## OpenSDP
`OpenSDPsynthR` is part of the OpenSDP project.
[OpenSDP](https://opensdp.github.io) is an online, public repository of analytic
code, tools, and training intended to foster collaboration among education
analysts and researchers in order to accelerate the improvement of our school
systems. The community is hosted by the
[Strategic Data Project](https://sdp.cepr.harvard.edu), an initiative of the
[Center for Education Policy Research at Harvard University](https://cepr.harvard.edu).
We welcome contributions and feedback.These materials were originally authored by the Strategic Data Project.