similar to: Translating recoding syntax from SPSS to R

Displaying 20 results from an estimated 3000 matches similar to: "Translating recoding syntax from SPSS to R"

2013 Sep 22
2
Coding several dummy variables into a single categorical variable
Colleagues, I have generated several dummy variables: n$native0 <- 1 * (n$re=="white" & n$usborn=="yes") n$native1 <- 1 * (n$re=="afam" & n$usborn=="yes") n$native2 <- 1 * (n$re=="carib" & n$usborn=="yes") n$native3 <- 1 * (n$re=="carib" & n$usborn=="no") I would now like to combine these
2013 Jan 30
2
recoding variables again :(
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130130/7bc4cd37/attachment.pl>
2012 Jun 25
1
read.spss function
Hi dear all, I am trying to import a dataset from SPSS into R (R x64 2.15.0). I used both   read.spss("D:/Untitled2.sav", use.value.labels = TRUE, to.data.frame = TRUE, max.value.labels = Inf, trim.factor.names = FALSE,trim_values = TRUE, reencode = NA, use.missings = to.data.frame) & read.spss("D:\\Untitled2.sav", to.data.frame = TRUE, stringsAsFactors = FALSE)   but the
2006 Mar 10
3
Searching database using foriegn keys
I''ve read a lot about the ORM magic of Active Record which allows you to address a foriegn key object directly... e.g. I have a books and people table where books has a column called person_id If I get myself a Book object called mybook I get to the person object associated with this book by saying book.person which is awesome and I love it. My question, how can I say "Go
2012 Jun 01
1
Fit lines in intxplot
Dear R help, I tried to add linear fit lines in intxplot by adding "index.cond = function(x,y) coef(lm(y ~ x))[1]" inside the intxplot().? It didn't help.? I would appreciate any help. My dataset and codes are pasted below. Thanks, A.K. datGreen<- read.table(text=" Time,??? DarkSt,??? LightSt 0,??? 0,??? 1 1,??? 0.03,??? 0.82 2,??? 0.06,??? 0.91 3,??? 0.12,??? 0.64 4,???
2009 May 27
2
Factor level with no cases shows up in a plot
Consider this data structure (df1) ... Group Year PctProf FullYr 1 Never RF 2004 87 88 2 Cohort 1 2004 83 84 3 Cohort 2 2004 84 86 4 Cohort 3 2004 87 87 5 Cohort 4 2004 73 74 6 Never RF 2005 85 86 7 Cohort 1 2005 81 82 8 Cohort 2 2005 81 81 9 Cohort 3 2005 78 79 10 Cohort 4 2005 72 74 11
2012 May 07
1
Can't find the error in a Binomial GLM I am doing, please help
Hi all, I can't find the error in the binomial GLM I have done. I want to use that because there are more than one explanatory variables (all categorical) and a binary response variable. This is how my data set looks like: > str(data) 'data.frame': 1004 obs. of 5 variables: $ site : int 0 0 0 0 0 0 0 0 0 0 ... $ sex : Factor w/ 2 levels "0","1": NA NA NA
2011 Jun 28
2
coxph() - unexpected result using Crawley's seedlings data (The R Book)
Hi, I ran the example on pp. 799-800 from Machael Crawley's "The R Book" using package survival v. 2.36-5, R 2.13.0 and RStudio 0.94.83. The model is a Cox's Proportional Hazards model. The result was quite different compared to the R Book. I have compared my code to the code in the book but can not find any differences in the function call. My results are attached as well as a
2011 Aug 06
1
help with predict for cr model using rms package
Dear list, I'm currently trying to use the rms package to get predicted ordinal responses from a conditional ratio model. As you will see below, my model seems to fit well to the data, however, I'm having trouble getting predicted mean (or fitted) ordinal response values using the predict function. I have a feeling I'm missing something simple, however I haven't been able to
2003 Dec 05
3
Odds ratios for categorical variable
Dear R-users: How does one calculate in R the odds ratios for a CATEGORICAL predictor variable that has 4 levels. I see r-help inquiries regarding odds ratios for what looked like a continuous predictor variable. I was wondering how to get the pairwise odds ratios for comparisons of levels of a categorical predictor variable. I can't seem to get the correct output using: >
2007 Aug 02
1
Xyplot - adding model lines to plotted points
Hello, I have written code to plot an xyplot as follows: library(lattice) xyplot(len~ageJan1|as.factor(cohort),groups=sex,as.table=T,strip=strip.c ustom(bg='white',fg='white'),data=dat, xlab="Age (January 1st)",ylab="Length (cm)",main="Linear models for male and female cod, by cohort",type='p',
2012 Dec 21
2
how to recode an ordered factor
Dear R helpers, I'm trying to recode an ordered factor to reverse its scale, but I can't figure out how to make it. I am using the Recode function provided by the Car package. I've created an ordered variable: data$o.var1 <- ordered(data$var1, levels=c(1,2,3,4), labels =c("very satisfied", "fairly satisfied", "not very satisfied", "not at all
2008 Jun 12
1
cch function and time dependent covariates
----- begin included message In case cohort study, we can fit proportional hazard regression model to case-cohort data. In R, the function is cch() in Survival package Now I am working on case cohort analysis with time dependent covariates using cch() of "Survival" R package. I wonder if cch() provide this utility or not? The cch() manual does not say if time dependent covariate is
2012 Jun 04
1
Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")
Hi all, I have done a backward stepwise selection on a full binomial GLM where the response variable is gender. At the end of the selection I have found one model with only one explanatory variable (cohort, factor variable with 10 levels). I want to test the significance of the variable "cohort" that, I believe, is the same as the significance of this selected model: >
2008 Jun 16
1
回复: cch() and coxph() for case-cohort
I tried to compare if cch() and coxph() can generate same result for same case cohort data Use the standard data in cch(): nwtco Since in cch contains the cohort size=4028, while ccoh.data size =1154 after selection, but coxph does not contain info of cohort size=4028. The rough estimate between coxph() and cch() is same, but the lower and upper CI and P-value are a little different. Can we
2012 Oct 24
2
Recode function car package erases previous values
Hi all, I am attempting to create a new variable based on values of other variables. The variable is called pharm. It basically takes the numeric code of 1 as yes and 0 to be No from the variable B20_C1 (a question on a survey). However, I would also like to have a level for non-respondents and these are captured in the variable nr.B20C, which is a 1 when there is a non-response on the whole group
2013 Jan 18
3
longitudinal study
Hello R user, I have a data set from a longitudinal study ( sample below) where subjects are followed over time. Second column (status) contains info about if subject is dead or still in the study and third column is time measured in the week. Here is what I need: if status is not dead or unknown take the last week, if status is dead or unknown I need to have corresponding week. Desired resulst:
2005 Dec 28
2
Importing Genstat files into R
Does anyone know if there is a package or other method of reading Genstat files directly into R. Genstat isn't listed in the foreign package. Many thanks, Graham [[alternative HTML version deleted]]
2004 Oct 11
3
split and rlm
Hello, I'm trying to do a little rlm of some data that looks like this: UNIT COHORT perdo adjodds 1010 96 0.39890 1.06894 1010 97 0.48113 1.57500 1010 98 0.36328 1.21498 1010 99 0.44391 1.38608 It works fine like this: rlm(perdo ~ COHORT, psi=psisquare) But the problem is that I have about 100 UNITs, and I want to do a
2012 May 04
2
Binomial GLM, chisq.test, or?
Hi, I have a data set with 999 observations, for each of them I have data on four variables: site, colony, gender (quite a few NA values), and cohort. This is how the data set looks like: > str(dispersal) 'data.frame': 999 obs. of 4 variables: $ site : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 2 2 ... $ gender: Factor w/ 2 levels "0","1":