Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit




STATA OUTPUT AND GRAPHS FOR FINAL EXAM


Instructions for the materials

This material packet contains 22 “exhibits” – Stata output, graphs, or tables – for four research questions. The final exam will ask questions about these exhibits. Not all exhibits will necessarily be covered in the final exam and the final exam may ask questions about topics not directly examined in the materials. You may take notes on this packet in any way that you wish. There are two blank pages at the end of the packet for additional notes. You may not add any more pages – your material packet should have a total of single sided 23 pages.


A suggestion to use this material packet: Examine the output and graphs presented here in the context of the material covered in class. And think about what questions could be asked about them, using the problem sets and class slides as guides.


Data and Research Questions: Two Data sets are used for the exam: California school districts data and ECLS -K-2011.


1. The exam will use California school districts data (posted in Canvas) for the research questions 1 and 2 on non-linearity and interactions. We will examine these with this data and output/graphs presented in exhibits 20-22. The data description and variables are presented below. Exhibits 20-22 will be used for the questions for this data.


Key Variables

dist_code: district Code;

Read_scr: avg Reading Score;

Math_scr: avg Math Score;

County : county;

District: District;

gr_span: grade span of district;

enrl_tot : total enrollment;

teachers: number of teachers;

computer: number of computers;

testscr: avg test score (= (read_scr+math_scr)/2 );

comp_stu: computers per student ( = computer/enrl_tot);

expn_stu: expentitures per student ($’s);

str: student teacher ratio (enrl_tot/TEACHERS);

el_pct:              percent of English Learners;

Meal_pct: Percent qualifying for reduced-price lunch;

cAlw_pct: Percent qualifying for CalWorks;

