just one more note,
trt>0 may not work as intended since trt is a factor in your example.
Just check
subset(dat,trt>0)
wich is just 'dat'.
--
Eik Vettorazzi
Institut für Medizinische Biometrie und Epidemiologie
Universitätsklinikum Hamburg-Eppendorf
Martinistr. 52
20246 Hamburg
T ++49/40/7410-58243
F ++49/40/7410-57790
______________________________________________
It seems very common to pass a data frame via the "data" argument, and
use variables from it for subsetting and/or weighting.
Regards
I am not sure about weights offhand, but subset is evaluated in the
data environment----that is why that solution works. The original
question was how to setup the expression as an object that was passed
to subset. The trick is to avoid having the logical expression
evaluated when the object is created, which I avoided by using
expression, and then in lme() forcing the evaluation of the object.
--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
______________________________________________
AFAICS, subset.data.frame() merely uses this trick:
e <- substitute(subset)
r <- eval(e, x, parent.frame())
I'm probably missing something... ;-)
Sorry for the noise - at least I learned I can specify "weights" the
easy way... ;-)