Level: Beginner
Trying to write an .ado file. This is how it looks.
When I was debugging this line by line, I am getting 2 errors.:
1. xc, invalid name, r(198)
2. y' invalid name, r(198)
When I delete (`xc'==`k'), error #1 disappears and when I remove the extra " ' " after y in scalar asf = (`y''*ind), error #2 goes away. However, both the conditional check and finding the transpose of y are crucial to my code. How do I get rid of these errors?
program func, rclass
version 15.1
syntax varlist(numeric min=4 max=4), i(integer) j(integer) k(integer)
args y xa xb xc
//indicator
gen ind = (`xa' == `i')*(`xb' == `j')*(`xc'==`k')
//some calculations
qui sum ind, det
scalar asf = (`y''*ind)
return scalar asf = asf
return scalar I = `i'
return scalar J = `j'
return scalar K = `k'
dropind
end
Related Posts with .ado Programming in Stata without invoking mata: Errors while passing arguments to function
convergence issues with nlsur (parameters constrained to zero or tending to infinity)Hi all, I am running nlsur estimations and I am experiencing some difficulty in convergence. Out of…
Converting multiple files´ variables to stringI have several .dta files in a folder. For each file, how can I convert all the variables to string?…
foreach I need to create a flexible loop, which generates the regression of some variables that are not goi…
Using Boostrap and Simulation to Estimate Correction FactorsI work at a local health department evaluating some of our work in obesity prevention. We are intere…
What test to choose?I believe I tried every test on both SPSS and Stata, but I keep on encountering problems. Maybe you …
Subscribe to:
Post Comments (Atom)
0 Response to .ado Programming in Stata without invoking mata: Errors while passing arguments to function
Post a Comment