-This program starts by the function capture, which executes the following code "program drop one_fund". That code drops the program one_fund from memory. Is that line of code not unnecessary if the program has not been coded yet? Or is this just to avoid any possible chance that I already have a program in memory called one_fund?
-This program is defined as one_fund which makes a regression of Return on ExcessRm, SMB, HML and MOM as independent variables for each observation (referred to by the iterator v). It then generates the variables b_`v' and se_`v', the mean and standard deviation respectively. Does this not mean that it will create two variables for each regression? By which I am wondering if it will create b_`1' and se_`1' for FundNumber 1, b_`2' and se_`2' for FundNumber 2, ... Leading to a creation of 450,670 x 2 variables? I doubt this is the case. I think it will rather lead to the creation of 482 x 2 variables because when the program is run through "runby one_fund, by(FundNumber)", the by(FundNumber) should be enough to have the program only run 482 times. I am uncertain, however.
-The results, which holds a sequence of two generate commands is then ended with "}". There is then an exit of... Stata? I presume the exit command must refer to something else, embedded in the program sequence although I do not know what. And afterwards the program is -end-ed, finishing the definition of the one_fund program.
-The program defined earlier is executed with the -runby- command where it is specified to -runby- each FundNumber, which lets me assume that there will only be 482 regressions taking place.
The only issue I might be able to think of is that Stata might refuse to perform an iteration for a FundNumber when it has a single missing observation for the Return variable. Which would still mean that there shouldn't be any errors for a FundNumber for which there are no missing observations in the Return variable.
Therefore, I frankly have no idea what the error might be. The only information I can still add is that:
am just trying to understand how the results are being stored, if the program were to have worked properly for my dataset.
Comment