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
Need help with graphsI hope someone can help me with my codes as I am trying to show Gender with different household inco…
Is not a two-way plot typeHello, I keep getting the error not a twoway plot type. Was wondering if anyone had any suggestions…
How to correct for attrition with IPW in a DID setting?Hi everyone, I am working with a panel dataset from a project that is about giving health and nutri…
problem with collect layoutHello Statalisters, I'm having an issue obtaining the table that I want using collect with mi estim…
Poisson regression formulaHello everyone, I am trying to write this Code: xtpoisson patents cl.ln_xrdintensity##cl.Numberof…
Subscribe to:
Post Comments (Atom)
0 Response to .ado Programming in Stata without invoking mata: Errors while passing arguments to function
Post a Comment