api                  package:survey                  R Documentation

_S_t_u_d_e_n_t _p_e_r_f_o_r_m_a_n_c_e _i_n _C_a_l_i_f_o_r_n_i_a _s_c_h_o_o_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     The Academic Performance Index is computed for all California
     schools based on standardised testing of students. The data sets
     contain information for all schools with at least 100 students and
     for various probability samples of the data.

_U_s_a_g_e:

     data(api)

_F_o_r_m_a_t:

     The full population data in 'apipop' are a data frame with 6194
     observations on the following 37 variables.

     _c_d_s Unique identifier

     _s_t_y_p_e Elementary/Middle/High School

     _n_a_m_e School name (15 characters)

     _s_n_a_m_e School name (40 characters)

     _s_n_u_m School number

     _d_n_a_m_e District name

     _d_n_u_m District number

     _c_n_a_m_e County name

     _c_n_u_m County number

     _f_l_a_g reason for missing data

     _p_c_t_t_e_s_t percentage of students tested

     _a_p_i_0_0 API in 2000

     _a_p_i_9_9 API in 1999

     _t_a_r_g_e_t target for change in API

     _g_r_o_w_t_h Change in API

     _s_c_h._w_i_d_e Met school-wide growth target?

     _c_o_m_p._i_m_p Met Comparable Improvement target

     _b_o_t_h Met both targets

     _a_w_a_r_d_s Eligible for awards program

     _m_e_a_l_s Percentage of students eligible for subsidized meals

     _e_l_l `English Language Learners' (percent)

     _y_r._r_n_d Year-round school

     _m_o_b_i_l_i_t_y percentage of students for whom this is the first year at
          the school

     _a_c_s._k_3 average class size years K-3

     _a_c_s._4_6 average class size years 4-6

     _a_c_s._c_o_r_e Number of core academic courses

     _p_c_t._r_e_s_p percent where parental education level is known

     _n_o_t._h_s_g percent parents not high-school graduates

     _h_s_g percent parents who are high-school graduates

     _s_o_m_e._c_o_l percent parents with some college

     _c_o_l._g_r_a_d percent parents with college degree

     _g_r_a_d._s_c_h percent parents with postgraduate education

     _a_v_g._e_d average parental education level

     _f_u_l_l percent fully qualified teachers

     _e_m_e_r percent teachers with emergency qualifications

     _e_n_r_o_l_l number of students enrolled

     _a_p_i._s_t_u number of students tested.

     The other data sets contain additional variables 'pw' for sampling
     weights and 'fpc' to compute finite population corrections to
     variance.

_D_e_t_a_i_l_s:

     'apipop' is the entire population, 'apiclus1' is a cluster sample
     of school districts, 'apistrat' is a sample stratified by 'stype',
     and 'apiclus2' is a two-stage cluster sample of schools within
     districts.  The sampling weights in 'apiclus1' are incorrect (the
     weight should be 757/15) but are as  obtained from UCLA.

_S_o_u_r_c_e:

     Data were obtained from the survey sampling help pages of UCLA
     Academic Technology Services, at <URL:
     http://www.ats.ucla.edu/stat/stata/Library/svy_survey.htm>.

_R_e_f_e_r_e_n_c_e_s:

     The API program and original data files are at  <URL:
     http://api.cde.ca.gov/>

_E_x_a_m_p_l_e_s:

     library(survey)
     data(api)
     mean(apipop$api00)
     sum(apipop$enroll, na.rm=TRUE)

     #stratified sample
     dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
     summary(dstrat)
     svymean(~api00, dstrat)
     svytotal(~enroll, dstrat, na.rm=TRUE)

     # one-stage cluster sample
     dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
     summary(dclus1)
     svymean(~api00, dclus1)
     svytotal(~enroll, dclus1, na.rm=TRUE)

     # two-stage cluster sample
     dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2)
     summary(dclus2)
     svymean(~api00, dclus2)
     svytotal(~enroll, dclus2, na.rm=TRUE)

     # two-stage `with replacement'
     dclus2wr<-svydesign(id=~dnum+snum, weights=~pw, data=apiclus2)
     summary(dclus2wr)
     svymean(~api00, dclus2wr)
     svytotal(~enroll, dclus2wr, na.rm=TRUE)

     # convert to replicate weights
     rclus1<-as.svrepdesign(dclus1)
     summary(rclus1)
     svymean(~api00, rclus1)
     svytotal(~enroll, rclus1, na.rm=TRUE)

     # post-stratify on school type
     pop.types<-xtabs(~stype, data=apipop)

     rclus1p<-postStratify(rclus1, ~stype, pop.types)
     dclus1p<-postStratify(dclus1, ~stype, pop.types)
     summary(dclus1p)
     summary(rclus1p)

     svymean(~api00, dclus1p)
     svytotal(~enroll, dclus1p, na.rm=TRUE)

     svymean(~api00, rclus1p)
     svytotal(~enroll, rclus1p, na.rm=TRUE)

