注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

零售创新,创新那些事儿,SPSS,VBA

零售创新

 
 
 

日志

 
 
关于我

新浪微博,零售创新 研究经理,数据分析师 希望和市场研究和零售业的同事共同进步! 本博客发表的都是免费或试用的资料,如果有版权问题请发邮件wangli12a@163.com联系删除。 spss excel vba blog

网易考拉推荐

"comp.soft-sys.stat.spss" google group classes  

2010-08-24 18:21:43|  分类: spss学习 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

  "comp.soft-sys.stat.spss" google group classes

 

*I would like to randomly select x number of  cases per city (e.g.,
30). However, I do not want to select more than one case from a
specific ID and I would like to ensure that I obtain close to an equal
# of cases for each condition (e.g., 10 cases from each condition for
each city).
*1. Compute a random variable X.
*2. Sort by ID then X.
*3. Keep only the first case within each ID--this will give you one
(pseudo) randomly chosen condition per ID.
*4. You may want to recompute random variable X.
*5. Sort by city then X.
*6. Keep only the first N cases within each city.

*If someone is missing the point of "may want to" --
omitting (4) will have the consequence of biasing the
selection towards the IDs with greater Ns.  I don't know
if that gives a result  'proportional to N'  -- if that were
the desired result.  For randomization by IDs with equal
chances, there is no need to do any randomization before
doing that first sort.

*That request for an "equal number of cases for each condition"
could be complicated to *define* what is intended, if
squeezing each ID to a single occurrence reduces what is
available by too much. *

data list list/ID  Condition  City.
begin data.
1        1           1
1        2           1
1        3           1
2        1           1
2        2           1
2        3           1
3        1           1
3        2           1
3        3           1
end data.

  评论这张
 
阅读(499)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017