View source: R/simulate_mobility.R
simulate_mobility | R Documentation |
simulate_mobility
simulate_mobility( .draws, .max_dist = 1, .p_success = 0.5, .mob_option = c("center", "np"), .pct_mobile = 0.2, .pop_size = 250000L, .output_details = FALSE )
.draws |
Numeric scalar. The number of draws from the distribution, likely the number of persons in the data. |
.max_dist |
Numeric scalar. The general number of schools away from a student's home school that they should be allowed to move. Defaults to 1. |
.p_success |
Numeric scalar between 0 and 1. The probability of a success. The way this is coded, success translates to mobility, so lower probabilities result in lower mobility rates. In addition, higher numbers of successes are used to assign mobile students to schools that are farther away from home school. Defaults to 0.5. |
.mob_option |
A string. Indicates the mobility simulation option.
The choices are |
.pct_mobile |
A numeric scalar between 0 and 1. Gives the proportion of
mobile students to be saved in the "center" option of
|
.pop_size |
A large numeric scalar. Gives the size of the population
distribution to be constructed for |
.output_details |
Logical. Indicates whether the sampling information
(including the number of draws and trials, the probability of success, etc.)
should be included in the output. If |
This function returns a list (or vector) that varies depending on the
option selected in .mob_option
and whether the simulation details
should be output. If details are requested, the list outputs the mobility
pattern vectors with length equal to .draws
. The numbers given
are the number of schools away from the current school to which a mobile
child is assigned. For example, if the output vector looks like
c(0, 0, -2)
, then the first two children are not mobile, while the
third moves two schools away below their current school in the school
residual matrix.
## Not run: simulate_mobility(50) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.