Closed lf-araujo closed 2 years ago
I confirm that this is a bug. Try replacing name = paste0("drop", update) with name = paste0("drop", update[1]) in both places in umxPower() that it occurs.
Thanks for reporting @lf-araujo ! And thanks for the eyes @mcneale !
I now collapse
the update string when building a new name - just hadn't tried more than one path change.
try devtools:install_github("tbates/umx")
for the new version
t
OK, I now plot (by default) when explore = TRUE
.
What else would be useful? On the TODO is to add a vertical line at N yielding power = .8
When explore is F, the output is just a point estimate of power, so nothing to plot:
'result.mxPower' num 1 attr(*, "detail")=List of 5 ..$ method : chr "ncp" ..$ sig.level: num 0.05 ..$ statistic: chr "LRT" ..$ n : num 400 ..$ power : num 1
FYI, here's what plot(pwr::pwr.r.test(power=.8,r=.3))
does, which has been my target for consistency.
Very nice! The other pieces of info that would be good to include in the Figures are: i) true model’s parameter values (i.e., effect sizes) and ii) the values to which the parameters were fixed. The second should be easy enough (List (singular) of changed paths: “X_with_Y = 0” and the first could also be reported as a list. Yep, I’m being greedy, but this is an important function. Now I think about it, a single table with parameter name, sim value, and fixed value could cover both.
Code such as:
Generates the error:
Error: The 'name' argument must be a single character argument in mxRename(retval, name)
Also, plotting is not implemented.