全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
836 0
2014-04-18

I have response data by market in the format:

head(df)    ID  market  q1  q2    470 France  1   3    625 Germany 0   2    155 Italy   1   6    648 Spain   0   5    862 France  1   7    699 Germany 0   8    460 Italy   1   6    333 Spain   1   5    776 Spain   1   4

and the following frequencies:

table(df$market)    France  140    Germany 300    Italy   50    Spain   75

I need to create a data frame with a sample of 100 responses per market, and all responses without replacement in cases when there's less than 100 of them.

so

table(df_new$market)        France  100        Germany 100        Italy   50        Spain   75

Thanks in advance!


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群