Displaying 20 results from an estimated 10000 matches similar to: "select cases"
2005 Apr 07
3
analyse des correspondances multiples
bonjour,
Je voudrais faire une analyse des correspondances multiples avec R. avec
les repr?sentation graphiques correspondantes avec R.
je ne sais pas comment proc?der ..
en vour remerciant par avance
Faouzi
2005 May 16
1
graphic
Hi,
poids taille fumeur sexe sport etat
85 184 oui homme 1 malade
65 175 oui homme 1 malade
74 180 oui homme 2 gueri
79 175 oui homme 2 malade
71 165 non homme 3 gueri
80 185 non homme 3 gueri
75 180 non homme 4 malade
69 155 non homme 4 malade
74 168 oui
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
2004 Oct 07
3
Remove Indeterminate Level
Hi,
I have imported some data to R from stata and my factor variables have
an Indeterminate level which I don't really want. For example the
variable sex has the levels Male, Female and Indeterminate. There are
no 'Indeterminate' values in the data. Can somebody tell me how to get
rid of this level as it restricting my cox ph model.
Thanks
Neil
2011 Feb 18
3
How to change dataframe to tables
The data is in the attachment.
What I wanna get is:
, , Sex = Male
Eye
Hair Brown Blue Hazel Green
Black 32 11 10 3
Brown 53 50 25 15
Red 10 10 7 7
Blond 3 30 5 8
, , Sex = Female
Eye
Hair Brown Blue Hazel Green
Black 36 9 5 2
Brown 66 34 29 14
Red 16 7 7 7
Blond 4
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
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 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",
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 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)
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
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,
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