由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - Question for Stratify sampling.
相关主题
用SAS sampling的一个问题sampling weight variable怎么用到linear regression里啊?
样本数量问题求助急求 马上要选课了 谢谢各位大神
请问k-mean clust或decision tree或stratify sampling?onsite求建议呀
请问一个统计问题讨论一下,非独立sample的显著性比较
[R] How to stratify data in R?Random forests on imbalanced data (转载)
请教一个survey weight的问题问个sas code,急
Ask a question about one sample test【包子答谢】求教SAS survey data 的问题
这样还能算Randomized sample吗R: generate random number的问题
相关话题的讨论汇总
话题: rep话题: stratum话题: sampling话题: data话题: region
进入Statistics版参与讨论
1 (共1页)
a****y
发帖数: 91
1
I am trying to understand the sampling from the following description. Does
anyone know how they get the sample stratum sizes: 10,5,10,4,6. Thanks a lot!
Generates artificial data (a 235X3 matrix with 3 columns: state, region,
income).
# The variable "state" has 2 categories (nc and sc).
# The variable "region" has 3 categories (1, 2 and 3).
# The sampling frame is stratified by region within state.
data=rbind(matrix(rep("nc",165),165,1,byrow=TRUE),matrix(rep("sc",70),70,1,
byrow=TRUE))
data=cbind.data.frame(data,c(rep(1,100), rep(2,50), rep(3,15), rep(1,30),rep
(2,40)),1000*runif(235))
names(data)=c("state","region","income")
# Computes the population stratum sizes
table(data$region,data$state)
# do not run
# nc sc
# 1 100 30
# 2 50 40
# 3 15 0
# there are 5 cells with non-zero values; one draws 5 samples (1 sample in
each stratum)
# the sample stratum sizes are 10,5,10,4,6, respectively
A*****a
发帖数: 1091
2
看了下这个完整的例子,他只是随意指定了size,来举例怎么使用strata这个命令罢了吧

Does
lot!
rep

【在 a****y 的大作中提到】
: I am trying to understand the sampling from the following description. Does
: anyone know how they get the sample stratum sizes: 10,5,10,4,6. Thanks a lot!
: Generates artificial data (a 235X3 matrix with 3 columns: state, region,
: income).
: # The variable "state" has 2 categories (nc and sc).
: # The variable "region" has 3 categories (1, 2 and 3).
: # The sampling frame is stratified by region within state.
: data=rbind(matrix(rep("nc",165),165,1,byrow=TRUE),matrix(rep("sc",70),70,1,
: byrow=TRUE))
: data=cbind.data.frame(data,c(rep(1,100), rep(2,50), rep(3,15), rep(1,30),rep

1 (共1页)
进入Statistics版参与讨论
相关主题
R: generate random number的问题[R] How to stratify data in R?
[合集] draw 10 random sample from a population use proc surveysele请教一个survey weight的问题
a R questionAsk a question about one sample test
讨教一下,Wilconxon test这样还能算Randomized sample吗
用SAS sampling的一个问题sampling weight variable怎么用到linear regression里啊?
样本数量问题求助急求 马上要选课了 谢谢各位大神
请问k-mean clust或decision tree或stratify sampling?onsite求建议呀
请问一个统计问题讨论一下,非独立sample的显著性比较
相关话题的讨论汇总
话题: rep话题: stratum话题: sampling话题: data话题: region