由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - data grouping, sub-grouping by column variable in R
相关主题
[合集] how to calculate column sum not row sum in SAS? thanks a loSAS question - baozi
怎样用R定位变量的位置弱问一个SAS里面求adjusted means的问题
请教一个sas编程问题我也来请教一个SAS问题
SAS question: count non-missing value for different variableshow to interprete the factor in factor anlaysis
[合集] How to specify a variable as missing菜鸟继续请教TRIM
[合集] └ Re: 关于stepwise programming请教一个proc transpose的问题
A SAS questionAnother SAS question
请教SAS LABEL问题。[合集] Need help on data manipulation, thanks a lot!
相关话题的讨论汇总
话题: var1话题: var2话题: grouping话题: 498455话题: 357835
进入Statistics版参与讨论
1 (共1页)
l******9
发帖数: 579
1
I am working on data collection by R on Win7.
The given data is:
var1 var2 value
I need to do grouping by var1 and then for each var1 , do grouping by var2.
Then, the output is column vectors of values that are associated with the
same var1 and var2. Here, var1 and var2 are like keys.
Example,
var1 var2 value
1 56 649578
2 17 357835
1 88 572397
2 90 357289
1 56 427352
2 17 498455
1 88 354623
2 90 678658
The result should be
var1 var2 value
1 56 649578
1 56 427352
1 88 354623
1 88 572397
2 17 357835
2 17 498455
2 90 357289
2 90 678658
And, I need to print the values in a csv file as
For var 1 as 1:
649578 354623
427352 572397
For var 1 as 2:
357835 357289
498455 678658
And, I also need to print the values in a csv file as
For var 1 = 1:
1 56 649578
1 56 427352
1 88 354623
1 88 572397
For var1 = 2:
2 17 357835
2 17 498455
2 90 357289
2 90 678658
How to do it ?
I found some posts, which are not directly useful.
Any help would be appreciated.
c********h
发帖数: 330
2
order() in R could handle ordering several variables
1 (共1页)
进入Statistics版参与讨论
相关主题
[合集] Need help on data manipulation, thanks a lot![合集] How to specify a variable as missing
SAS问题来了[合集] └ Re: 关于stepwise programming
sas proc report的问题A SAS question
SAS问题请教SAS LABEL问题。
[合集] how to calculate column sum not row sum in SAS? thanks a loSAS question - baozi
怎样用R定位变量的位置弱问一个SAS里面求adjusted means的问题
请教一个sas编程问题我也来请教一个SAS问题
SAS question: count non-missing value for different variableshow to interprete the factor in factor anlaysis
相关话题的讨论汇总
话题: var1话题: var2话题: grouping话题: 498455话题: 357835