-----Original Message-----
From: Dr Khan Amir Maroof [mailto:khanamirmaroof at gmail.com]
Sent: 29. november 2010 15:55
To: BXC (Bendix Carstensen)
Subject: Re: [R-sig-Epi] help
Sir,
I want to know how to write the command for this problem.
I have entered the data in epidata and the variables are:
age, hadwateryesterday, hadthinporridgeyesterday.
age is a numeric variable containing numbers 0-23 months.
the other two variables are factor variables: having 0 for
no, 1 for yes and 8 for don't know
how to write command if i want to get the following
descriptive statistics:
proportion of children less than 6 months for whom
hadwateryesterday and hadthinporridgeyesterday is 0.
I think in my last email, I was not able to explain my
problem correctly.
Also I am a novice in using R, so my questions are very basic
as I have to master first how to write correct commands.
Thanks for your help.
On Mon, Nov 29, 2010 at 1:42 AM, BXC (Bendix Carstensen)
<bxc at steno.dk> wrote:
You make a three-way table to see how breastfeeding
varies with the two others.
You could also analyse by logistic regression.
Best regards,
Bendix
> -----Original Message-----
> From: Dr Khan Amir Maroof [mailto:khanamirmaroof at gmail.com]
> Sent: 29. november 2010 03:57
> To: BXC (Bendix Carstensen)
> Subject: Re: [R-sig-Epi] help
>
> thanx for your reply.
>
> i m posting my original problem. i hv a variables: 'age' in
> completed months frm 0 to 23; 'took water yesterday' as 1 for
> yes, 2 for no and 8 for don't know; 'took thin porridge
> yesterday' as 1 for yes, 2 for no and 8 for don't know. now i
> hv to find out this: if took water yesterday or took thin
> porridge yesterday by children less than 6 months of age,
> then they are not exclusively breastfed, whereas if not taken
> any of these yesterday then they are exclusively breastfed.
>
> kindly let me know how to do this in R or epicalc.
>
> thanking you.
>
>
> On Sun, Nov 28, 2010 at 12:47 PM, BXC (Bendix Carstensen)
> <bxc at steno.dk> wrote:
>
>
> It sounds as if you are looking for something like
>
> newvar <- as.numeric(var1=="yes")
>
> or
>
> newvar <- as.numeric(var1==1)
>
> depending on whether var1 is numeric or character.
>
> Best regards,
> Bendix Carstensen
>
>
> > -----Original Message-----
> > From: r-sig-epi-bounces at r-project.org
> > [mailto:r-sig-epi-bounces at r-project.org] On
> > Amir Maroof
> > Sent: 27. november 2010 16:31
> > To: r-sig-epi at stat.math.ethz.ch
> > Subject: [R-sig-Epi] help
> >
> > Sir,
> >
> > Its wonderful to start using this software R.
> > full efforts to learn it on my own with the
> > online manuals available. I am using epicalc
> > have a dataset where i want to apply
> > var1 is yes or 1, assign 1 to it or else 0.
> > with this problem?
> >
> > Thanking you,
> >
> > --
> > Dr. Khan Amir Maroof,
> > Lecturer,
> > Department of Community Medicine,
> > University College of Medical Sciences & GTB
>
>
>
>
> --
> Dr. Khan Amir Maroof,
> Lecturer,
> Department of Community Medicine,
> University College of Medical Sciences & GTB Hospital, Delhi
> www.teachingcommunitymedicine.blogspot.com