Last data update: 2014.03.03

R: Simulated Data
simulated_dataR Documentation

Simulated Data

Description

This data was simulated to imitate height growth of female children in electronic medical records. There are 500 individuals, with a random number of data points. Based on the CDC growth curve, each individual has a two-level random effect (intercept and slope), a common intercept, and a random error term. The ages range from 0 to 10 years, which is given in months.

Usage

data("simulated_data")

Format

A data frame with 5673 observations on the following 3 variables.

nestid

a numeric vector of the identification number of each individual

age

a numeric vector of the age in months

height

a numeric vector of the height in centimeters

References

http://blog.stata.com/2014/07/18/how-to-simulate-multilevellongitudinal-data/

Examples

data(simulated_data)
library(sitar)

## plot each individual growth curve
mplot(x=age, y=height, id=nestid, data=simulated_data, col=nestid, main="Growth Curves")	

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MonoInc)
Loading required package: compare

Attaching package: 'compare'

The following object is masked from 'package:base':

    isTRUE

Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MonoInc/simulated_data.Rd_%03d_medium.png", width=480, height=480)
> ### Name: simulated_data
> ### Title: Simulated Data
> ### Aliases: simulated_data
> ### Keywords: datasets simulated
> 
> ### ** Examples
> 
> data(simulated_data)
> library(sitar)
Loading required package: nlme
Loading required package: splines
> 
> ## plot each individual growth curve
> mplot(x=age, y=height, id=nestid, data=simulated_data, col=nestid, main="Growth Curves")	
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>