Displaying 20 results from an estimated 100000 matches similar to: "sorting the data~"
2008 Jun 04
2
linear model in the repeated data type~
here is the data:
y<-c(5,2,3,7,9,0,1,4,5)
id<-c(1,1,6,6,7,8,15,15,19)
t<-c(50,56,50,56,50,50,50,60,50)
table1<-data.frame(y,id,t)//longitudinal data
what I want to do is to use the linear model for each id ,then get the
estimate value,like:
fit1<-lm(y~t,data=table1,subset=(id==1))
but ,you can see the variable "id" is quite irregular,they are not arranaged
in order
2009 Mar 04
5
how to create many variables at one time?
Hi:
I need to create many variables at one time,how to do this in R?
for eg ,X1,X2.......X100?
Thanks~
[[alternative HTML version deleted]]
2005 Oct 16
3
Sorting a data frame by one of the variables
Dear all,
I have a date frame like this:
X Y Z
22 24 4.3
2.3 3.4 5.3
.....
....
57.2 23.4 34
What my purpose is: to sort the data frame by either X, Y or Z.
sample output is (sorted by X) :
X Y Z
2.3 3.4 5.3
.....
......
22 24 4.3
...
57.2 23.4 34
I have no idea how to use sort, order or rank functions. Please help me out.
Thanks!
Leaf
2008 Jun 04
3
create many variables at one time~
I need to create 100 variable ,whose name is id.1,id.2~~~~id.100
then I need to let a vector say id<-c(id.1,id.2....id.100)
any easy way to do this?
thanks a lot~
[[alternative HTML version deleted]]
2008 Jun 19
1
try to find the MLE of a function
Hi everyone:
I have a density function f(x|theta)=theta*x^(theta-1),where
0<x<1,0<theta<infinite
I want to pratice on R to find the MLE of this function,here is my code:
x <- (0:10)/10
f<-function(theta) prod(theta*x^(theta-1))
mle(f)
and r gave me :Error in eval(expr, envir, enclos) : argument is missing,
with no default
what mistake I just made?and how to add a
2008 Jun 18
3
multiple multiplication in R
hi: just a very simple quesion,how to do multiple multiplication in R
x<-c(1,2,3,4,5,6)
how to get 1*2*3*4*5*6?
I checked the Arithmetic Operators in R,but did not found the operators
for this function,anyway can do this except the loop?
[[alternative HTML version deleted]]
2006 May 22
2
sort the values of members and obtain their ranks within groups
Dear all,
I would like to sort the values of "member" for each group, and obtain a
variable to indicate its rank within the group.
For example, we have original dataset as follows:
df <- data.frame(group = c(rep(1, 3), rep(5, 3)),
member = c(30, 10, 22, 21, 44, 15))
group member
1 1 30
2 1 10
3 1 22
4 5 21
5 5 44
6 5 15
After
2008 Jun 04
1
how to extract a specific group of data from a table?
a table with three varialbe:treatment
(low,high),size(large,small),response y
I want all response y with treatment=low and size=large,
I try to write as :
treatment<-c("low","low","high","high")
size<-c("small","large","small","large")
y<-c(1,2,4,5)
table1<-data.frame(treatment,size,y)
2008 Jun 04
1
linear model with the repeated data type~
here is the data:
y<-c(5,2,3,7,9,0,1,4,5)
id<-c(1,1,6,6,7,8,15,15,19)
t<-c(50,56,50,56,50,50,50,60,50)
table1<-data.frame(y,id,t)//longitudinal data
the above is only part of data.
what I want to do is to use the linear model for each id ,then get the
estimate value,like:
fit1<-lm(y~t,data=table1,subset=(id==1))
but ,you can see the variable "id" is quite
2009 Mar 10
5
Cholesky Decomposition in R
Hi everyone:
I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I
only found how to decomposite A in to LL' by using chol(A),the function
Cholesky(A) doesnt work,any one know other command to decomposte A in to
LDL'
My r code is:
library(Matrix)
A=matrix(c(1,1,1,1,5,5,1,5,14),nrow=3)
> chol(A)
[,1] [,2] [,3]
[1,] 1 1 1
[2,] 0 2 2
2007 Apr 20
2
sorting data in R
hello,
I'd like know how to sort a data frame in R for example how I should do to sort by Catholic with swiss data frame like below
thanks
Fertility Agriculture Examination Education Catholic Infant.Mortality
Courtelary 80.2 17.0 15 12 9.96 22.2
Delemont 83.1 45.1 6 9 84.84 22.2
2007 Dec 06
1
finding most highly transcribed genes - ranking, sorting and subsets?
Hello,
I am not only interested in finding out which genes are the most highly up-
or down-regulated (which I have done using the linear models and Bayesian
statistics in Limma), but I also want to know which genes are consistently
highly transcribed (ie. they have a high intensity in the channel of
interest eg. Cy5 or Cy3 across the set of experiments). I might have missed
a straight forward
2011 Jun 07
1
Sorting a data frame with values of different lengths
Hi all,
I am attempting to run a script in which I permute my data and run a
Wilcoxon rank sum test on the data 1000 times and compare my original test
statistic to the permuted test statistics to more accurately estimate a
significance level for the trends I am observing.
In the process of doing this, I need to sort a data frame that measures 3 x
1001 based on the value of the test statistic
2005 Jul 08
1
Suggestion: Help users sort data frames
I've noticed that a frequently asked question on R-help is how to sort a
data frame by multiple columns. Since this question is asked so often,
making this task easier for users seems a worthwhile goal.
At a minimum, the following changes to the documentation would surely be
helpful and reduce email postings to R-help:
1. In the "See Also" section of the help page for
2008 Jun 05
1
quite complicated case(the repeated data arranage~)
Hi everyone:
I have been struggling with this repeated data type for whole afternoon,I
sent two emails to server for help,many people kindly responded , hereby
thank you so much,but since I dont want to write to much in email,so I
divide the problem in parts,so far this seem did not work out very well,so
this is my whole problem~
first I have example of data here:
2006 Apr 16
6
sorting
I need to sort users by their rank how do I do this?
--
Posted via http://www.ruby-forum.com/.
2002 May 06
3
function sort.list()
Derar R-people
I have troubles understanding what the function sort.list() is doing. On
the homepage it says that it returns a permutation which rearranges a
vector into ascending or descending order (like order() but on a vector
instead of a sequence).
> sort.list(c(0, 2, 10, 11, 4))
[1] 1 2 5 3 4
which does not make sense to me.
In fact I am getting the same (non-sensical) result using
2010 Feb 22
2
Siegel-Tukey test for equal variability (code)
Hi, I recently ran into the problem that I needed a Siegel-Tukey test for
equal variability based on ranks. Maybe there is a package that has it
implemented, but I could not find it. So I programmed an R function to do
it. The Siegel-Tukey test requires to recode the ranks so that they express
variability rather than ascending order. This is essentially what the code
further below does. After the
2011 Aug 05
2
[?]apply functions or for loop
Hello,
First time posting to this mail list.
I'd like to use R in the most efficient way. I'm accomplishing what I want,
but feel there is a more R'ish way to do it. Just learning R.
*My goal: get ranks of value across rows with row names and column names
intact.*
I'm guessing one of the [?]apply functions will do what I need, but I
couldn't sort out which one (after a lot
2003 Jul 22
1
rank with ties
Hi,
Is there a function like rank but that solves the ties by randomly assigning
a value (doesn't average ranks of ties).
This is what I actually need:
I want to make NA all elements of each column in an array that are ranked in
a position larger that rankmax for each column.
# Say I've got an array b:
b<-cbind(c(1:5,5:1),c(1,12,14,2,5,4:8))
#> b
# [,1] [,2]
#[1,] 1 1