Dear All,
Thank you for helping me.
I am reading the do-file of one article. It uses the fixed effect to deal with the panal data. Before the regression and creation of dummy variables, the author use the dropvars command to drop some variables. I assume the purpose of doing so is to confirm there is no variable that shares the same variable name before we creat the dummy variables. I do not know whether my guess is right or not. I follow the same logic, but it shows the following.
dropvars yr* fix*
tab id, gen(fix)
drop fix1
tab year, gen(yr)
drop yr1
global y "consume"
global x "gdpper real_i rategap ss depend bank_w"
reg $y $x
est store c1
reg $y $x fix*
est store c2
lrtest c1 c2
estadd scalar FeChi2=r(chi2)
estadd scalar FeChi2p=r(p)
ereturn list
reg $y $x fix* yr*
est store c3
lrtest c2 c3
estadd scalar YrChi2=r(chi2)
estadd scalar Yrchi2p=r(p)
When running the program, stata shows that:
dropvars yr* fix*
unrecognized command: dropvars
r(199);
end of do-file
r(199);
So I try to alter the syntax as such:
drop yr*
drop fix*
but this time, stata shows that
drop yr*
variable yr* not found
r(111);
end of do-file
r(111);
I do not know what is wrong with this. I also want to know the purpose of author use dropvars yr* fix* before the regression.
Thank you indeed,
Best
Thank you for helping me.
I am reading the do-file of one article. It uses the fixed effect to deal with the panal data. Before the regression and creation of dummy variables, the author use the dropvars command to drop some variables. I assume the purpose of doing so is to confirm there is no variable that shares the same variable name before we creat the dummy variables. I do not know whether my guess is right or not. I follow the same logic, but it shows the following.
dropvars yr* fix*
tab id, gen(fix)
drop fix1
tab year, gen(yr)
drop yr1
global y "consume"
global x "gdpper real_i rategap ss depend bank_w"
reg $y $x
est store c1
reg $y $x fix*
est store c2
lrtest c1 c2
estadd scalar FeChi2=r(chi2)
estadd scalar FeChi2p=r(p)
ereturn list
reg $y $x fix* yr*
est store c3
lrtest c2 c3
estadd scalar YrChi2=r(chi2)
estadd scalar Yrchi2p=r(p)
When running the program, stata shows that:
dropvars yr* fix*
unrecognized command: dropvars
r(199);
end of do-file
r(199);
So I try to alter the syntax as such:
drop yr*
drop fix*
but this time, stata shows that
drop yr*
variable yr* not found
r(111);
end of do-file
r(111);
I do not know what is wrong with this. I also want to know the purpose of author use dropvars yr* fix* before the regression.
Thank you indeed,
Best
Comment