DeclareDesign / DesignLibrary

Library of Research Designs
https://declaredesign.org/library/
Other
30 stars 3 forks source link

error in block designer #217

Closed macartan closed 5 years ago

macartan commented 5 years ago

In the block designer there is something like this:

u_0 = rnorm(N) * sd_i_0,
u_1 = rnorm(n = N, mean = rho * u_0,  sd = sqrt(1 - rho^2)) * sd_i_1

I believe this is incorrect: the rho approch we use here works properly if the base variable has unit s.d. but here it does not

I think we need this:

u_0 = rnorm(N) * sd_i_0,
u_1 = rnorm(n = N, mean = rho * u_0/sd_i_0,  sd = sqrt(1 - rho^2)) * sd_i_1

@medinali possible to check this and also see if we do this elsewhere?

lilymedina commented 5 years ago

you're right!

I think having u_1 = rnorm(n = N, mean = rho * scale(u_0), sd = sqrt(1 - rho^2)) * sd_i_1

would be neater.

I'll correct and check if this also in other designs.