- This message: [ Message body ] [ More options ]
- Related messages: [ Next message ] [ Previous message ] [ Next in thread ] [ Replies ]

From: Daniela Ottaviani <d.ottaviani_at_yahoo.it>

Date: Tue, 08 Jul 2008 13:18:13 +0000 (GMT)

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. Received on Tue 08 Jul 2008 - 15:42:54 GMT

Date: Tue, 08 Jul 2008 13:18:13 +0000 (GMT)

# Set a cycle

for (i in 1:nrow(myD)) {

mycode = myD$code[i]

mymean[i] = mean(prevalence)

myD$Pr_mean[i] = mymean[i]

}

With the above cycle I am able to compute the average of all 200 observations which is then written in every cell. I understand that a condition is missing, that indicates that the average has to be computed amongst the observations showing the same codes values.

Could you please help me ?

D.

Posta, news, sport, oroscopo: tutto in una sola pagina.
Crea l'home page che piace a te!

www.yahoo.it/latuapagina

[[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. Received on Tue 08 Jul 2008 - 15:42:54 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 23:31:47 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*