Hi,
I am performing a series of parmby's for stcox analyses. In my hands, I
have found that _if_ only accepts numeric expressions:
stcox var1 var2 if inlist(var3, "string1", "string2")
works just fine, but
parmby "stcox var1 var2 if inlist(var3, "string1", "string2")",
saving(parms1.dta)
does not work, I get the following error message:
varlist not allowed
r(101);
However I can get around this problem by converting the string variable to a
numeric one:
encode var3, gen(var3_nu)
parmby "stcox var1 var2 if inlist(var3_nu, 1, 2)", label eform
saving(parms1.dta)
works just fine
Is there a general rule about the use of =exp for strings that I am not
aware of?
Your mistake here is to have strings delimited by simple quotes inside
strings delimited by simple quotes. If your -parmby- command argument is
instead delimited by compound quotes, as in