r - error.bars.by{psych} Multiple variables -
hello stack community,
my question in regards command
error.bars.by() from package error.bars.by{psych}.
i familiar how command works:
error.bars.by( mydata[3], mydata[1], by.var=true, x.cat=true, legend=5, eyes=false, pch=10, cex=2, alpha=.05, density=10, ) my question whether or not command can handle 2 grouping variables.
if so, how code it?
the data table
group subgroup measure 1 1 0.234213 2 1 0.046248 3 1 0.391376 4 2 0.911849 5 2 0.729955 6 2 0.991110 7 2 0.378422 8 3 0.898037 9 3 0.258884 10 3 na 11 3 0.057631 12 3 0.745202 13 3 0.121376 14 b 1 0.385198 15 b 1 0.484399 16 b 1 0.115034 17 b 1 0.073629 18 b 1 0.456150 19 b 2 0.336108 20 b 2 0.845458 21 b 2 0.267494 22 b 3 0.536123 23 b 3 1.331731 24 b 3 0.505114 25 b 3 0.843348 26 b 3 0.827932 27 b 3 0.813351 28 c 1 0.095587 29 c 1 0.158822 30 c 1 0.392376 31 c 1 0.284625 32 c 2 0.898819 33 c 2 0.743428 34 c 2 0.298989 35 c 2 0.423961 36 c 3 0.868351 37 c 3 0.181547 38 c 3 1.146131 39 c 3 0.234941
try <something like>(tm):
error.bars.by( mydata[[3]], interaction(mydata[[1]], mydata[[other_col_name]]), by.var=true, x.cat=true, legend=5, eyes=false, pch=10, cex=2, alpha=.05, density=10, ) the interaction function creates new single column can used when want "long" version of cross-classification. edit: took out by.var=true since wasn't documented on page function , didn't describe doing.
Comments
Post a Comment