小编FFI*_*FFI的帖子

如何从svyciprop对象中提取属性值?

如何从下面的svyciprop对象中提取属性到data.frame:

library(survey)
api <- read.dta(file = "http://www.ats.ucla.edu/stat/stata/library/apipop.dta")
data(api)
dclus1 <- svydesign(id=~dnum, fpc=~fpc, data=apiclus1)
prop.ci <- svyciprop(~I(ell==0), dclus1, method="li")
Run Code Online (Sandbox Code Playgroud)

印花

prop.ci
Run Code Online (Sandbox Code Playgroud)

产量:

> prop.ci

                         2.5% 97.5%
I(ell == 0) 0.021858 0.000664  0.11

str(prop.ci)
> str(prop.ci)
  Class 'svyciprop'  atomic [1:1] 0.0219
    ..- attr(*, "var")= num [1, 1] 0.000512
    .. ..- attr(*, "dimnames")=List of 2
    .. .. ..$ : chr "as.numeric(I(ell == 0))"
    .. .. ..$ : chr "as.numeric(I(ell == 0))"
    ..- attr(*, "ci")= Named num [1:2] 0.000664 0.107778
    .. ..- attr(*, "names")= …
Run Code Online (Sandbox Code Playgroud)

r survey confidence-interval

4
推荐指数
1
解决办法
730
查看次数

标签 统计

confidence-interval ×1

r ×1

survey ×1