Hello, I have had trouble writing a Mata function that accepts two arguments: (1) a real vector A and (2) a real scalar p. If the scalar p contains decimal places, the function should round the scalar to the nearest integer. The function should then take vector A and calculate (element- wise) 𝐴^2, 𝐴^3, ... , 𝐴^p-1, 𝐴^p (all in separate columns). The result should be displayed in a matrix which should also be exported to Stata’s return list. The code must declare the type of input and all variables used in the function.
I am a beginner in stata and this task may be beyond my expertise so any help would be appreciated.
Best regards,
Juan
I am a beginner in stata and this task may be beyond my expertise so any help would be appreciated.
Best regards,
Juan
Comment