similar to: String variables in GLM

Displaying 20 results from an estimated 20000 matches similar to: "String variables in GLM"

2013 Nov 04
2
Fwd: recodificar variables
Buenas noches, mi pregunta es tal vez sencilla. tengo esta libreria y estos datos library(nlme) data(MathAchieve) Infoest = MathAchieve en esta base quiero contar la cantidad de casos en la que la columna Sex, toma el valor Female, como puedo hacerle el filtro para ver solo los Females. y como puedo dentro del mismo conjunto de datos agregar la variable numerica que me cuente 1 si es Female y 0
2012 Sep 05
2
Recoding categorical gender variable into numeric factors
I currently have a data set in which gender is inputed as "Male" and "Female" , and I'm trying to convert this into "1" and "0". I found a website which reccomended using two commands: data$scode[data$sex=="M"] <- "1" data$scode[data$sex=="F"] <- "2" to convert to numbers, and: data$scode <-
2013 Jan 06
4
random effects model
Hi A.K Regarding my question on comparing normal/ obese/overweight with blood pressure change, I did finally as per the first suggestion of stacking the data and creating a normal category . This only gives me a obese not obese 14, but when I did with the wide format hoping to get a obese14,normal14,overweight 14 Vs hibp 21, i could not complete any of the models. This time I classified obese=1
2012 Apr 12
3
Reading SPSS: underlying numerical codes
Dear people, I have got a question concerning the underlying numerical codes when reading an SPSS file into R. I used the package foreign and when I look at a variable I get the verbal codes. I would like to know how it is possible to get the underlying numerical codes as output, which are the same as in my SPSS file. Thank you very much in advance for your help! Marion [[alternative HTML
2013 May 13
2
reduce three columns to one with the colnames
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130513/fe848ce7/attachment.pl>
2013 Apr 27
2
r syntax
Hi i want to recode Male =1 and female =2 in R what is the syntax for same ? thanks Sameer [[alternative HTML version deleted]]
2006 Dec 12
1
strings as factors
Hi, To be able to match cases with a benchmark I need to have a data.frame with a character id variable. however, I am surprised why this seems to be so hard. In fact I was unable to succeed. Here is what I tried: >test1 <-expand.grid(ID = 1:2, sex = c("male","female")) >is(test1[,2]) [1] "factor" "oldClass" >test2 <-expand.grid(ID =
2008 Sep 03
1
test if all predictors in a glm object are factors
I'm trying to develop some graphic methods for glm objects, but they only apply for models where all predictors are discrete factors. How can I test for this in a function, given the glm model object? That is, I want something that will serve as an equivalent of is.discrete.glm() in the following context: myplot.glm <- function(model, ...) { if (!inherits(model,"glm"))
2009 Jun 23
2
Problem with ifelse statement
Hi R-helpers, I am trying to use this ifelse statement to recode a variable: > data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B" & data$MALE>4, "C", "B") (i.e., if social status is B and there are more than 4 males, then recode social status to C; otherwise, leave it B) But, it's not working. See the below R output. Notice that there were 71
2005 Dec 24
2
grouping data
Hello R-users/experts, I am new to R- I have a simple question: Let say I have a data set as follows temp:[file attached] the data structure is a follows: sex age female 28 female 53 female 53 female 36 male 42 male 29 male 43 male 36 male 41 Here we are grouping all male value into male and all female value in to female
2002 Nov 26
1
Reshape by multiple variables
Dear list I'm using the reshape command and want to reshape a wide data set to a long one e.g. I have the variables y1,y2,y3,age1,age2,age3,sex,ethnic I want my new long data set to consist of the variables y (which has been created from y1,y2,y3), age (which has been created from age1,age2,age3), sex and ethnic I have tried to use the command:
2008 Feb 12
3
help with bwplot
Dear list, I have following data set, which I want to plot the "Scale" variable on the x-axis and "Mean"´on the y-axis for each Ageclass and for each sex. The Mean value of each Ageclass for each sex would be connected by a line. Totally, there should be 6 lines, from which three present the Mean values of each Ageclass for respective sex. Are there any easy ways to do
2010 Sep 10
3
(no subject)
Hello, I'm trying to do bar plot where 'sex' will be the category axis and 'occupation' will represent the bars and the clusters will represent the mean 'income'. sex occupation income 1 female j 12 2 male b 34 3 male j 22 4 female j 54 5 male b 33 6
2010 Oct 29
2
wilcox.test; data type conversion?
I'm working on a quick tutorial for my students, and was planning on using Mann-Whitney U as one of the tests. I have the following (fake) data grade <- c("MVG", "VG", "VG", "G", "MVG", "G", "VG", "G", "VG") sex <- c( "male", "male", "female", "male",
2010 May 07
2
extract required data from already read data
Hi all, I have data like this: >sample <- read.csv(file="sample.csv",sep=",",header=TRUE) > sample stdate Domain sex age Login 1 01/11/09 xxx FeMale 25 2 2 01/11/09 xxx FeMale 35 4 3 01/11/09 xxx Male 18 30 4 01/11/09 xxx Male 31 3 5 02/11/09 xxx Male 32 11 6 02/11/09 xxx Male 31 1 7 02/11/09
2011 Feb 10
1
about prediction with a factor
Hi, I don't know how to make prediction with a factor in the linear model. Say yd=c(1,2,3,4,5) > sl=c(2,3,4,5,6) > sex=c("male","male","female","female","male") > sex=factor(sex) > m=lm(sl~yd+sex+sex:yd) How to make a prediction with new data like yd=c(4,5,6,7,8) for male and female separately ? Thank you very
2010 Jul 31
3
I have a problem
dear£º in the example£¨nomogram£©£¬I don't understand the meanings of the program which have been marked by red line.And how to compile the program(L <- .4*(sex=='male') + .045*(age-50) + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))). n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10)
2003 Jun 12
9
Programcode and data in the same textfile
I have the following problem. It is not of earthshaking importance, but still I have spent a considerable amount of time thinking about it. PROBLEM: Is there any way I can have a single textfile that contains both a) data b) programcode The program should act on the data, if the textfile is source()'ed into R. BOUNDARY CONDITION: I want the data written in the textfile in exactly
2005 Jun 25
1
Confidence interval bars on Lattice barchart with groups
I am trying to add confidence (error) bars to lattice barcharts (and dotplots, and xyplots). I found this helpful message from Deepayan Sarkar and based teh code below on it: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/50299.html However, I can't get it to work with groups, as illustrated. I am sure I am missing something elementary, but I am unsure what. Using R 2.1.1 on various
2005 Nov 12
1
how to make automatically each level from data.frame to vector
Dear R-helpers, Suppose I have dataset like this below: data(HairEyeColor) dfHEC <- as.data.frame(as.table(HairEyeColor)) my.dfHEC <- data.frame(Hair=rep(dfHEC$Hair,dfHEC$Freq), Eye=rep(dfHEC$Eye,dfHEC$Freq), Sex=rep(dfHEC$Sex,dfHEC$Freq)) my.dfHEC my.dfHEC$Hair my.dfHEC$Eye my.dfHEC$Sex and I know all levels for Hair, Eye and Sex. In my case, I