[R] quick Help needed
arun
smartpink111 at yahoo.com
Sun Jun 16 05:28:50 CEST 2013
Hi,
It is better to ?dput() the dummy dataset.
I made up some data for female==0
dat1<- read.table(text="
pbnr dat dep dys sop ago mis age female messpunkt2 messpunkt1 tage eintrittsjahr
1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75 35 1 8817 8817 0 1994
2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75 35 1 8910 8817 93 1994
3 10028 1994-02-01 2.00 1.75 3.00 0.50 1.50 42 1 8797 8797 0 1994
4 10028 1999-01-15 1.25 0.75 2.25 0.50 0.25 42 1 10606 8797 1809 1999
5 10053 1994-03-16 2.50 0.75 1.25 0.50 1.25 22 1 8840 8840 0 1994
6 10053 1994-09-23 3.25 1.25 1.25 0.75 2.25 22 1 9031 8840 191 1994
7 10043 1994-02-21 0.85 1.20 0.51 0.55 0.95 45 0 8917 8817 0 1994
8 10043 1994-05-25 0.95 1.10 0.55 0.55 0.85 35 0 8950 8717 93 1994
9 10038 1994-02-01 2.50 1.85 3.20 0.70 1.70 45 0 9797 8897 0 1994
10 10038 1999-01-15 1.55 0.85 2.35 0.70 0.55 47 0 11606 9797 1809 1999
11 10063 1994-03-16 2.20 0.65 1.55 0.85 1.25 28 0 8940 8850 0 1994
12 10063 1994-09-23 3.55 1.35 1.55 0.95 2.35 32 0 9531 8340 191 1994
",sep="",header=TRUE,stringsAsFactors=FALSE)
by(dat1[, c(3:8)], dat1[,"female"], summary)
#or
library(psych)
describeBy(dat1[,3:8],dat1$female)
#or
describeBy(dat1[,3:8],dat1$female,mat=TRUE)
A.K.
----- Original Message -----
From: Sophie Homeyer <sophie.homeyer at googlemail.com>
To: r-help at r-project.org
Cc:
Sent: Saturday, June 15, 2013 4:58 PM
Subject: [R] quick Help needed
Hi,
i am new to this forum and not sure how it works,
I am trying to do deskriptive descripe my data in terms of gender:
head(scltotal)
pbnr dat dep dys sop ago mis age female messpunkt2
messpunkt1 tage eintrittsjahr
1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75 35 1 8817
8817 0 1994
2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75 35 1 8910
8817 93 1994
3 10028 1994-02-01 2.00 1.75 3.00 0.50 1.50 42 1 8797
8797 0 1994
4 10028 1999-01-15 1.25 0.75 2.25 0.50 0.25 42 1 10606
8797 1809 1999
5 10053 1994-03-16 2.50 0.75 1.25 0.50 1.25 22 1 8840
8840 0 1994
6 10053 1994-09-23 3.25 1.25 1.25 0.75 2.25 22 1 9031
8840 191 1994
so female is either 0 or 1 I assume 0 is male and 1 is female. And I want
to look at dep, dys, sop, ago and mis how they are in terms of gender
(female or male) I have no clue what to do :-(
thanks for your help
sophie
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list