avGinc: district average income (in $1000's);


Research Questions:

1. Are there nonlinear effects of class size reduction on test scores?  That is, does a reduction from 35 to 30 have same effect as a reduction from 20 to 15?

2. Are there non-linear interactions between PctEL (percent of English Learners) and STR (student teacher ratio)? (Are small classes more effective when there are many English learners?)


2. The exam uses data from ECLS-K-2011 to examine the relationship between private school attendance and teacher perceptions of student behavior. The third research question will ask you to describe the type of students that attend private school. The fourth research question will ask you to investigate the relationship between private school attendance and teacher perceptions of student behavior. The materials also include some relevant exploratory data analysis, and are generally organized as follows:

· Exhibits 1-9: Exploratory data analysis and relevant descriptive statistics (relevant to both research questions)

· Exhibits 10-13: Exhibits relevant to Research Question 3

· Exhibits 14-19: Exhibits relevant to Research Question 4

Key variables:

X2TCHCON teacher reported self control (spring)

X2TCHPER teacher reported interpersonal skills (spring)

X2ATTNFS teacher reported attentional focus (spring)

X2INBCNT teacher reported inhibitory control (spring)

Fall versions of these variables that begin with X1

ZBEHAVE2 (spring) and ZBEHAVE1 (fall) indices of teacher perceived behavior  standardized in the analysis sample. Stata Code for the construction of these variables:

**Generate standardized indices of teacher perceptions of student behavior**

foreach v of varlist  X2TCHCON X2TCHPER X2ATTNFS X2INBCNT  X1TCHCON X1TCHPER X1ATTNFS X1INBCNT {

egen std_`v'=std(`v')

}

egen behave2=rowmean(std_X2*)

egen behave1=rowmean(std_X1*)


center behave2 , standardize gen(ZBEHAVE2)

center behave1 , standardize gen(ZBEHAVE1)


label var ZBEHAVE2 "Teacher Perceptions of Behavior (Spring, Z-scored)"

label var ZBEHAVE1 "Teacher Perceptions of Behavior (Fall, Z-scored)"

PRIVATE dummy variable indicating if a child attends kindergarten in a private school

ASIAN, BLACK, LATINO, MULTIRACIAL, NATAMER, WHITE dummy variables for racial groups constructed from the RACE6 variable provided by ECLS-K

ZSES socioeconomic status, standardized in the analysis sample

FEMALE a dummy variable for indicating that the child is a girl

NONENGL a dummy variable indicating that the child’s home language is not English

DISABILTY a dummy variable indicating that the child has a disability


Sample restrictions: The sample is restricted to students with non-missing data for all of the above variables (or the variables used to construct the above variables)


Research question 3: What type of students attend private schools?

Research question 4: Do teachers’ perceptions of student behavior differ across school sectors (public vs. private)?

Exhibit 1: Principal components analysis of spring teacher reported self control, interpersonal skills, attentional focus, and inhibitory control (X2TCHCON X2TCHPER X2ATTNFS X2INBCNT)


pca  X2TCHCON X2TCHPER X2ATTNFS X2INBCNT, means

Principal components/correlation                  Number of obs    =      8921

Number of comp.  =         4

Trace            =         4

Rotation: (unrotated = principal)             Rho              =    1.0000

--------------------------------------------------------------------------

Component |   Eigenvalue   Difference         Proportion   Cumulative

-------------+------------------------------------------------------------

Comp1 |      3.05158      2.47495             0.7629       0.7629

Comp2 |      .576633      .366531             0.1442       0.9071

Comp3 |      .210102      .048416             0.0525       0.9596

Comp4 |      .161686            .             0.0404       1.0000

--------------------------------------------------------------------------

Principal components (eigenvectors)

--------------------------------------------------------------------

Variable |    Comp1     Comp2     Comp3     Comp4 | Unexplained

-------------+----------------------------------------+-------------

X2TCHCON |   0.5057   -0.4715   -0.3810    0.6138 |           0

X2TCHPER |   0.5004   -0.4890    0.5653   -0.4370 |           0

X2ATTNFS |   0.4748    0.6538    0.4443    0.3869 |           0

X2INBCNT |   0.5181    0.3334   -0.5812   -0.5316 |           0

--------------------------------------------------------------------

Exhibit 2: Screeplot of the eigenvalues after the above PCA (spring variables)

Exhibit 3: Principal components analysis of fall teacher reported self control, interpersonal skills, attentional focus, and inhibitory control (X1TCHCON X1TCHPER X1ATTNFS X1INBCNT)


pca  X1TCHCON X1TCHPER X1ATTNFS X1INBCNT, means

Principal components/correlation                  Number of obs    =      8921

Number of comp.  =         4

Trace            =         4

Rotation: (unrotated = principal)             Rho              =    1.0000

--------------------------------------------------------------------------

Component |   Eigenvalue   Difference         Proportion   Cumulative

-------------+------------------------------------------------------------

Comp1 |       3.0154      2.43384             0.7538       0.7538

Comp2 |      .581558      .354863             0.1454       0.8992

Comp3 |      .226695     .0503479             0.0567       0.9559

Comp4 |      .176347            .             0.0441       1.0000

--------------------------------------------------------------------------

Principal components (eigenvectors)

--------------------------------------------------------------------

Variable |    Comp1     Comp2     Comp3     Comp4 | Unexplained

-------------+----------------------------------------+-------------

X1TCHCON |   0.5030   -0.4766   -0.5136    0.5060 |           0

X1TCHPER |   0.4972   -0.5030    0.6214   -0.3373 |           0

X1ATTNFS |   0.4826    0.6188    0.3804    0.4893 |           0

X1INBCNT |   0.5167    0.3700   -0.4532   -0.6251 |           0

--------------------------------------------------------------------

Exhibit 4: Screeplot of the eigenvalues after the above PCA (fall variables)


Exhibit 5: Summary statistics of key variables for the analysis


sum ZBEHAVE2 ZBEHAVE1 PRIVATE ZSES FEMALE WHITE BLACK LATINO ASIAN ///

NATAMER MULTI NONENGL DISABILITY , sep(0)

Variable |       Obs        Mean    Std. Dev.       Min        Max

-------------+--------------------------------------------------------

ZBEHAVE2 |      8921   -2.28e-10           1  -3.487666   1.575331

ZBEHAVE1 |      8921    3.82e-10           1   -3.67505   1.800834

PRIVATE |      8921     .137989    .3449078          0          1

ZSES |      8921   -2.24e-09           1  -2.905879   2.957004

FEMALE |      8921    .4914247    .4999545          0          1

WHITE |      8921    .5529649    .4972147          0          1

BLACK |      8921    .1080596    .3104731          0          1

LATINO |      8921    .2106266    .4077765          0          1

ASIAN |      8921    .0671449    .2502869          0          1

NATAMER |      8921    .0110974     .104764          0          1

MULTIRACIAL |      8921    .0501065    .2181769          0          1

NONENGL |      8921    .1512162    .3582796          0          1

DISABILITY |      8921    .1972873    .3979733          0          1

Exhibit 6: Distribution of ZBEHAVE2 by school, for a subset of schools and Stata code used to generate the graph



sort SCHID

graph box ZBEHAVE2 if SCHID>=1300&SCHID<=1400 , ///

over(SCHID, label(angle(45) labsize(tiny))) ///

nooutsides name(behaveXschool,replace)

Exhibit 7: Cross tabulations of private school status with demographic characteristics

Key

|----------------|

|   frequency    |

| row percentage |

+----------------+

| CHILD ATTENDS PRIVATE SCHOOL

ASIAN |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     7,193      1,129 |     8,322

|     86.43      13.57 |    100.00

-----------+----------------------+----------

Yes |       497        102 |       599

|     82.97      17.03 |    100.00

-----------+----------------------+----------

BLACK |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     6,820      1,137 |     7,957

|     85.71      14.29 |    100.00

-----------+----------------------+----------

Yes |       870         94 |       964

|     90.25       9.75 |    100.00

-----------+----------------------+----------

LATINO |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     5,983      1,059 |     7,042

|     84.96      15.04 |    100.00

-----------+----------------------+----------

Yes |     1,707        172 |     1,879

|     90.85       9.15 |    100.00

-----------+----------------------+----------

MULTIRACIAL|    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     7,312      1,162 |     8,474

|     86.29      13.71 |    100.00

-----------+----------------------+----------

Yes |       378         69 |       447

|     84.56      15.44 |    100.00

-----------+----------------------+----------

NAT.AMERICAN|   PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     7,604      1,218 |     8,822

|     86.19      13.81 |    100.00

-----------+----------------------+----------

Yes |        86         13 |        99

|     86.87      13.13 |    100.00

-----------+----------------------+----------

WHITE |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

No |     3,538        450 |     3,988

|     88.72      11.28 |    100.00

-----------+----------------------+----------

Yes |     4,152        781 |     4,933

|     84.17      15.83 |    100.00

-----------+----------------------+----------

Total |     7,690      1,231 |     8,921

|     86.20      13.80 |    100.00

Key

|----------------|

|   frequency    |

| row percentage |

+----------------+

| CHILD ATTENDS PRIVATE SCHOOL

LANGUAGE |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

ENGLISH |     6,449      1,123 |     7,572

|     85.17      14.83 |    100.00

-----------+----------------------+----------

NON-ENGLISH|     1,241        108 |     1,349

|     91.99       8.01 |    100.00

-----------+----------------------+----------

DISABILITY |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

NO |     6,120      1,041 |     7,161

|     85.46      14.54 |    100.00

-----------+----------------------+----------

YES |     1,570        190 |     1,760

|     89.20      10.80 |    100.00

-----------+----------------------+----------

GENDER |    PUBLIC    PRIVATE |     Total

-----------+----------------------+----------

MALE |     3,923        614 |     4,537

|     86.47      13.53 |    100.00

-----------+----------------------+----------

FEMALE |     3,767        617 |     4,384

|     85.93      14.07 |    100.00

-----------+----------------------+----------

Total |     7,690      1,231 |     8,921

|     86.20      13.80 |    100.00


Exhibit 8: Distribution of ZBEHAVE1 and ZBEHAVE2, by private school status


bys PRIVATE: su ZBEHAVE1

-> PUBLIC

Variable |        Obs        Mean    Std. Dev.       Min        Max

-------------+---------------------------------------------------------

ZBEHAVE1 |      7,690   -.0201468    1.007677   -3.67505   1.800834

-> PRIVATE

Variable |        Obs        Mean    Std. Dev.       Min        Max

-------------+---------------------------------------------------------

ZBEHAVE1 |      1,231    .1258559    .9413133  -2.907247   1.800834

bys PRIVATE: su ZBEHAVE2

-> PUBLIC

Variable |        Obs        Mean    Std. Dev.       Min        Max

-------------+---------------------------------------------------------

ZBEHAVE2 |      7,690   -.0049717    1.005333  -3.487666   1.575331

-> PRIVATE

Variable |        Obs        Mean    Std. Dev.       Min        Max

-------------+---------------------------------------------------------

ZBEHAVE2 |      1,231    .0310581    .9658383  -3.292697   1.575331

Exhibit 9: Kernel densities of ZBEHAVE1 and ZBEHAVE2 by private school status


Exhibit 10: The probability of attending private school by SES for locally weighted scatterplot smoothing (“LOWESS”) and the fitted values from a logistic regression with private school as the outcome and ZSES as the predictor


Exhibit 11: Stata output from a logistic regression of private school status on SES, indicators for race/ethnicity, home language, disability status, gender, and the interactions between SES and race/ethnicity groups


Log-odds:

Logistic regression                             Number of obs     =      8,921

LR chi2(14)       =     619.90

Prob > chi2       =     0.0000

Log likelihood = -3270.0123                     Pseudo R2         =     0.0866

------------------------------------------------------------------------------------

PRIVATE |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

-------------------+----------------------------------------------------------------

ZSES |   .6452725   .0464642    13.89   0.000     .5542044    .7363406

BLACK |  -.1698165   .1279719    -1.33   0.185    -.4206368    .0810038

LATINO |  -.0199731   .1053526    -0.19   0.850    -.2264604    .1865141

ASIAN |  -.0802641   .1831387    -0.44   0.661    -.4392093    .2786811

NATAMER |   .1520036    .332461     0.46   0.648     -.499608    .8036151

MULTIRACIAL |  -.0140527   .1650163    -0.09   0.932    -.3374787    .3093733

BLACK#c.ZSES |    .446846   .1335925     3.34   0.001     .1850096    .7086824

LATINO#c.ZSES |    .370618   .1018251     3.64   0.000     .1710446    .5701915

ASIAN#c.ZSES |  -.0282525   .1274395    -0.22   0.825    -.2780292    .2215243

NATAMER#c.ZSES |   .8569835   .4880388     1.76   0.079     -.099555    1.813522

MULTIRACIAL#c.ZSES |   .0733108    .142324     0.52   0.606    -.2056392    .3522609

FEMALE  |   .0300211   .0641863     0.47   0.640    -.0957819     .155824

NONENGL |   -.151067   .1339794    -1.13   0.260    -.4136618    .1115277

DISABILITY |  -.3117393   .0871495    -3.58   0.000    -.4825491   -.1409294

_cons |  -1.900224   .0614793   -30.91   0.000    -2.020721   -1.779726

------------------------------------------------------------------------------------

Odds-ratios:

Logistic regression                             Number of obs     =      8,921

LR chi2(14)       =     619.90

Prob > chi2       =     0.0000

Log likelihood = -3270.0123                     Pseudo R2         =     0.0866

------------------------------------------------------------------------------------

PRIVATE | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]

