s-news
[Top] [All Lists]

Re: about S-plus graph

To: "Liu Zhigang" <email.lzg@gmail.com>
Subject: Re: about S-plus graph
From: "Dimitris Rizopoulos" <dimitris.rizopoulos@med.kuleuven.be>
Date: Mon, 29 May 2006 09:43:07 +0200
Cc: <s-news@lists.biostat.wustl.edu>
References: <551c2c780605290032r123cc9d3ye51ebc646e7871e9@mail.gmail.com>
try the following:

x <- rnorm(1000)
ks <- ksmooth(x, kernel = "normal", bandwidth = bandwidth.nrd(x))
hist(x, prob = TRUE, ylab = "density", col = 0)
lines(ks$x, ks$y, col = 6, lwd = 3)

I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
    http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- From: "Liu Zhigang" <email.lzg@gmail.com>
To: <s-news@lists.biostat.wustl.edu>
Sent: Monday, May 29, 2006 9:32 AM
Subject: [S] about S-plus graph


I am working with basic statistical graph.

Anybody can tell me how to make density line with histogram according S-Plus
command?
I can get it on menu selection, but I want to using it in my script.

thank you


Liu Zhigang

Jilin University, Jilin, China
email.lzg@gmail.com


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


<Prev in Thread] Current Thread [Next in Thread>