similar to: help with median for each row

Displaying 20 results from an estimated 10000 matches similar to: "help with median for each row"

2009 Jun 26
2
Indexing a list with a list
Dear list, I have two lists: one with data and one with TRUE/FALSE values for data I want to further analyze (see example below). I have been able to use a for loop to extract the data that I want to keep, but think that there probably exists a way to do it without a loop. Any ideas? #sample data set.seed(100) example = list(letters[1:10], letters[1:10], letters[1:10]) ind =
2010 Jan 05
2
Fast nested List->data.frame
I have very large data sets given in a format similar to d below. Converting these to a data frame is a bottleneck in my application. My fastest version is given below, but it look clumsy to me. Any ideas? Dieter # ----------------------- len = 100000 d = replicate(len, list(pH = 3,marker = TRUE,position = "A"),FALSE) # Data are given as d # preallocate vectors pH =rep(0,len) marker
2009 Jul 08
2
Simple monovariate classification?
I'm looking for an R function that simply recodes a quantitative variable into a number of classes according to specified break-points. Obviously I can do this using nested ifelse() commands, but I want to write it into a function where I can't pre-specify the number of classes. Is there an obvious way to do this? An example to clarify: how to convert c(0,10,5,1,9,6) to
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A 11/12/2009 4 B 11/11/2009 7 B 11/13/2009 8 >From that I need to generate all permutations of Factor1 and Factor2 and force a 0 for any combination that doesn?t
2011 May 13
1
period in scale parameter of prcomp
Hi all, Looking at the help file for prcomp and the code in stats:::prcomp.default, the scale parameter for the default S3 method has a trailing period: it written as scale. I assume there is a reason for it (backwards compatibility with S was suggested) but I thought I'd ask. Thanks, Greg -- Greg Hirson ghirson at ucdavis.edu Graduate Student Agricultural and Environmental Chemistry
2009 Jul 10
2
to get the R-Squared value
Dear all, I know there are 'coef', 'predict', 'fit' to get the corresponding outputs. Is that possible to get the value of R-squared from a 'lm' output? Many thanks.
2009 Sep 08
1
Plotting two qqnorm plots:
Hi all, Does anyone know how to plot overlapping qqnorm plots on the same window? Suppose I have data in the vector x and y: qqnorm(x) lines(qqnorm(y)) I though these two lines will do the job... However, lines doesn't seem to work. Anyways, thanks in advance! -- View this message in context: http://www.nabble.com/Plotting-two-qqnorm-plots%3A-tp25352893p25352893.html Sent from the R help
2010 Feb 18
1
Shapiro-Wilk test problem
Hi everybody, Does anyone know what problem may be with this test. I am applying 5 different normality tests and use p-values for them, but for some reason S-W gives me NA, while sample size is 100. Any ideas? Thanks a lot! [[alternative HTML version deleted]]
2011 May 16
1
help: Using hotelling for a confidence region for PCA scores
Hello everyone. In my last post I did not explained my problem quite well. I made a principal component analysis and took the 2 first principal components. I made ​​a chart of my points based on the score of the 2 PC. I would like to add on this graph a 95% confidence region. To do this I used the ellipse function as follows: pcsref=PC$score[data[,1]==ref,1:2] #matrix containing the scores
2010 Jan 09
3
string functions
Hi! Does anybody know a string function that would calculate how many characters two strings share? I.e. ("Hello World","Hello Peter") would be 7. Thanks. Laetitia
2010 Mar 18
5
can I rotate a matrix
useR's, I want to be able to rotate a matrix 90 degrees, clockwise. For example, > mat [,1] [,2] [,3] [,1] 1 2 1 [,2] 3 2 6 [,3] 4 5 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3] [,1] 4 3 1 [,2] 5 2 2 [,3] 3 6 1 Does anyone know a quick and straightforward way to do this? Thanks in advance. -- View
2009 Sep 28
5
R and REST API's
Hi - Many organizations now make their data available as XML via a REST web service architecture. Is there any R package or facility to access this type of data directly (eg, to make the HTTP GET request and have the downloaded data put into an R data frame)? I used several R search sites to look for an answer, but came up with very little. Any help would be appreciated. Thanks very much. Gary
2010 Jan 13
3
counting the number of times a string appears
Hi all, I have a vector of strings and need to count the number of times a string appears in the vector. eg: [1] spp6 spp10 spp6 spp6 spp4 spp2 spp9 spp10 spp5 spp2 spp2 spp3 [13] spp4 spp3 spp6 spp10 spp6 spp4 spp9 spp3 spp6 spp1 spp10 spp8 [25] spp2 spp10 spp9 spp7 spp1 spp3 spp8 spp6 spp3 spp8 spp6 spp5 [37] spp5 spp9 spp3 spp1 spp4 spp5 spp9 spp3
2009 Sep 09
3
Help on percentage of random numbers for different classes
R-list   I am sorry for asking this stupid question, but i have been running in circles. I want to randomly generate a scaling point of between 1 and 10, for say hundred entries, where the first 10% percent is has rates between 2 and 7, the next 15% 3 and 7, 20% between 3 and 9, 20% between 3 and  10, 35% between 5 and 10. The problem is that i can only generate the usual 100 using runif function
2009 Jul 01
3
is there a way to extract fata from web pages through some R function ?
I deal with a huge amount of Biology data stored in different databases. The databases belongig to Bioconductor organization can be accessed through Bioconductor packages. Unluckily some useful data is stored in databases like, for instance, miRDB, miRecords, etc ... which offer just an interactive HTML interface. See for instance http://mirdb.org/cgi-bin/search.cgi,
2009 Dec 21
2
Reading multiple Input Files
Dear R helpers,   Suppose I am dealing with no of interest rates at a time and the no of interest rates I am selecting for my analysis is random i.e. it can be 2, can be 10 or even higher. The R-code I had written (with the guidance of R helpers obviously and I am really grateful to all of you) as of now is sort of hard coding when it comes to reading interest rates as an input e.g.   ## INPUT  
2010 Mar 30
2
weighted.median function from package R.basic
Dear all, I want to apply a weighted median on a huge dataset, and I remember a function from the package R.basic that could do this using an internal sorting algorithm qsort. This speeded things up quite a bit. Alas, I can't find that package anywhere anymore. There is a weighted.median function in the package limma too, but I didn't use that before. Anybody who knows what happened to
2002 Feb 06
4
Weighted median
Is there a weighted median function out there similar to weighted.mean() but for medians? If not, I'll try implement or port it myself. The need for a weighted median came from the following optimization problem: x* = arg_x min (a|x| + sum_{k=1}^n |x - b_k|) where a : is a *positive* real scalar x : is a real scalar n : is an integer b_k: are negative and positive scalars
2003 Jul 24
2
median and joint distribution
Dear R-"helpers"! May I kindly ask the pure statistics-experts to help me for a purpose which first part is not directly concerned with R. Consider two distribution functions, say f and g. For both, the median is smaller than a half. Now, the multiplicative or additive linkage of both distribution leads to a new distribution function, say h, whereas the median of h is greater than a
2010 Apr 06
1
median of two groups
Dear all, What is the right test to test whether the median of two groups are statistically significant? Is it the wilcox.test, mood.test or the ks.test? In the text book I have got there is explanation for the Wilcoxon (Mann Whitney) test which tests ob the two variable are from the same population and also ks.test! Regards, Cheba [[alternative HTML version deleted]]