-------------------+----------------------------------------------------------------

ZSES |   1.906506   .0885843    13.89   0.000     1.740556     2.08828

BLACK |   .8438196   .1079852    -1.33   0.185     .6566285    1.084375

LATINO |    .980225   .1032692    -0.19   0.850     .7973509    1.205042

ASIAN |   .9228726   .1690136    -0.44   0.661     .6445459    1.321386

NATAMER |   1.164164   .3870392     0.46   0.648     .6067685    2.233601

MULTIRACIAL |   .9860456   .1627136    -0.09   0.932     .7135672    1.362571

BLACK#c.ZSES |   1.563374   .2088549     3.34   0.001      1.20323    2.031313

LATINO#c.ZSES |    1.44863   .1475068     3.64   0.000     1.186544    1.768606

ASIAN#c.ZSES |   .9721429   .1238894    -0.22   0.825     .7572747    1.247978

NATAMER#c.ZSES |   2.356043    1.14984     1.76   0.079     .9052402    6.132006

MULTIRACIAL#c.ZSES |   1.076065   .1531499     0.52   0.606     .8141268    1.422279

FEMALE  |   1.030476   .0661425     0.47   0.640     .9086622    1.168621

NONENGL |   .8597901   .1151941    -1.13   0.260     .6612246    1.117985

DISABILITY |   .7321724   .0638085    -3.58   0.000      .617208    .8685506

_cons |   .1495352   .0091933   -30.91   0.000     .1325599    .1686843

------------------------------------------------------------------------------------

Exhibit 12: The probability of attending a private school by SES, for students of different race/ethnicity groups, controlling for home language, disability, and gender

Note: If you have difficulty distinguishing the lines, use the regression output from Exhibit 12 to guide you.