search for: variable2

Displaying 20 results from an estimated 60 matches for "variable2".

Did you mean: variables
2010 Feb 26
3
Preserving lists in a function
...sts in its defaults. However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R: myfunction=function( list1=list (variable1=1, variable2=2, variable3=3), list2=list (variable1="variable1", variable2="variable2", variable3="variable3"), list3=list (variable1="character", variable2=24, variable3=c(0.1,0.1...
2012 Jan 02
4
Create variable with AND IF statement
Hello, I'm using SPSS at work but really would like to switch to R. Right now I'm trying to learn R in reproducing calculations I did with SPSS but am stuck with something that is quite simple and comprehensible in SPSS-Syntax: IF (variable1.fac = 0 AND variable2.num = 0) variable3=1. IF (variable1.fac = 0 AND variable2.num >= 1) variable3=2. IF (variable1.fac = 1 AND variable2.num = 0) variable3=3. IF (variable1.fac = 1 AND variable2.num >= 1) variable3=4. I want to create four different groups out of different conditions of two variables: * varia...
2009 Jul 30
3
What is the best method to produce means by categorical factors?
...eplicate some of my experience from SAS in R and assume there are best methods for using a combination of summary(), subset, and which() to produce a subset of mean values by categorical or ordinal factors. within sas I would write proc means mean data=dataset; class factor1 factor2 var variable1 variable2; RUN; producing an output with means for each variable by factor groupings as below: *factor1 factor2 obs variable mean* Level A treatmentA 3 variable1 10 variable2 22 treatmentB 3...
2012 Feb 20
0
repeating or looping within an apply statement to handle multiple variables
Dear R experts, I would like to please ask for your help with repeating steps in an apply statement. I have a dataframe that lists multiple variables for a given id and visit, as well as drug treatment. > head(exp) id visit variable1 variable2 variable3 variable4 drug 1 3 1 13 10 7 11 0 2 3 5 10 15 9 9 0 3 3 12 9 10 8 8 0 4 7 1 12 8 9 8 1 5 7 5 16 9 3 10...
2006 Jul 03
1
analogue of group option of SAS MIXED/random in R
Dear list, I am trying to use lme to build the analogue of the following SAS MIXED random specification: random int+Variable1+Variable2 /subject = Subject group=Condition type=vc; which gives a Condition-blocked heterogeneity in the random effects variance-covariance matrix. Needless to say, I have a hard time in specifying Condition-specific heterogeneities in the variance-covariance parameters. I initially tried the following...
2012 Jan 17
2
result numeric(0) when using variable1[which(variable2="max(variable2)"]
...h(results5$R2 == "0.6081547")] # nor results5$Cvalue[which(results5$R2 == "max(results5$R2)")] # works? I hope someone can help me with this problem Kind regards Nerak -- View this message in context: http://r.789695.n4.nabble.com/result-numeric-0-when-using-variable1-which-variable2-max-variable2-tp4302887p4302887.html Sent from the R help mailing list archive at Nabble.com.
2011 Apr 18
4
altering identity column
...e greater than or equal to 60,001 regarding the very first identity column. So I have a transformed dataframe now including 10,000 obeservations (from 60,001 - to 70,000) and if you send "head(transformed_dataframe)" into R it looks like this: variable1 variable2 variable3 variable4 ... 60 001 ... ... ... ... 60 002 ... ... ... ... 60 003 ... ......
2011 Apr 07
3
Correlation Matrix
...straight forward to build a correlation matrix of an entire data frame. I simply use the command cor(MyDataFrame). However, what I would like to do is construct a smaller correlation matrix using just three of the variable out of my data set. When I run this: cor(MyDataFrame$variable1, MyDataFrame$variable2,MyDataFrame$variable3) I get an error. Is there a way to do this through a built in function or is this something I have to construct manually? Thanks [[alternative HTML version deleted]]
2009 Dec 04
2
Multiple Channel Variables with AMI Originate
Hi guys I seem to be having a problem, I don't know if it's a bug or whether I'm just doing it incorrectly. I want to set about 3 channel variables when I originate a call via AMI. All the documentation I have found says to do it like this: Variable: variable1=value|variable2=value|variable3=value However when I do this it runs them all together and I end up with: variable1 = "value|variable2=value|variable3=value" Instead of: variable1 = "value" variable2 = "value" variable3 = "value" So I think the delimi...
2012 Jul 09
4
Skipping lines and incomplete rows
I have a text file that has semi-colon separated values. The table is nearly 10,000 by 585. The files looks as follows: ******************************************* First line: Skip this line Second line: skip this line Third line: skip this line variable1 Variable2 Variable3 Variable4 Unit1 Unit2 Unit3 10 0.1 0.01 0.001 20 0.2 0.02 0.002 30 0.3 0.03 0.003 40 0.4 0.04 0.004 *****...
2006 Sep 24
2
printing a variable name in a for loop
Hello, How do you print a variable name in a for loop? I'm trying to construct a csv file that looks like this: Hello, variable1, value_of_variable1, World, Hello, variable2, value_of_variable2, World, Hello, variable3, value_of_variable3, World, Using this: for (variable in list(variable1, variable2, variable3)){ cat("Hello,", ???variable???, variable, ", World,") } This works fine if I'm trying to print the VALUE of variable, but I w...
2009 Jan 29
1
Multiple tables
Dear list, I have a set of 100+ variables. I would like to have one by one crosstables for each variable. I started with table(variable1, variable2) table(variable1, variable3) table(variable1, variable4) ... table(variable2, variable3) table(variable2, variable4) ... It seems rather tedious. Any better ideas around? Thanks for any help! Gerit -- NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL f?r nur 16,37 EURO/mtl.!* http://ds...
2010 Feb 08
2
the hat ^ in regular expression
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100208/52a6d080/attachment.pl>
2010 Dec 15
1
lmList and lapply(... lm) different std. errors
Am I trying to perform multiple linear regressions on each 'VARIABLE2'. I figured out that there are different ways, using the following code: (data is given at the end of this message) reg <- lapply(split(TRY, VARIABLE2), function(X){lm(X2 ~ X3, data=X)}) lapply(reg, summary) Which produces the following: $`1` Call: lm(formula = X2 ~ X3, data = X)...
2009 Dec 01
3
Using two (...) in a function
...t would came the first (...) Vec <- matrix(c(...)) for (i in seq(along <- Vec)){ caracteristica <- Vec[i] varF <- if (caracteristica == "DAP") var1 else var2 ##here I would like to do something like #if ###caracteristica == variable1) variance1 else if (caracteristica == variable2) variance2 else ... } } but to turn this in a function, I would like to replace ("DAP", "ALT") by any variable and var1, var2 to any variance, and not only necessary 2, for example data ("variable1","variable2","variable3", "variance1", &...
2010 Sep 01
8
how to replace NA with a specific score that is dependant on another indicator variable
...but I’m sure there most be a neater, better way of doing it. Any ideas at all will be much appreciated, I’m dreading coding up all those if statements!!!!! My problem is as follows: I have a data set with lots of missing data: EG Raw Data Set Category variable1 variable2 variable3 1 5 NA NA 1 NA 3 4 2 NA 7 NA etc Now I want to replace the NA’s with the avera...
2007 Jun 13
3
Awk and Vilno
...s, the statistical programmer needs to merge and re-merge multiple input files countless times. A syntax for merging files that is clear and concise is very important for the statistical programmer's productivity. Here is how Vilno does it: inlist dataset1 dataset2 dataset3 ; joinby variable1 variable2 where ( var3<=var4 ) ; Each column in a dataset has a variable name ( variable1, variable2, var3, var4 ). You are merging three input datafiles: dataset1, dataset2, and dataset3. The joinby statement asks for a many-to-many join, rather like the SQL SELECT statement. [ The mergeby statement as...
2008 Mar 10
1
state space model for poisson distribution
...arameters. I just wanted to remove two of the lag on response in the model and put it as a system model. I am not sure about the codes to combine these two on R. If anybody has any R example (code), please post it. My original model: log(Y(t))~constant+b1*Y(t-1)+b2*Y(t-2)+b3*(variable1)+b4*(variable2)+e I would like to construct a model: log(Y(t))~constant+b1*(variable1)+b2*(variable2)+X(t) X(t)~phi1*Xt-1+phi2*Xt-2+error where X(t) is the autoregressive lag effect of response. A.K. --------------------------------- [[alternative HTML version deleted]]
2008 May 05
1
Is there any way to find out how a certain functions are implemented in R?
...self. Is there any way that I can get the actual codes that implement functions in R so that I can translate them into other languages? For example, after I generate bootstrap samples in C, I want to simplify the new dataset just like I did it in R using "aggregate(data$variable1, list(data$variable2,data$variable3), length) or aggregate(data$variable1, list(data$variable2,data$variable3), sum) etc". How could I do that in C and is there any way to find out how it is implemented in R? Thank you. Kyeongmi Univ. Memphis
2002 Jan 14
1
newbie: table,mean for all variables
Hello, (1) what is the way to use table for the hole dataSet ? I would get a cross-table with x1 and other variables in the dataSet which have got 100 columns : table(x1,data[variable2 until variable 100])/length([variable2 until variable 100])*100 like this but it's wrong ? table(x1,data[,2:100])/length(data[,2:100])*100 if i type: table(data[,1:10]) to get the frequency distribution of the first 10 variables , i get not the wished tables ? (2) is it possib...