similar to: how to recode in my dataset?

Displaying 20 results from an estimated 800 matches similar to: "how to recode in my dataset?"

2006 Jul 03
2
could i change the ouput style on summary?
Dear friends, summary() doesn't give a good ouput style,e.g.: grass soiltem airtem gheight humidity altitude diluo :38 Min. :15.90 Min. :17.70 Min. : 8.00 Min. : 0.2360 high: 43 huanghuacai:32 1st Qu.:19.32 1st Qu.:22.60 1st Qu.:40.00 1st Qu.: 0.3190 low :119 hucao :46 Median :20.20 Median :25.30 Median :60.00
2006 Jul 08
0
which model (GLMs)is the best?
Dear friends, I used R to analyze my data with the models of generalized linear models, and found three models were relatively good, but i can't decide which is the best,how should i do ? *Model1:* glm(formula = snail ~ grass + gheight + humidity + altitude + soiltem + airtem + grass:altitude, *family = Gamma(link = inverse*), data = model, na.action = na.exclude, control =
2006 Oct 15
1
gamma distribution don't allow negative value in GLMs?
Dear friends, when i use glm() to fit my data, i use glm(formula = snail ~ vegtype + mhveg + humidity + elevation + soiltem, *family = Gamma(link = inverse),* data =a,)) It shows: error in eval(expr, envir, enclos) : *gamma distribution don't allow negative value*. But i use result<-glm(formula = snail ~ vegtype + mhveg + humidity + elevation + soiltem, family = poisson, data =a) #this
2010 Sep 14
1
NA confusion (length question)
Hi folks, I am running a very simple regression using mylm <- lm(mass ~ tarsus, na.action=na.exclude) I would like the use the residuals from this analysis for more regression but I'm running into a snag when I try cbind(mylm$residuals, mydata) # where my data is the original data set The error tells me that it cannot use cbind because the length of mylm$residuals is
2007 Feb 19
1
need help in reading TOMS observed ASCII data file
Hello R Users, I am new to R. I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS ozone(O3). > > AOD data is on 1x1 grid and O3 data is on 5x5 grid. > > First I want to read AOD and O3 as it is and then I want to regrid AOD on > 5x5 grid as O3. > > Reading is first problem. > > FIRST PROBLEM READING AOD: > > AOD data is in following format: >
2010 Apr 16
2
managing data and removing lines
Hi, I am very new to R and I've been trying to work through the R book to gain a better idea of the code (which is also completely new to me). Initially I imputed my data from a text file and that seemed to work ok, but I'm trying to examine linear relationships between gdist and gair, gdist and gsub, m6dist and m6air, etc. This didn't work and I think it might have something to do
2015 May 14
3
comportamiento de data.table al hacer calculos por grupos
Estimada comunidad tengo un problema del que no encuentro datos que me ayuden mucho en la web. Estoy haciendo calculos por grupos con data,table. Tengo un archivo (zp.res) con tres columnas que clasifican los datos (sol, con, dia) y una columna de datos numericos (media), de la siguiente forma: sol con dia media 1: con 0 1 -22.6 2: con 0 1 -36.6 3: con 0 1 -35.6 y
2013 Jan 25
1
Recoding variables (without recode() )
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130125/859c4520/attachment.pl>
2010 Apr 07
2
recoding variables-recode not working
Hi, I have numerical variable that I want to recode into categories '0' and '1 and more' and do analysis with that data. I have tried various of possibilities to do so, but I am sucked and nothing is working. recode(Q12, "0='A';1:30='B'") cut(Q12, breaks=c(0,1,30), lables=c('0', '1 and more')) cat(Q12, "0=0;1-33=1") What should
2010 Mar 30
2
How to recode variables using base R
Hi, Is there an efficient way recoding variables in a data.frame using base R? My purpose is to create new variables and attach them into old data.frame. The basic idea is shown below, but how to create recoding for A, B and C and assing them into new variables? df <- data.frame(A = c(1:5), B = c(3,6,2,8,10), C = c(0,15,5,9,12)) df$A[df$A <= 3] <- "x" df$A[df$A > 3 &
2008 Mar 27
1
Recode factors
I know this comes up, but I didn't see my exact issue in the archives. I have variables in a dataframe that need to be recoded. Here is what I'm dealing with I have a factor called aa > class(aa) [1] "factor" > table(aa) aa * 0 1 2 3 A B C D L N T 0 0 1908 725 2089 0 0 67 0 0 2 1 6 I need to recode
2001 Mar 27
4
recode vector values to NA
Greetings, I'm in the painful process of migrating from SAS to R. In the process I've discovered that there are some basic things that I am getting hung up on. The most basic is the simple recoding of variables. Suppose I create a vector x <- rnorm(10000) and I want to recode all values of x > 1.5 to NA. How would I do that in R? TIA Cheers, Patrick
2006 Sep 28
2
recode problem - unexplained values
I am hoping for some advice regarding the difficulties I have been having recoding variables which are contained in a csv file. Table 1 (below) shows there are two types of blanks - as reported in the first two columns. I am using windows XP & the latets version of R. When blanks cells are replaced with a value of n using syntax: > affect [affect==""] <- "n" there
2011 Aug 12
2
recode Variable in dependence of values of two other variables
Hi, as an R-beginner, I have a recoding problem and hope you can help me: I am working on a SPSS dataset, which I loaded into R (load("C:/...) I have 2 existing Variables: "ID" and "X" , and one variable to be computed: meanX.dependID (=mean of X for all rows in which ID has the same value) ID = subject ID. Since it is a longitudinal dataset, there are repeated
2009 Jun 12
2
Sweave recode(car) and Lyx, compiling but not executing on Mac
I am just beginning to use Sweave with Lyx on a Mac (R2.8.1). I have 12 chunks of Sweave code that work fine, but this piece: <<>>= library(car)
2013 May 07
2
recode categorial vars into binary data
Dear R-List, I would like to recode categorial variables into binary data, so that all values above median are coded 1 and all values below 0, separating each var into two equally large groups (e.g. good performers = 0 vs. bad performers =1). I have not succeeded so far in finding a nice solution to do that in R. I thought there might be a better way than ordering each column and recoding the
2013 May 07
2
recode categorial vars into binary data
Dear R-List, I would like to recode categorial variables into binary data, so that all values above median are coded 1 and all values below 0, separating each var into two equally large groups (e.g. good performers = 0 vs. bad performers =1). I have not succeeded so far in finding a nice solution to do that in R. I thought there might be a better way than ordering each column and recoding the
2005 Jul 28
1
Unexpected behavior in recode{car}
Thanks to the R creators for such a great statistical system. Thanks to the R help list, I have (finally) gotten far enough in R to have a question I hope to be worth posting. I'm using the recode function from John Fox's car package and have encountered some unexpected behavior. Consider the following example: ## Begin cut-and-paste example require( car ) set.seed(12345) nn <-
2009 Apr 01
4
Recode of text variables
Hi all I am trying to do a simple recode which I am stumbling on. I figure there must be any easy way but haven't come across it. Given data of A","B","C","D","E","A" it would be nice to recode this into say three categories ie A and B becomes "Treat1", C becomes "Treat 2" and E becomes "Treat 3". I tried
2009 Nov 18
2
recode according to old levels
Dear R-users, i try to recode a factor according to old levels F <- factor(sample(c(rep("A", 4), rep("B",2), rep("C",5)))) recode(F, "levels(F)[c(1,3)]='X'; else='Y'") i tried to work with eval or expression around levels(F)[c(1,3)], but nothing seems to work. Many thanks if anyone could tell me what i've missed and what's