NAME MSGMvuong 'Vuong Nonnested Tests'; ?******************************************************************** ? Replication file 4/11 for "Are Sports Teams Multiproduct Firms?" ? by K.G. Stewart and J.C.H. Jones (2010) Empirical Economics 39(2), ? 487-514. ? Estimation of the one- and two-output SGM factor demand systems ? for baseball player characteristics, the models M0,M1,M2,M3, ? without concavity imposed. ? TSP converges for the non-concavity-constrained models. ? Here we use these estimation results to construct the Vuong ? nonnested test statistics reported in Table 4 of the paper. ? This printout is also a convenient source for the loglikelihood and ? Schwartz BIC values reported in Table 3. ?******************************************************************** SMPL 1 156; ? Sample consists of 26 teams x 6 seasons (1986-91) ? Read in team characteristics; documented in Team.doc read(file='Team.dat') season team league attend attlag ticprice pmarkup gameswon gameslst wins salaries nplayers strkouts walks slugavg nhitters npitchrs experhit experpit nstars roadatt aleast alcentrl alwest nleast nlcentrl nlwest; ? Delete variables not used in this analysis delete season team league attlag ticprice pmarkup gameswon gameslst salaries nplayers; ? read in hedonic prices read(file='HedPrice1.dat') p1 p2 p3 p4 nobs; ? define team outputs GENR Y1=WINS; GENR Y2=roadatt/100000000; genr y3=attend/1000000; ? conference dummies genr dum1=aleast; genr dum2=alcentrl; genr dum3=alwest; genr dum4=nleast; genr dum5=nlcentrl; ? define team factor inputs: experience, hitting, pitching, stars GENR q1=experhit+experpit; GENR q2=nhitters*slugavg; GENR q3=npitchrs*strkouts/walks; GENR q4=nstars; ? DEFLATE HEDONIC PRICES TO 1991 DOLLARS SMPL 1 26; GENR p1=p1*135.0/109.6; GENR p2=p2*135.0/109.6; GENR p3=p3*135.0/109.6; GENR p4=p4*135.0/109.6; SMPL 27 52; GENR p1=p1*135.0/113.6; GENR p2=p2*135.0/113.6; GENR p3=p3*135.0/113.6; GENR p4=p4*135.0/113.6; SMPL 53 78; GENR p1=p1*135.0/118.3; GENR p2=p2*135.0/118.3; GENR p3=p3*135.0/118.3; GENR p4=p4*135.0/118.3; SMPL 79 104; GENR p1=p1*135.0/124.0; GENR p2=p2*135.0/124.0; GENR p3=p3*135.0/124.0; GENR p4=p4*135.0/124.0; SMPL 105 130; GENR p1=p1*135.0/130.7; GENR p2=p2*135.0/130.7; GENR p3=p3*135.0/130.7; GENR p4=p4*135.0/130.7; SMPL 1 156; ? Generate cost identity and cost shares ? (This synthetic (hedonic) cost series is used ? only for descriptive purposes in calculating the implied cost ? shares, not in estimation of cost function parameters. ? It can be compared with fitted ? cost series predicted by estimated model.) GENR COST=p1*q1+p2*q2+p3*q3+p4*q4; GENR S1=p1*q1/COST; GENR S2=p2*q2/COST; GENR S3=p3*q3/COST; GENR S4=p4*q4/COST; ? set thetas to mean levels of factor inputs MSD Q1; SET qm1=@MEAN; ? qm1=135.73077 MSD Q2; SET qm2=@MEAN; ? qm2=5.35117 MSD Q3; SET qm3=@MEAN; ? qm3=17.92278 MSD Q4; SET qm4=@MEAN; ? qm4=2.61538 GENR DENOM=qm1*p1+qm2*p2+qm3*p3+qm4*p4; SET THETA1=qm1/2; SET THETA2=qm2/2; SET THETA3=qm3/2; SET THETA4=qm4/2; ? generate price constructs used in estimation GENR Pd1=p1/DENOM; GENR Pd2=p2/DENOM; GENR Pd3=p3/DENOM; GENR Pd4=p4/DENOM; GENR Pd11=pd1*pd1; GENR Pd12=pd1*pd2; GENR Pd13=pd1*pd3; GENR Pd14=pd1*pd4; GENR Pd21=pd2*pd1; GENR Pd22=pd2*pd2; GENR Pd23=pd2*pd3; GENR Pd24=pd2*pd4; GENR Pd31=pd3*pd1; GENR Pd32=pd3*pd2; GENR Pd33=pd3*pd3; GENR Pd34=pd3*pd4; GENR Pd41=pd4*pd1; GENR Pd42=pd4*pd2; GENR Pd43=pd4*pd3; GENR Pd44=pd4*pd4; GENR P11=Pd11-Pd14-(Pd41-Pd44); GENR P12=Pd12-Pd14-(Pd42-Pd44); GENR P13=Pd13-Pd14-(Pd43-Pd44); GENR P21=Pd21-Pd24-(Pd41-Pd44); GENR P22=Pd22-Pd24-(Pd42-Pd44); GENR P23=Pd23-Pd24-(Pd43-Pd44); GENR P31=Pd31-Pd34-(Pd41-Pd44); GENR P32=Pd32-Pd34-(Pd42-Pd44); GENR P33=Pd33-Pd34-(Pd43-Pd44); GENR P12=2*P12; GENR P13=2*P13; GENR P23=2*P23; GENR Pd1=Pd1-Pd4; GENR Pd2=Pd2-Pd4; GENR Pd3=Pd3-Pd4; PARAM S11 S12 S13 B11 B1 LAMBDA1 d11 d12 d13 d14 d15; PARAM S22 S23 B22 B2 LAMBDA2 d21 d22 d23 d24 d25; PARAM S33 B33 B3 LAMBDA3 d31 d32 d33 d34 d35; PARAM B44 B4 LAMBDA4 d41 d42 d43 d44 d45; param beta d1 d2; ? Specify the MSGM system M0: 41 parameters FRML E1 Q1=(S11*Pd1+S12*Pd2+S13*Pd3 -THETA1*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*(Y1+BETA*Y2) +d11*dum1+d12*dum2+d13*dum3+d14*dum4+d15*dum5 +B11*(Y1+BETA*Y2)+B1+LAMBDA1*(Y1*Y1+2*D1*Y1*Y2+D2*Y2*Y2); FRML E2 Q2=(S12*Pd1+S22*Pd2+S23*Pd3 -THETA2*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*(Y1+BETA*Y2) +d21*dum1+d22*dum2+d23*dum3+d24*dum4+d25*dum5 +B22*(Y1+BETA*Y2)+B2+LAMBDA2*(Y1*Y1+2*D1*Y1*Y2+D2*Y2*Y2); FRML E3 Q3=(S13*Pd1+S23*Pd2+S33*Pd3 -THETA3*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*(Y1+BETA*Y2) +d31*dum1+d32*dum2+d33*dum3+d34*dum4+d35*dum5 +B33*(Y1+BETA*Y2)+B3+LAMBDA3*(Y1*Y1+2*D1*Y1*Y2+D2*Y2*Y2); FRML E4 Q4=-((S11+S12+S13)*Pd1+(S12+S22+S23)*Pd2+(S13+S23+S33)*Pd3 +THETA4*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*(Y1+BETA*Y2) +d41*dum1+d42*dum2+d43*dum3+d44*dum4+d45*dum5 +B44*(Y1+BETA*Y2)+B4+LAMBDA4*(Y1*Y1+2*D1*Y1*Y2+D2*Y2*Y2); LSQ(MAXIT=500,TOL=0.0001) E1 E2 E3 E4; ? Obtain observation-by-observation components of loglikelihood ? function for use in Vuong nonnested tests of multi-output ? model against single-output models mat uomegau=@res*@covu"@res'; mat detomega=det(@covu); mat truou=tr(uomegau); ? Verify calculation set k=-156*log(detomega)/2-truou/2; ? of loglikelihood function set l=-4*156*log(2*3.141592654)/2+k; ? value print k l; ? l=loglikelihood value ? Now get obs-by-obs components: mat uoudia=ident(156)%uomegau; ? Hadamard product leaves just ? diag elements mat uouvec=vech(uoudia); ? Place diagonal elements in vector unmake uouvec,uou; ? Place in variable ? Now genr components of lnlikelihood fn, omitting the common scalar genr l0=-(1/2)*uou-(log(detomega)/2); msd l0; ? sum should check with value of k above ? Now estimate single-output model M1: output=y1=wins FRML E1 Q1=(S11*Pd1+S12*Pd2+S13*Pd3+B11 -THETA1*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y1 +d11*dum1+d12*dum2+d13*dum3+d14*dum4+d15*dum5 +B1+LAMBDA1*Y1*Y1; FRML E2 Q2=(S12*Pd1+S22*Pd2+S23*Pd3+B22 -THETA2*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y1 +d21*dum1+d22*dum2+d23*dum3+d24*dum4+d25*dum5 +B2+LAMBDA2*Y1*Y1; FRML E3 Q3=(S13*Pd1+S23*Pd2+S33*Pd3+B33 -THETA3*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y1 +d31*dum1+d32*dum2+d33*dum3+d34*dum4+d35*dum5 +B3+LAMBDA3*Y1*Y1; FRML E4 Q4=-((S11+S12+S13)*Pd1+(S12+S22+S23)*Pd2+(S13+S23+S33)*Pd3 +B44 +THETA4*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y1 +d41*dum1+d42*dum2+d43*dum3+d44*dum4+d45*dum5 +B4+LAMBDA4*Y1*Y1; LSQ(MAXIT=200,TOL=0.0001) E1 E2 E3 E4; ? Obtain observation-by-observation components of loglikelihood ? function for use in Vuong nonnested tests of multi-output ? model against single-output models mat uomegau=@res*@covu"@res'; mat detomega=det(@covu); mat truou=tr(uomegau); ? Verify calculation set k=-156*log(detomega)/2-truou/2; ? of loglikelihood function set l=-4*156*log(2*3.141592654)/2+k; ? value print k l; ? l=loglikelihood value ? Now get obs-by-obs components: mat uoudia=ident(156)%uomegau; ? Hadamard product leaves just ? diag elements mat uouvec=vech(uoudia); ? Place diagonal elements in vector unmake uouvec,uou; ? Place in variable ? Now genr components of lnlikelihood fn, omitting the common scalar genr l1=-(1/2)*uou-(log(detomega)/2); msd l1; ? sum should check with value of k above ? Now estimate single-output model M2: output=y2=wins FRML E1 Q1=(S11*Pd1+S12*Pd2+S13*Pd3+B11 -THETA1*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y2 +d11*dum1+d12*dum2+d13*dum3+d14*dum4+d15*dum5 +B1+LAMBDA1*Y2*Y2; FRML E2 Q2=(S12*Pd1+S22*Pd2+S23*Pd3+B22 -THETA2*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y2 +d21*dum1+d22*dum2+d23*dum3+d24*dum4+d25*dum5 +B2+LAMBDA2*Y2*Y2; FRML E3 Q3=(S13*Pd1+S23*Pd2+S33*Pd3+B33 -THETA3*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y2 +d31*dum1+d32*dum2+d33*dum3+d34*dum4+d35*dum5 +B3+LAMBDA3*Y2*Y2; FRML E4 Q4=-((S11+S12+S13)*Pd1+(S12+S22+S23)*Pd2+(S13+S23+S33)*Pd3 +B44 +THETA4*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y2 +d41*dum1+d42*dum2+d43*dum3+d44*dum4+d45*dum5 +B4+LAMBDA4*Y2*Y2; LSQ(MAXIT=200,TOL=0.0001) E1 E2 E3 E4; ? Obtain observation-by-observation components of loglikelihood ? function for use in Vuong nonnested tests of multi-output ? model against single-output models mat uomegau=@res*@covu"@res'; mat detomega=det(@covu); mat truou=tr(uomegau); ? Verify calculation set k=-156*log(detomega)/2-truou/2; ? of loglikelihood function set l=-4*156*log(2*3.141592654)/2+k; ? value print k l; ? l=loglikelihood value ? Now get obs-by-obs components: mat uoudia=ident(156)%uomegau; ? Hadamard product leaves just ? diag elements mat uouvec=vech(uoudia); ? Place diagonal elements in vector unmake uouvec,uou; ? Place in variable ? Now genr components of lnlikelihood fn, omitting the common scalar genr l2=-(1/2)*uou-(log(detomega)/2); msd l2; ? sum should check with value of k above FRML E1 Q1=(S11*Pd1+S12*Pd2+S13*Pd3+B11 -THETA1*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y3 +d11*dum1+d12*dum2+d13*dum3+d14*dum4+d15*dum5 +B1+LAMBDA1*Y3*Y3; FRML E2 Q2=(S12*Pd1+S22*Pd2+S23*Pd3+B22 -THETA2*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y3 +d21*dum1+d22*dum2+d23*dum3+d24*dum4+d25*dum5 +B2+LAMBDA2*Y3*Y3; FRML E3 Q3=(S13*Pd1+S23*Pd2+S33*Pd3+B33 -THETA3*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y3 +d31*dum1+d32*dum2+d33*dum3+d34*dum4+d35*dum5 +B3+LAMBDA3*Y3*Y3; FRML E4 Q4=-((S11+S12+S13)*Pd1+(S12+S22+S23)*Pd2+(S13+S23+S33)*Pd3 +B44 +THETA4*(S11*P11+S12*P12+S13*P13 +S22*P22+S23*P23 +S33*P33))*Y3 +d41*dum1+d42*dum2+d43*dum3+d44*dum4+d45*dum5 +B4+LAMBDA4*Y3*Y3; LSQ(MAXIT=200,TOL=0.0001) E1 E2 E3 E4; ? Obtain observation-by-observation components of loglikelihood ? function for use in Vuong nonnested tests of multi-output ? model against single-output models mat uomegau=@res*@covu"@res'; mat detomega=det(@covu); mat truou=tr(uomegau); ? Verify calculation set k=-156*log(detomega)/2-truou/2; ? of loglikelihood function set l=-4*156*log(2*3.141592654)/2+k; ? value print k l; ? l=loglikelihood value ? Now get obs-by-obs components: mat uoudia=ident(156)%uomegau; ? Hadamard product leaves just ? diag elements mat uouvec=vech(uoudia); ? Place diagonal elements in vector unmake uouvec,uou; ? Place in variable ? Now genr components of lnlikelihood fn, omitting the common scalar genr l3=-(1/2)*uou-(log(detomega)/2); msd l3; ? sum should check with value of k above ? Compute Vuong nonnested test statistics using differences in ? loglikelihood observations genr l01=l0-l1; genr l02=l0-l2; genr l03=l0-l3; genr l12=l1-l2; genr l13=l1-l3; genr l23=l2-l3; msd l01 l02 l03 l12 l13 l23; mat nstat=@sum/(sqrt(155)*@stddev); ? obtain p-values (using both sides of distribution--- ? published p-values are 1-sided and are therefore 1/2 of these) set stat01=nstat(1); cdf(normal) stat01; set stat02=nstat(2); cdf(normal) stat02; set stat03=nstat(3); cdf(normal) stat03; set stat12=nstat(4); cdf(normal) stat12; set stat13=nstat(5); cdf(normal) stat13; set stat23=nstat(6); cdf(normal) stat23; stop;