(Stata version 13)
I have a group of monthy variables for 2012 that have the same prefix in their name: fesc_info_2012. I have fesc_info_2012_1, fesc_info_2012_2, ... , fesc_info_2012_12. I want to create a variable named fesc_info for the mean of these variables. I tried
egen fesc_info = mean(fesc_info2012*)
and
egen fesc_info = mean(fesc_info2012_*)
but in both cases I receive the same error message:
fesc_info2012* invalid name
r(198);
Can anyone point out what I'm doing wrong?
Regards,
Maria
I have a group of monthy variables for 2012 that have the same prefix in their name: fesc_info_2012. I have fesc_info_2012_1, fesc_info_2012_2, ... , fesc_info_2012_12. I want to create a variable named fesc_info for the mean of these variables. I tried
egen fesc_info = mean(fesc_info2012*)
and
egen fesc_info = mean(fesc_info2012_*)
but in both cases I receive the same error message:
fesc_info2012* invalid name
r(198);
Can anyone point out what I'm doing wrong?
Regards,
Maria
Comment