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
Substracting the year out of a business calender dateHi everyone, In my dataset I have business calender dates in the format %tbtrdates. I'm trying to e…
Problem with calculating the HHI (Herfindahl-Hirschman Index)Dear Stata community, I am new to the forum and to Stata, too. I am trying to calculate the HHI (He…
Panel Data Regression StepsDear Statalist, I am new to panel data regression analysis and Stata, so forgive me if my questions…
how to use firm new names to replace old names in two different dataset? Code: * Example generated by -dataex-. To install: ssc install dataex clear input str65 firmNameNow…
Merge data set WhartonHello, I have downloaded two datasets from Wharton. One CRSP/Compustat Merged - Fundamentals Annual…
Subscribe to:
Post Comments (Atom)
0 Response to .ado Programming in Stata without invoking mata: Errors while passing arguments to function
Post a Comment