similar to: applying quantile to a list using values of another object as probs

Displaying 20 results from an estimated 4000 matches similar to: "applying quantile to a list using values of another object as probs"

2010 Nov 26
2
get list index
Hi R-users, I have a list mylist <- list(c(0.79, 0.92, 0.91, 0.86, 0.96, 0.96, 0.95, 0.94, 0.99), c(0.28, 0.45, 0.59, 0.69, 0.80, 0.87, 0.95, 0.94, 0.98), c(0.29, 0.39, 0.59, 0.69, 0.68, 0.80, 0.93, 0.95, 0.98)) Is there a way to find the index of the list element that contains the lowest value among all the other elements? As the lowest value in each element is the first, the
2010 Sep 22
3
extracting random effects from model formula
Hi R-users I would like to extract the random effects ("1|SITE", "1+SPECIES|SITE" and "BA|SITE") from this model formula: Full_model <- formula (VAR ~ (1|SITE) + (1+SPECIES|SITE) + (BA|SITE) + HEIGHT + COND + NN_DIST) I tried: terms(Full_model) labels(terms(Full_model)) but I could not distinguish between random and fixed effects. thanks
2010 Jul 13
2
modifying vector elements
Hello R-users, I have a very large vector (a) containing elements consisting of numbers and letters, this is the i.e. a [1] "1.11.2a" "1.11.2d" "1.11.2e" "1.11.2f" "1.11.2x1" "1.11.2x1b" [7] "1.11.2x2" "1.11.2x2a" "1.11.2x2b" "1.11.2x3" "1.11.2x4"
2010 May 16
1
problems with generation of quantiles under For ()
Dear, I want to make an application to calculate quantile within a For() I tried the following without success: ej. date p_val <- matrix(sample(10, 1000, replace=TRUE), 200,5) test 1 rr <- paste("p_val$",names(p_val[1]), sep="") quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)/100, na.rm=FALSE, type=1) test 2 rr <-
2011 Aug 25
2
string manipulation
I R-users, I am trying to find the way to manipulate a character string to select a 4 digit number after some specific word/s. Example: mytext <- "I do not want the first number 1234, but the second number 5678" Is there any function that allows you to select a certain number of digits (in this case 5678) after a particular word/s (e.g., second number) Thank you for your help
2010 Sep 27
3
name ONLY one column
Hi R-users I can not change the name of one column only of my matrix. my_matrix <- matrix (1:12,ncol=3) colnames(my_matrix)[1] <- 'myname' Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent thank you for your help Lorenzo [[alternative HTML version deleted]]
2010 Aug 11
2
storing the results of an apply call
Hi R-users, I have a function (myfun) that I want to apply to the rows of a matrix. Basically, "myfun" takes the values from the matrix ("exp.des"), which represent the different combinations of my experimental design, and pass them as arguments to some other functions (fun1 and fun2). As I want to replicate the results of fun1 and fun2 a certain number of time (e.g. 5), I
2007 Feb 05
3
Confidence intervals of quantiles
Can anyone please tell me if there is a function to calculate confidence intervals for the results of the quantile function. Some of my data is normally distributed but some is also a squewed distribution or a capped normal distribution. Some of the data sets contain about 700 values whereas others are smaller with about 100-150 values, so I would like to see how the confidence intervals change
2010 Nov 03
2
memory allocation problem
Hi R users I am trying to run a non linear parameter optimization using the function optim() and I have problems regarding memory allocation. My data are in a dataframe with 9 columns. There are 656100 rows. >head(org_results) comb.id p H1 H2 Range Rep no.steps dist aver.hab.amount 1 1 0.1 0 0 1 100 0 0.2528321
2012 Jun 07
1
Quantile regression: Discrepencies Between optimizer and rq()
Hello Everyone, I'm currently learning about quantile regressions. I've been using an optimizer to compare with the rq() command for quantile regression. When I run the code, the results show that my coefficients are consistent with rq(), but the intercept term can vary by a lot. I don't think my optimizer code is wrong and suspects it has something to do with the starting
2011 Feb 02
2
automatic coercion to character
Hi R users I am wondering how I can avoid automatic coercion of my numeric vector elements to character init <- c(age='N', R=as.numeric(0.5), S=as.numeric(0.8)) I have used as.numeric() but it does not seem to work Thank you Lorenzo [[alternative HTML version deleted]]
2010 Oct 05
2
accessing elements located after $ symbol
Hi R-users I am having troubles accessing elements after the $ symbol. Reproducible example: >test <- data.frame (first=1:10, second=11:20, third=21:30) >test$first #this works fine but when I try >interest <- "first" >test$interest # does not seem to work Could you tell me why that happens and show how to do instead? Thanks so much Lorenzo
2001 May 09
7
R-Quant
Greetings, Does anyone know if R-Quant, http://www.smartquant.com/ an outgrowth of the statistical package "R"? Bill Vedder -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the
2011 Apr 05
1
do not execute newline command
Hi R-users, To automate the creation of scripts, I converted the code (example below) into a character string and wrote the object to a file: Repeat <- " myvec <- c(1:12) cat('vector= ', myvec, '\n') " write (Repeat, 'yourpath/test.R') the problem is that one line of the code is a "cat" command. In the output file (i.e. test.R), the newline
2011 May 05
1
lapply, if statement and concatenating to a list
Hi R users I was wondering on how to use lapply & co when the applied function has a conditional statement and the output is a 'growing' object. See example below: list1 <- list('A','B','C') list2 <- c() myfun <- function(x,list2) { one_elem <- x cat('one_elem= ', one_elem, '\n') random <- sample(1:2,1) show(random)
2005 Aug 05
1
contrast {Design} question
All, I have been trying to get the following code to work: A.quantiles <- quantile(foo.frame$A, probs = seq(from = 0.05, to = 0.95, by = 0.05)) base.quantiles <- quantile(Efficacy205$BASELINE_RANK, probs = seq(from = 0.05, to = 0.95, by = 0.05)) gender <- levels(Efficacy205$GENDER) contrast.1 <- contrast(Model.1, list(TPCODE= 'A', AGE =
2008 Sep 23
1
quantile regression: plotting coefficients on only one variable (rq)
Dear all. I have a question on plotting the coefficients from a series of mutivariate quantile regressions. The following code plots the coefficients for each RHS variable x1 and x2. Is there a way to plot only the coefficients on x1? In the data I am using, I have a large number of fixed effects and do want to plot the coefficients on these fixed effects. quant.plot <-
2010 Oct 18
1
paste an unevaluated expression
Hi R-users, I would like to create an expression without evaluating it. Then paste that expression to an object. Example: Result <- paste('Result', 1, sep="") paste(Result, substitute(apply(exp.des[1:10,], 1, one.row, parms=parameters)), sep="<-") However this pastes EACH element of the unevaluated expression. Instead I just would like the expression
2004 May 07
1
Quantile of a function
I have a simple doubt: I have a function, say: test <- function (theta) { return (theta^2) } I can use: integrate (test,0,1) to obtain the area under de function. Can I do the opposite? I`d like to give the lower limit and the area I need as arguments, in order to get the upper limit. In other words, I`d like to obtain the quantile of the function (the lower limit could be 0, for example).
2010 Oct 23
1
bind matrices by row
Hi R-users I have a series of matrices and I would like to bind them together by column using a loop (i.e. not writing cbind(matrix1, matrix2,matrix3....)). The reason is because in my real data set I have a very large number of matrices. Example: matrix1 <- matrix (1:12,4,3) matrix2 <- matrix (13:24,4,3) matrix3 <- matrix (25:36,4,3) matrix4 <- matrix (37:48,4,3)