- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有来自分层简单随机抽样设计的调查数据,其中某些层仅包含一个抽样单位(即使层人口规模可能大于 1)。这些在 R 调查包 ( http://r-survey.r-forge.r-project.org/survey/exmample-lonely.html ) 中被称为“孤独的 PSU”。处理这种情况有多种选择,我感兴趣的是“调整”选项。options(survey.lonely.psu="adjust")
的文档指出
"the data for the single-PSU stratum are centered at the sample grand mean rather than the stratum mean."
library(survey)
options(survey.lonely.psu="adjust")
# sample 1
dat1 <- data.frame(N = c(3, 3, 2), h = c(1, 1, 2), y = c(2, 6, 15))
survey1 <- svydesign(~1, fpc = ~N, strata = ~h, data = dat1)
svyby(~y, by = ~h, design = survey1, FUN = svytotal)
h y se
1 1 12 3.464102
2 2 30 21.213203
# sample 2
(dat2 <- data.frame(N = c(3, 3, 2), h = c(1, 1, 2), y = c(200, 600, 15)))
(survey2 <- svydesign(~1, fpc = ~N, strata = ~h, data = dat2))
svyby(~y, by = ~h, design = survey2, FUN = svytotal)
h y se
1 1 1200 346.4102
2 2 30 21.2132
R version 3.1.3 (2015-03-09)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
other attached packages:
[1] survey_3.30-3
svyby
的子集时,方差调整不会生效。功能。但是,当我将分层总体的总方差与总总体的方差进行比较时,似乎就像没有单独的初级抽样单位一样,总方差只是独立采样的层方差的方差:
> vcov(svyby(~y, by = ~h, design = survey1, FUN = svytotal))
1 2
1 12 0
2 0 450
> vcov(svytotal(~y, survey1))
y
y 462
svyby
的比较在估算均值与总计时:
> svyby(~y, by = ~h, design = survey1, FUN = svymean)
h y se
1 1 4 1.155
2 2 15 0.000
> svyby(~y, by = ~h, design = survey1, FUN = svytotal)
h y se
1 1 12 3.464
2 2 30 21.213
最佳答案
对复杂设计子集的分析基本上等同于将子集外观测的抽样权重设置为零的分析。这意味着这些观察结果不属于“大均值”。
关于r - 对 R 调查包 : why don't single-PSU strata variances change when data in other strata change? 中的孤独 PSU 使用 "adjust"选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32533677/
我一直在阅读一篇标题为 Don’t Be Scared Of Functional Programming 的文章并且有一段代码我无法理解(粘贴在下面)。该代码的目的是从名为 data 的对象数组中获
我现在还没有想到这一点。 到目前为止,每当设备要求我使用位置更新时,我都会允许。 但是现在我不允许,那么位置管理器会给我 kclErrorDenied 并且位置管理器无法再次启动,直到我重新启动应用程
如何重构我的代码以消除 JSLinter 中的此错误?我尝试将整个函数移至 var,但此后代码无法运行。 for (i = 0; i < timeDifference; i++) { ti
假设我们有一个包含 3 列的数据框,代表 3 种不同的情况,每一种都可以是状态 0 或 1。第四列包含一个测量值。 set.seed(123) df 2 0 0 1 0.4571073 3
“函数模板的特化不参与重载解析。仅考虑基本模板”的真正含义是什么 我用其专用版本编写了一个简单的模板函数,并且可以看到调用了专用: // Base template template T max(T
假设我们有一个包含 3 列的数据框,代表 3 种不同的情况,每一种都可以是状态 0 或 1。第四列包含一个测量值。 set.seed(123) df 2 0 0 1 0.4571073 3
在 C++/MFC 中,显示带有“不再显示”选项的消息框的最简单方法是什么? 在我的例子中,我只想要一个简单的 MB_OK 消息框(一个 OK 按钮)。 最佳答案 或者只使用 SHMessageBox
我正在尝试为我的 ios 应用程序设置一个谷歌登录,为此我需要 CocoaPods。但是当像在终端上有自己的网站一样安装它时,我得到了这个: $ sudo gem install cocoapods
这些年来,我肯定以某种方式忽略了“告诉,不要问” OOP原则,因为我是几天前才第一次了解它。 但是上下文是关于已从ASP.NET Web表单页面移到数据/业务对象中的验证代码的讨论,并且没有“Vali
我在 The Sims Social 应用程序中看到请求对话框中有一个复选框选项,上面写着:“在向 发送 The Sims Social 请求之前不要询问。” 我还没有在 Facebook API D
我正在阅读 Thread and Processes 之间的区别并在第二个答案中发现了用户留下的评论,其中指出 As so long as you don't format a floppy at t
*、?、+ 字符均表示匹配该字符。哪个字符表示“不”匹配这个?例子会有所帮助。 最佳答案 您可以使用否定字符类来排除某些字符:例如,[^abcde] 将匹配除 a、b、c、d、e 字符之外的任何字符。
至少在 Pixel 手机上,可以将手机从设置中静音。但是,从屏幕截图中可以看出,我没有找到任何将手机设置为这种模式的 Android API。 如果我使用 AudioManager使用 setRing
我的应用程序需要权限才能运行。如果用户拒绝初始运行的权限,它将关闭。如果他们第二次运行应用程序并再次拒绝权限,第三次尝试运行应用程序并请求权限时,对话框中还会出现一个单选按钮,其中包含“不再询问”选项
制作了一个群发信使和一个多消息/垃圾邮件发送者合二为一,工作正常,只是想让它变得更好。显然,我必须编写代码让 Skype 允许该程序,这样它才能做它做的事情,就在这里, private voi
我正在尝试创建一个对话框以在我的应用程序中显示一条介绍消息,其下方有一个“不再显示”复选框。不会写代码。 @Override protected void onStart() {
我有一个特性,可以为微 Controller 指定允许的引脚配置: pub trait TimChannelsMapping: Sized { const MAPPING: u8; } 它是这
我有一组位模式,想在该组中找到与给定输入匹配的元素的索引。位模式包含“无关”位,即匹配 0 和 1 的 x-es。 例子位模式集是 index abcd 0 00x1 1 01xx
在 Android 中,如果您请求权限,第二次请求允许用户选中“不要再问我”,因此将来总是会达到失败状态。 如果用户改变主意并想要允许权限,但现在不能,因为该功能默认为权限失败状态,该怎么办?用户如何
当我在模拟器中运行时,我的 android 应用程序有以下几种形式的警告: "Resources don't contain package for resource number " 如何修复这些警
我是一名优秀的程序员,十分优秀!