Hi all,
I am trying to create a regression model, but fail to find the right way to modify the data so i can perform my regression correctly.
I have a database of 36.000 firm-year observations, with approximately 10 years of observations per firm. The names with which the firm-years are identified is (FYEAR) and the names for the specific companies are defined by the variable (COMPANYCODE1).
The database contains a binary variable (ICMW) which only presents a 1 for certain firms and firm-years.
The 2 problems i am stuck with are as follows:
1. I want to perform a regression which compares (per company) the firm-years before the variable ICMW presents a 1 and the firm-years after.
But i can't seem to find the code for letting Stata perform a comparison between the yearly data of a company, with the ICMW-variable as border.
2. I only want to perform the regression for firms that actually contain a 1 for ICMW in one or more years. But Stata keeps dropping observations of all yearly-observations without a 1 for ICMW, while i only want to drop all companies (so all the yearly observations of companies) without a 1 for the ICMW. For this problem, i have been jumbling with panel data, but i haven't found the right solution yet.
I would want to provide you with the code for this problem, but seeing as i haven't been able to find it, i can't post it either.
I hope i provided enough information for you guys to understand the problem! If anyone knows a solution to my problem, it would be much appreciated!
Kind regards
Max
I am trying to create a regression model, but fail to find the right way to modify the data so i can perform my regression correctly.
I have a database of 36.000 firm-year observations, with approximately 10 years of observations per firm. The names with which the firm-years are identified is (FYEAR) and the names for the specific companies are defined by the variable (COMPANYCODE1).
The database contains a binary variable (ICMW) which only presents a 1 for certain firms and firm-years.
The 2 problems i am stuck with are as follows:
1. I want to perform a regression which compares (per company) the firm-years before the variable ICMW presents a 1 and the firm-years after.
But i can't seem to find the code for letting Stata perform a comparison between the yearly data of a company, with the ICMW-variable as border.
2. I only want to perform the regression for firms that actually contain a 1 for ICMW in one or more years. But Stata keeps dropping observations of all yearly-observations without a 1 for ICMW, while i only want to drop all companies (so all the yearly observations of companies) without a 1 for the ICMW. For this problem, i have been jumbling with panel data, but i haven't found the right solution yet.
I would want to provide you with the code for this problem, but seeing as i haven't been able to find it, i can't post it either.
I hope i provided enough information for you guys to understand the problem! If anyone knows a solution to my problem, it would be much appreciated!
Kind regards
Max
Comment