similar to: matching observations and ranking

Displaying 20 results from an estimated 1000 matches similar to: "matching observations and ranking"

2011 Aug 31
1
Recoding observations in all columns of a data frame.
Dear all, Suppose I have a data frame like this: [code] var1 <- c(1,999,2) var2 <- c(999,1,2) var3 <- c(1,2,999) example <- data.frame(var1,var2,var3) [/code] I want to replace all 999 to NA in all observations in all columns. I know how to do it in each individual column. [code] example$var1[example$var1==999] <- NA [/code] I think it can be done with a for loop. [code] for
2010 Jul 16
0
Effects library LSM decimal place errors
G'day, I'm?calculating LSM for the following model, and am finding that R and SAS give different answers. Whilst the error is at the second or third decimal, the percentage error can be quite large. I'm using the effects library (Version: 2.0-10) on R?2.11.1 in the following manner: options(contrasts=c("contr.helmert","contr.poly"))
2012 May 09
0
serie de tiempo incompleta: rellenar sólo fechas (claudiomet)
Hola.. yo lo haría de la siguiente manera ... En excel:genero una columna con la serie de fechas continuas ... con la función buscarv, agrego las variables que tienen dato a esta serie.. en base a la fecha muy largo y mecánico para mi gusto.... En R ..de igual manera genero el vector de fechas require(chron)# crear el vector continuo de fechasfch01 <- data.frame(''fch'' =
2011 Jan 19
3
lme-post hoc
Hi all, I analysed my data with lme and after that I spent a lot of time for mean separation of treatments (post hoc). But still I couldn’t make through it. This is my data set and R scripts I tried. replication fertilizer variety plot height 1 level1 var1 1504 52 1 level1 var3 1506 59 1 level1 var4 1509 54 1 level1 var2 1510 48 2 level1 var1 2604 47 2 level1 var4 2606 51 2 level1 var3
2006 Oct 23
1
Lmer, heteroscedasticity and permutation, need help please
Hi everybody, I'm trying to analyse a set of data with a non-normal response, 2 fixed effects and 1 nested random effect with strong heteroscedasticity in the model. I planned to use the function lmer : lmer(resp~var1*var2 + (1|rand)) and then use permutations based on the t-statistic given by lmer to get p-values. 1/ Is it a correct way to obtain p-values for my variables ? (see below)
2014 Aug 21
2
pregunta
Buenas noches Javier y José, Estoy en contra de usar attach(), asi que propongo la siguiente alternativa con with(): # paquete require(epicalc) # los argumentos en ... pasan de epicalc:::cc # ver ?cc para mas informacion foo <- function(var1, var2, var3, ...){ or1 <- cc(var1, var2, ...) or2 <- cc(var1, var3, ...) list(or1 = or1, or2 = or2) } # datos x <-
2012 Jul 01
2
list to dataframe conversion-testing for identical
HI R help, I was trying to get identical data frame from a list using two methods. #Suppose my list is: listdat1<-list(rnorm(10,20),rep(LETTERS[1:2],5),rep(1:5,2)) #Creating dataframe using cbind dat1<-data.frame(do.call("cbind",listdat1)) colnames(dat1)<-c("Var1","Var2","Var3") #Second dataframe conversion
2009 Sep 22
3
converting a character vector to a function's input
Hi all, I have been trying to solve this problem and have had no luck so far. I have numeric vectors VAR1, VAR2, and VAR3 which I am trying to cbind. I also have a character vector "VAR1,VAR2,VAR3". How do I manipulate this character vector such that I can input a transformed version of the character vector into cbind and have it recognize that I'm trying to refer to my numeric
2016 Apr 28
0
Antwort: RE: Interdependencies of variable types, logical expressions and NA
Hi your initial ds > str(ds) 'data.frame': 2 obs. of 3 variables: $ var1: num 1 1 $ var2: logi TRUE FALSE $ var3: logi NA NA first result > str(ds) 'data.frame': 2 obs. of 6 variables: $ var1 : num 1 1 $ var2 : logi TRUE FALSE $ var3 : logi NA NA $ value_and_logical: logi TRUE TRUE $ logical_and_na : logi TRUE NA
2011 May 19
2
trouble with summary tables with several variables using aggregate function
Dear all, I am having trouble creating summary tables using aggregate function. given the following table: Var1 Var2 Var3 dummy S1 T1 I 1 S1 T1 I 1 S1 T1 D 1 S1 T1 D 1 S1 T2 I 1 S1 T2 I 1 S1 T2 D 1 S1 T2 D 1 S2
2010 Jul 12
0
How do I convert a XML file to a data.frame?
Hi, I have a problem converting a XML file, via the XML package, to a data.frame. The XML file looks like this: <Transaction> <ID value="0044"/> <Var1 value="XYZ159"/> <Var2 value="_"/> <Var3 value="AMR1.0-INT-1005"/> <Var4 value="2010-05-25 10:44:16:673"/> <Var5 value="1"/>
2006 Jan 13
2
find mean of a list of timeseries
Can someone please give me a clue how to 're'write this so I dont need to use loops. a<-ts(matrix(c(1,1,1,10,10,10,20,20,20),nrow=3),names=c('var1','var2','var3')) b<-ts(matrix(c(2,2,2,11,11,11,21,21,21),nrow=3),names=c('var1','var2','var3'))
2006 Jan 11
1
updating formula inside function
Dear R-Helpers Given a function like foo <- function(data,var1,var2,var3) { f <- formula(paste(var1,'~',paste(var2,var3,sep='+'),sep='')) linmod <- lm(f) return(linmod) } By typing foo(mydata,'a','b','c') I get the result of the linear model a~b+c. How can I rewrite the function so that the formula can be updated inside the function,
2009 Nov 25
1
Sampling dataframe
Hi, I have a table like that: > datatest var1 var2 var3 1 1 1 1 2 3 1 2 3 8 1 3 4 6 1 4 5 10 1 5 6 2 2 1 7 4 2 2 8 6 2 3 9 8 2 4 10 10 2 5 I need to create another table based on that with the rules: take a random sample by var2==1 (2 sample rows for example): var1 var2 var3 1 1
2012 Jan 16
1
ggplot- using geom_point and geom_line at the same time
Hi I am plotting line chart using ggplot and want to use geom_line and geom_point simultaneously. I get the plot but now I have two legends. None of the legend is representing the true values. I need the legend with shape and color both. Thanks > con = textConnection("inputs var1 var2 var3+ 100 10 5 2+ 1000 20 10 4+ 5000 30 15 8+ 10000 40 20 16+ 30000 50 25 32")> data =
2012 Feb 15
2
assign same legend colors than in the grouped data plot
Dear community, I've plotted data and coloured depending on the factor variable v3. In the legend, I'd like to assign properly the same colors than in the factor (the factor has 5 levels). I've been trying this but it doesn't work. plot(var1, var2, xlab = "var1", ylab = "var2", col =var3 , bty='L') legend(locator(1),c("level 1 var3",
2003 Feb 01
1
matrix subscripts in replacement
I'm reluctant to draw the S-PLUS and R comparison (these are different programs after all), but could someone tell me why the following matrix substitution works in S-PLUS, but not R. I'm curious because matrix substitution is a really slick way to "cleaning up" columns of data in data frames. For example, in the following I change values of 1 to values of 10, but only for
2014 Apr 11
2
crear variable en base a nombre de columnas que tienen un 1
Carlos, en principio si sería algo así, sólo que en vez de quedarme con todas las columnas var1 a var4 tuviera sólo 3, ya que en mis datos no hay ningún caso que tenga el valor 1 en más de 3 variables.. Había llegado a una solución (mucho menos elegante que usando reshape), que implicaba un for sobre las filas. Jorge, creo que tu solución me vale. Muchas gracias a los dos.. Saludos El
2008 Sep 30
0
calculating weighted correlation coefficients
Dear Help, I'm trying to calculate a weighted correlation matrix from a data frame with 6 columns (variables) and 297 observations extracted from the regression. The last column is a weight column which I want to apply. $ model :'data.frame': 297 obs. of 6 variables: ..$ VAR1 : num [1:297] 5.21 9.82 8.08 0.33 8.7 6.82 3.94 4 0 5 ... ..$ VAR2 : num [1:297]
2011 Jan 23
3
FUNC_ODBC and ARRAY
Gentlemen, I have googled, searched the mailing list archives, and even spoke on the IRC channel, but have not found an answer to the following problem. I am attempting to retrieve multiple columns in an ODBC query using ARRAY per the solutions offered by many individuals. My dialplan code is as follows: exten => _.,n,Set(ARRAY(var1,var2,var3)=${ODBC_LOOKUP(${KEYVAL})}) exten =>