similar to: adding dynamic field to a model ...

Displaying 20 results from an estimated 10000 matches similar to: "adding dynamic field to a model ..."

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
2011 Feb 09
3
Need help merging two dataframes
Hi R users, I am trying to extract some attributes (age, sex, area) from dataframe "AB" that has 101,269 observations of 28 variables to dataframe "t2" that has 47 observations of 6 variables. They share a column called "id", which is a factor with 47 levels. I want to end up with a dataframe that has 47 observations of 9 variables (the original 6 variables of t2,
2010 Feb 16
2
Random Forest
Hi, i'm using randomForest package and i have 2 questions: 1. Can i drop one tree from an RF object? 2. i have a 300 trees forest, but when i use the predict function on new data (with predict.all=TRUE) i get only 270 votes. did i do something wrong? Thanks -- View this message in context: http://n4.nabble.com/Random-Forest-tp1557464p1557464.html Sent from the R help mailing list archive at
2011 Aug 11
1
Subsampling data
*Dear R community* * * *I have two questions on data subsample manipulation. I am starting to use R again after a long brake and feel a bit rusty.* * * *I want to select a subsample of data for males and females separately* * * library(foreign) Datatemp <- read.spss("H:/Skjol/Data/HL/t1and2b.sav", use.value.labels = F) > table(Datatemp$sex) 1 2 3049 3702
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",
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
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)
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
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 <-
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
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 =
2007 Mar 28
2
RV: By sentence
Hi dear listers Do you know how to made a mean by one or more categorical variables? I can do that quite easy on SAS by in R I just can't do it E.g. Some fishes Sex Lenght male 15 fema 20 fema 17 fema 19 male 18 So the idea is mean(Lenght) by sex, in order to have sex: Male mean=XX Sex: Fema mean=YY In this case is quite easy to do it by a loop, but I have a huge DB so is not an
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 Jul 09
1
Eliminate level information
Hi, I hope this formatting is correct as it is my first time. I am trying to do comparisons of values in a data frame that has some factor variables. One instance is > train$sex[2] [1] Male Levels: Female Male So the value is Male but a comparison like "Male" == train$sex[2] will always return FALSE because of the level information included. Another problem this creates is
2008 Jul 18
2
column wise paste of data.frames
Hi everybody! I'm sure that I overlook something and feel quite stupid to ask, but I have not found an easy solution to the following problem: Take e.g. the Orthodont data from the nlme package: > head(Orthodont) Grouped Data: distance ~ age | Subject distance age Subject Sex 1 26.0 8 M01 Male 2 25.0 10 M01 Male 3 29.0 12 M01 Male 4 31.0 14 M01 Male
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 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
2012 Jul 19
2
problem with using apply for dataframe
Dear people, I am including an example of a dataframe: mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female")) When I use the sapply function getting the information about the factors works: sapply(mydataframe,function(x)is.factor(x)) X total_bill tip
2010 Mar 26
4
Creating a vector of categories
Hi, I have a column in a data frame looking something like: $sex $language $count male english 0 male english 0 female english 32 male spanish 154 female english 11 female norweigan 7 and so on. What I want to do is to order these in to categories, for instance one category where count>=0 & count<10 and so on.. I want my data to turn out looking something like: male
2010 Oct 06
2
A problem --thank you
dear:teacher i have a problem which about the polr()(package "MASS"), if the response must have 3 or more levels? and how to fit the polr() to 2 levels? thank you. turly yours [[alternative HTML version deleted]]