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
Strange behavior of Stata with Classes and Python interactionDear All, I have encountered a rather strange behavior of Stata: Array Basically after obtaining …
destringDear Statalist experts, I have the following dataset, all variables are strings, my question is, how…
Randomizing years and statesHi , I have a variable of interest which is an indicator variable (LAW) that equals 1 if a firm is …
Summary Statistics with Esttab: Don't display valuesHi. I am making a simple table with summary statistics where I want to show the mean and median for…
year fixed effects in a difference in differences modelHello everyone, this is my first post here and I hope to do everything well to have some help about …
Subscribe to:
Post Comments (Atom)
0 Response to .ado Programming in Stata without invoking mata: Errors while passing arguments to function
Post a Comment