I have been asked to replicate the results of a previous data analyst and statistician. In so doing, I am trying to generate pair-wise comparisons of effects for three diets tested in a three-period crossover trial. I am using the pkcross program in Stata 15.
There is a previous post on this topic, but the recommended syntax is not working for me.
The previous post for reference:
https://www.statalist.org/forums/for...-after-pkcross
As the original post states, when I enter the margins post-estimation command to evaluate an outcome (cholesterol, or "chol"), Stata throws the error "variable c1 not found"
According to the recommendation of the previous post, I next entered:
The first line "display e(cmdline)" yielded: anova chol __000001/pid|__000001 diet_order diet carry if __000003 (as expected)
The second line produced the error "factor-variable and time-series operators not allowed".
1) Could anyone assist with my effort to generate pairwise comparisons of effects between the three diets? Have I made a basic error in my syntax - or am I missing something more fundamental?
2) I've also tried to get Stata to drop the estimation of a carryover effect by explicitly stating the default option "param(3)", but I can't seem to eliminate it. I do want to estimate any crossover effect, should it exist. However, I'm following the recommendations of the Stata manual and associated references cautioning against estimating the sequence, treatment, carryover, and period effects simultaneously (overparameterization). I have tried clearing the memory, reloading data, and re-running the command but that did not change the way the estimation was done (all 4 parameters continue to be estimated in one model). My data contains a variable called "carry" for the crossover value as specified by the pkcross documentation.
Thank you in advance for your assistance!
Lois Fisher
There is a previous post on this topic, but the recommended syntax is not working for me.
The previous post for reference:
https://www.statalist.org/forums/for...-after-pkcross
As the original post states, when I enter the margins post-estimation command to evaluate an outcome (cholesterol, or "chol"), Stata throws the error "variable c1 not found"
Code:
pkcross chol, treat(diet) sequence(dietseq) period(diet_order) id(pid) param(3) margins diet, atmeans pwcompare(eff) as observed
Code:
display e(cmdline) anova c.chol i.dietseq / i.pid|i.dietseq i.diet i.diet_order
The second line produced the error "factor-variable and time-series operators not allowed".
1) Could anyone assist with my effort to generate pairwise comparisons of effects between the three diets? Have I made a basic error in my syntax - or am I missing something more fundamental?
2) I've also tried to get Stata to drop the estimation of a carryover effect by explicitly stating the default option "param(3)", but I can't seem to eliminate it. I do want to estimate any crossover effect, should it exist. However, I'm following the recommendations of the Stata manual and associated references cautioning against estimating the sequence, treatment, carryover, and period effects simultaneously (overparameterization). I have tried clearing the memory, reloading data, and re-running the command but that did not change the way the estimation was done (all 4 parameters continue to be estimated in one model). My data contains a variable called "carry" for the crossover value as specified by the pkcross documentation.
Thank you in advance for your assistance!
Lois Fisher
Comment