Dear all,
I hope I could get some help with the following problem. My dataset is a panel and contains asset returns from 45 companies, over a period from 1998-2016 and looks like the following:
Now I am trying to generate a new variable containing the beta coefficient of the regression in the code below (cbeta) but I get a variable that only contains the beta from the first company in the sector for all companies and then Stata gives an error code:
How do I adjust my command to generate the beta coefficient variable for each company separately in the panel dataset?
I am using the Stata version 14.2
I hope I have specified my problem clearly enough,
Kind regards,
Charlotte
I hope I could get some help with the following problem. My dataset is a panel and contains asset returns from 45 companies, over a period from 1998-2016 and looks like the following:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int Date str23 CompanyName str11 Country float Recessionlag1 double(Xsector X) 13880 "AIR LIQUIDE" "France" . 74.99411992971802 -.5188337554968327 13881 "AIR LIQUIDE" "France" 0 .40916783846729227 .0031839828055408082 13884 "AIR LIQUIDE" "France" 0 .1968211549754861 .00846651915332929 13885 "AIR LIQUIDE" "France" 0 -.1809183794515586 -.003148172018527824 13886 "AIR LIQUIDE" "France" 0 -.29311647324801804 -.03263164551346719 end format %tdnn/dd/CCYY Date
Code:
forvalues i = 1(1)45 { qreg Xsector X, quantile(0.05) gen cbeta `i' = _b[X] }
Code:
variable cbeta already defined r(110);
I am using the Stata version 14.2
I hope I have specified my problem clearly enough,
Kind regards,
Charlotte
Comment