Description Usage Arguments Details Value See Also Examples
View source: R/rescaleTrajectories_function.r
rescaleTrajectories
performs linear rescaling of the synthetic achievement values
produced by ZPDGrowthTrajectories
1 2 3 4 5 6 7 |
trajectories |
An object of class |
intercept |
Optional scalar value providing the intercept for rescaling. Either |
slope |
Optional scalar value providing the slope for rescaling. Either |
benchmarks |
Optional numeric matrix with two columns. The first column contains time points.
The second column contains target values for the mean achievement at those time points. The matrix
must have at least two rows. Either |
version |
Optional numeric vector indicating that the mean achievement at the target time points
should be computed only for students receiving specific version(s) of the curriculum. For example,
|
rescaleTrajectories
works in two modes. In the first, mode, the user supplies the intercept
and slope values which are used to linearly rescale the synthetic achievement values computed
by ZPDGrowthTrajectories
. In the second mode, the user supplies a matrix of time points
and desired values for the mean achievement at those time points. The function will calculate
and apply the optimal rescaling coefficients and report the r-squared value. The user may optionally
designate that this transformation should be based on a subset of the versions of the curriculum.
An object of class "ZPD", "data.frame"
ZPDGrowthTrajectories
for simulating growth trajectories.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | # learning rate
learn.rate <- c(.08, .10, .12, .18)
# decay rate
decay.rate <- c(.04, .03, .02, .01)
# initial achievement
initial.ach <- rep(0, times=4)
# quality of home environment
home.env <- c(.06, .12, .15, .20)
# assignment object simulating starting kindergarten on time 801
# Kindergarten for 200 days, followed by 100 days of summer
# then 200 days of first grade
assignment <- c(rep(0, times=800), rep(1, times=200),
rep(0, times=100), rep(2, times=200))
# define school curriculum
curriculum.start.points <- list(
# "typical curriculum" start points for K and first grade
matrix(c(.2, .26), nrow=2, ncol=1),
# "advanced curriculum" start points for K and first grade
matrix(c(.22, .29), nrow=2, ncol=1)
)
curriculum.widths <- list(
# "typical curriculum" widths for K and first grade
matrix(c(.04, .04), nrow=2, ncol=1),
# "advanced curriculum" widths for K and first grade
matrix(c(.05, .05), nrow=2, ncol=1)
)
curriculum.review.slopes <- list(
# "typical curriculum" review slopes for K and first grade
matrix(c(30, 30), nrow=2, ncol=1),
# "advanced curriculum" review slopes for K and first grade
matrix(c(60, 60), nrow=2, ncol=1)
)
curriculum.advanced.slopes <- list(
# "typical curriculum" advanced slopes for K and first grade
matrix(c(50, 50), nrow=2, ncol=1),
# "advanced curriculum" advanced slopes for K and first grade
matrix(c(25, 25), nrow=2, ncol=1)
)
# students 1 and 2 get typical curriculum, 3 and 4 get advanced
which.curriculum <- c(1,1,2,2)
y <- ZPDGrowthTrajectories(learn.rate=learn.rate, home.env=home.env,
decay.rate=decay.rate, initial.ach=initial.ach,
ZPD.width=.05, ZPD.offset=.02,
home.learning.decay.rate=6,
curriculum.start.points=curriculum.start.points,
curriculum.widths=curriculum.widths,
curriculum.review.slopes=curriculum.review.slopes,
curriculum.advanced.slopes=curriculum.advanced.slopes,
assignment=assignment, dosage=.8,
adaptive.curriculum=FALSE,
which.curriculum=which.curriculum,
school.weight=.5, home.weight=1, decay.weight=.05,
verbose=TRUE)
describeTrajectories(y, byVersion=FALSE)
y2 <- rescaleTrajectories(y, intercept=100, slope=50)
describeTrajectories(y2, byVersion=FALSE)
benchmarks <- matrix(c(
300, 150.0,
600, 187.2,
800, 195.2), ncol=2, byrow=TRUE)
y3 <- rescaleTrajectories(y, benchmarks=benchmarks)
describeTrajectories(y3, byVersion=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.