statapush icon indicating copy to clipboard operation
statapush copied to clipboard

bug report for syntax including "ci" command

Open fredericky123 opened this issue 3 years ago • 0 comments

The below syntax works well in Stata, however, if I use statapush to monitor it, it will report error

example.do

sysuse auto,clear
set seed 10000

capture program drop ModMed
program define ModMed, rclass
   summarize gear_ratio
   return scalar m=r(mean)
   return scalar sd=r(sd)
   reg price mpg c.length##c.gear_ratio
   return scalar IV = rnormal(_b[c.length],_se[c.length])
   return scalar Mod = rnormal(_b[c.length#c.gear_ratio],_se[c.length#c.gear_ratio])
   reg weight price mpg c.length
   return scalar Med = rnormal(_b[price],_se[price])
end

simulate indL=(((r(IV)+r(Mod)*(r(m)-r(sd))))*(r(Med))) indM=(((r(IV)+r(Mod)*(r(m))))*(r(Med))) indH=(((r(IV)+r(Mod)*(r(m)+r(sd))))*(r(Med))), reps(50) seed(1234): ModMed
ci means indL indM indH

statapush using "example.do", message(Congratulations! ) token(...) provider(ifttt)

The error is :

. ci means indL indM indH
variable means not found
r(111);

fredericky123 avatar Jun 19 '22 08:06 fredericky123