api.Rd
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.
data(api)
The full population data in apipop
are a data frame with 6194 observations on the following 37 variables.
Unique identifier
Elementary/Middle/High School
School name (15 characters)
School name (40 characters)
School number
District name
District number
County name
County number
reason for missing data
percentage of students tested
API in 2000
API in 1999
target for change in API
Change in API
Met school-wide growth target?
Met Comparable Improvement target
Met both targets
Eligible for awards program
Percentage of students eligible for subsidized meals
`English Language Learners' (percent)
Year-round school
percentage of students for whom this is the first year at the school
average class size years K-3
average class size years 4-6
Number of core academic courses
percent where parental education level is known
percent parents not high-school graduates
percent parents who are high-school graduates
percent parents with some college
percent parents with college degree
percent parents with postgraduate education
average parental education level
percent fully qualified teachers
percent teachers with emergency qualifications
number of students enrolled
number of students tested.
The other data sets contain additional variables pw
for
sampling weights and fpc
to compute finite population
corrections to variance.
apipop
is the entire population, apisrs
is a simple random sample,
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.
Data were obtained from the survey sampling help pages of UCLA Academic Technology Services; these pages are no longer on line.
The API program has been discontinued at the end of 2018. Information is archived at https://www.cde.ca.gov/re/pr/api.asp
library(survey)
data(api)
mean(apipop$api00)
#> [1] 664.7126
sum(apipop$enroll, na.rm=TRUE)
#> [1] 3811472
#stratified sample
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
summary(dstrat)
#> Stratified Independent Sampling design
#> svydesign(id = ~1, strata = ~stype, weights = ~pw, data = apistrat,
#> fpc = ~fpc)
#> Probabilities:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.02262 0.02262 0.03587 0.04014 0.05339 0.06623
#> Stratum Sizes:
#> E H M
#> obs 100 50 50
#> design.PSU 100 50 50
#> actual.PSU 100 50 50
#> Population stratum sizes (PSUs):
#> E H M
#> 4421 755 1018
#> Data variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "pw" "fpc"
svymean(~api00, dstrat)
#> mean SE
#> api00 662.29 9.4089
svytotal(~enroll, dstrat, na.rm=TRUE)
#> total SE
#> enroll 3687178 114642
# one-stage cluster sample
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
summary(dclus1)
#> 1 - level Cluster Sampling design
#> With (15) clusters.
#> svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
#> Probabilities:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.02954 0.02954 0.02954 0.02954 0.02954 0.02954
#> Population size (PSUs): 757
#> Data variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "fpc" "pw"
svymean(~api00, dclus1)
#> mean SE
#> api00 644.17 23.542
svytotal(~enroll, dclus1, na.rm=TRUE)
#> total SE
#> enroll 3404940 932235
# two-stage cluster sample
dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2)
summary(dclus2)
#> 2 - level Cluster Sampling design
#> With (40, 126) clusters.
#> svydesign(id = ~dnum + snum, fpc = ~fpc1 + fpc2, data = apiclus2)
#> Probabilities:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840
#> Population size (PSUs): 757
#> Data variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "pw" "fpc1" "fpc2"
svymean(~api00, dclus2)
#> mean SE
#> api00 670.81 30.099
svytotal(~enroll, dclus2, na.rm=TRUE)
#> total SE
#> enroll 2639273 799638
# two-stage `with replacement'
dclus2wr<-svydesign(id=~dnum+snum, weights=~pw, data=apiclus2)
summary(dclus2wr)
#> 2 - level Cluster Sampling design (with replacement)
#> With (40, 126) clusters.
#> svydesign(id = ~dnum + snum, weights = ~pw, data = apiclus2)
#> Probabilities:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.003669 0.037743 0.052840 0.042390 0.052840 0.052840
#> Data variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "pw" "fpc1" "fpc2"
svymean(~api00, dclus2wr)
#> mean SE
#> api00 670.81 30.712
svytotal(~enroll, dclus2wr, na.rm=TRUE)
#> total SE
#> enroll 2639273 820261
# convert to replicate weights
rclus1<-as.svrepdesign(dclus1)
summary(rclus1)
#> Call: as.svrepdesign.default(dclus1)
#> Unstratified cluster jacknife (JK1) with 15 replicates.
#> Variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "fpc" "pw"
svymean(~api00, rclus1)
#> mean SE
#> api00 644.17 26.329
svytotal(~enroll, rclus1, na.rm=TRUE)
#> total SE
#> enroll 3404940 932235
# 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)
#> 1 - level Cluster Sampling design
#> With (15) clusters.
#> postStratify(dclus1, ~stype, pop.types)
#> Probabilities:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> 0.01854 0.03257 0.03257 0.03040 0.03257 0.03257
#> Population size (PSUs): 757
#> Data variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "fpc" "pw"
summary(rclus1p)
#> Call: postStratify(rclus1, ~stype, pop.types)
#> Unstratified cluster jacknife (JK1) with 15 replicates.
#> Variables:
#> [1] "cds" "stype" "name" "sname" "snum" "dname"
#> [7] "dnum" "cname" "cnum" "flag" "pcttest" "api00"
#> [13] "api99" "target" "growth" "sch.wide" "comp.imp" "both"
#> [19] "awards" "meals" "ell" "yr.rnd" "mobility" "acs.k3"
#> [25] "acs.46" "acs.core" "pct.resp" "not.hsg" "hsg" "some.col"
#> [31] "col.grad" "grad.sch" "avg.ed" "full" "emer" "enroll"
#> [37] "api.stu" "fpc" "pw"
svymean(~api00, dclus1p)
#> mean SE
#> api00 642.31 23.92
svytotal(~enroll, dclus1p, na.rm=TRUE)
#> total SE
#> enroll 3680893 406293
svymean(~api00, rclus1p)
#> mean SE
#> api00 642.31 26.934
svytotal(~enroll, rclus1p, na.rm=TRUE)
#> total SE
#> enroll 3680893 473431