/* Analyzing One-Way Effects Fixed Effects Model: Dummy Variable Approach */ use gpe2; @ output file = lpt1 reset; @ load c[5,7] = tsinghua\cost.txt; load q[5,7] = tsinghua\output.txt; /* panel definition */ n=6; @ 6 cross sections @ t=4; @ 4 time periods @ sections=seqa(1,1,n); periods=seqa(1,1,t); panel=vec(reshape(sections,t,n))~vec(reshape(periods,n,t)'); @ section index in 1st-column; time index in 2nd-column @ @ log-transformed data series @ y = ln(c[2:5,2:7]); x = ln(q[2:5,2:7]); @ stacked data series, by firms @ ys = vec(y); xs = vec(x); call reset; _names = {"ln(c)","ln(q)"}; /* pooled estimates */ call estimate(ys,xs); rssr=__rss; dfr=__df; @ use one less dummy variables with intercept @ d=dummybr(panel[.,1],sections[1:n-1]); call estimate(ys,xs~d); rssur=__rss; dfur=__df; @ testing for fixed individual effects @ f=((rssr-rssur)/(dfr-dfur))/(rssur/dfur); print "Wald F Test Statistic"; print "for No Fixed Individual Effects = " f; /* @ use all dummy variables without intercept @ _const=0; d=dummybr(panel[.,1],sections[1:n]); call estimate(ys,xs~d); */ end;