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
xtwest commandi am trying to apply the xtwest command i get an error i have one dependent variable and 5 independe…
Variable label in generate?Dear All, I'd like to confirm whether there is any syntax that would allow me to prescribe variable…
Can I do a OLS Regression if the distribution of my DV is like this?The dependent variable is the proportion of the ** time / *** time. Because this is a proportion, th…
How to save a Kaplan-Meier survival point estimate to a local macro?Hello STATA Community, I am currently using version 15.1 of STATA. I have some straightforward sur…
Importing oddly formatted txt data into stataHi statalist, I am dealing with precinct by precinct voting results from counties in Texas. My goal …
Subscribe to:
Post Comments (Atom)
0 Response to .ado Programming in Stata without invoking mata: Errors while passing arguments to function
Post a Comment