Displaying 20 results from an estimated 3000 matches similar to: "Conditional contour plots for estimated density functions using Lattice"
2002 Jan 18
1
New R on Mac user fails to run MASS
My R installation (Mac OS9.2.2) is working, but when I try to run the
examples from Venables & Ripley (p. 6):
R : Copyright 2001, The R Development Core Team
Version 1.4.0 (2001-12-19)
...
> library(MASS)
> x<-rnorm(1000)
> y<-rnorm(1000)
> truehist(c(x,y+3),nbins=25) % Plots nicely
> dd<-con2tr(kde2d(x,y)) % Doesn't complain
> contourplot(z ~ x + y,
2007 Aug 30
2
Need help putting histograms on the diagonal of a splom plot
Hello,
I am in need of help in putting histograms on the diagonal of a plot
produced with splom().
The plot matrix I am trying to produce is to have standard scatterplots
in the upper-left triangle, contour plots in the lower-right triangle,
and histograms on the diagonal. I have a function that does the first
two, but the histograms on the diagonal has been beyond my ability.
Here is my
2008 Sep 18
0
Joint distributions
Dear R-help!
I need to draw contour lines in a plot of wave heights (Hs) versus peak
periods (Tp) showing the joint probabilities of 1-year wave heights~peak
periods, 10-year wave heights~peak periods and 100-year wave heights~peak
periods.
I've used the contourplot() function in the plot I've added in this mail.
You can use the added dataset "Rhelpdata.txt" to reproduce a
2008 May 30
1
Reducing space around lattice wireframe plots
Dear R-help.
When plotting 3D wireframe plots with the lattice package, there is often
a lot of space between the actual plot (i.e., cube) and panel borders. For
a single wireframe, this is not a problem, but when plotting multiple
wireframes, the wasted space decreases the size of the plots very much.
Is there a way to decrease this space/margin? I could not find any
information about it in
2008 Jan 16
1
Probability weights with density estimation
I am a physician examining an NHANES dataset available at the NCHS
website:
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/demo_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/hdl_d.xpt
http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/tchol_d.xpt
Thank you to the R authors and the foreign package authors in
particular. Importing from the SAS export
2006 Jun 24
1
Overlaying 2D kernel density plots on scatterplot matrix
Hi all
We are pretty new to R here and trying to achieve something that we believe
is possible but it?s not easy to work out how to do it.
We are producing scatterplot matrices for e.g. 10 variables. What we would
like to do is superimpose 2D kernel density estimators on top of each plot
so that we end up with a scatterplot matrix of 2D kernel density (contour)
plots.
The kernel density plots
2006 Jun 14
1
Estimate region of highest probabilty density
Estimate region of highest probabilty density
Dear R-community
I have data consisting of x and y. To each pair (x,y) a z value (weight) is assigned. With kde2d I can estimate the densities on a regular grid and based on this make a contour plot (not considering the z-values). According to an earlier post in the list I adjusted the kde2d to kde2d.weighted (see code below) to estimate the
2008 Jun 25
1
confidence bounds using contour plot
Hello
I'm trying to calculate 2d confindence bounds into a scatterplot using the
function "kde2d" (package MASS) and a contour plot.
I found a similar post providing a solution - unfortunatly I do not realy
understand which data I have to use to calculated the named "quantile":
Post URL: http://tolstoy.newcastle.edu.au/R/help/03b/5384.html
> (...)
>
>> Is
2004 Dec 22
0
weighted kernel density estimation
Dear wizaRds,
I use the MASS::kde2d function to estimate density of the two first
principal components. I do that to have a graphic visualisation of a
"group structure" in my dataset. So far, no problem.
But i would like to estimate that density using weights according to the
COS?? values that tells me if my observation is well represented on the
factorial plan 1-2. I would like to
2003 Jul 27
1
contourplot:how to get it to label all contours like 'contour'
Hi,
one of the nice things about contour is that it labels all contour lines.
contourplot only labels each particular elevation a single time.
i.e., if there are two contour lines corresponding to z = 45, it will only
label one of them.
is there a way to get contourplot to automatically label all the contour lines,
even those that are repeated?
i ask because i want to plot contour plots *w/
2008 Oct 04
0
difference between sm.density() and kde2d()
Dear R users,
I used sm.density function in the sm package and kde2d() in the MASS package
to estimate the bivariate density. Then I calculated the Kullback leibler
divergence meassure between a distribution and the each of the estimated
densities, but the asnwers are different. Is there any difference between
the kde2d and sm.density estimates? if there is a difference, then which is
the best
2006 Jul 01
0
SUMMARY: making contour plots using (x,y,z) data
Folks,
A few days ago, I had asked a question on this mailing list about
making a contour plot where a function z(x,y) is evaluated on a grid
of (x,y) points, and the data structure at hand is a simple table of
(x,y,z) points. As usual, R has wonderful resources (and subtle
complexity) in doing this, and the gurus of the list showed me the
way. Here's a complete working example. One might
2010 Jun 22
1
contour plots
Hi All,
I'm having difficulty making a contour plot a would like some help.
A standard contourplot can be made by having an x,y, and some matrix (shape
x*y) with contents:
x = 1:10
y = 1:10
cont <- matrix(runif(100,min=1,max=2),nrow=10,ncol=10)
filled.contour(x,y,cont)
Looks very nice.
Sometimes data comes in a different format however. Basically an x and an y,
and a vector z with all
2013 Feb 14
1
Clip a contour with shapefile while using contourplot
Hi, I have done the interpolation for my data and I was able to create the
contours in multipanel with the help of Pascal. Now, I want to clip the
contour with the shapefile. I want only the portion of contour to be
displayed which falls inside the boundary of the shapefile.
The data mydata.csv can be found on
https://www.dropbox.com/s/khi7nv0160hi68p/mydata.csv
The data for shapefile can be
2009 Dec 02
2
Joint density kde2d works improperly?
Dear all,
Please, look at the following code:
attach(geyser)
f1 <- kde2d(duration, waiting, n = 5)
a <- 0
for (i in 1:5){
for (j in 1:5){
a <- a + f1$z[i,j]
}
}
As far as I understood from Help kde2d returns matrix elements of which are
values of joint probability mass function Pr(X=x,Y=y) therefore, sum of its
elements should sum to 1.
Which is not the case from my check.
Where is
2002 May 31
1
Re: FW: Contour v Contourplot
Phil,
You write:
>> Using x,y, and z variables in the enclosed test.RData, the command
>>
>> contour(x,y,z)
>>
>> produces a lovely 2D plot, whereas
>>
>> contourplot(z~x*y)
>>
>> produces the error..
>>
>> Error in if (lim[1] > lim[2]) stop("Improper value of limit") :
>> missing value where
2011 Nov 24
2
Question on density values obtained from kde2d() from package MASS
Hello,
I am a little bit confused regarding the density values obtained from the function kde2d() from the package MASS because the are not in the intervall [0,1] as I would expect them to be. Here is an example:
x <- c(0.0036,0.0088,0.0042,0.0022,-0.0013,0.0007,0.0028,-0.0028,0.0019,0.0026,-0.0029,-0.0081,-0.0024,0.0090,0.0088,0.0038,0.0022,0.0068,0.0089,-0.0015,-0.0062,0.0066)
y <-
2006 Apr 23
3
bivariate weighted kernel density estimator
Is there code for bivariate kernel density estimation?
For bivariate kernels there is
kde2d in MASS
kde2d.g in GRASS
KernSur in GenKern
(list probably incomplete)
but none of them seems to accept a weight parameter
(like density does since R 2.2.0)
--
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at
2009 Mar 15
1
Contour plots of four two-dimensional matrices
I have four large two-dimensional matrices of which I want to create contour
plots. Something like
filled.contour(<matrix>)
contourplot(<matrix>)
works but only gives me one plot at a time. If I combine the four matrices
into one three-dimensional matrix, which I'll name "seven", there should be
a way of doing something like this
contourplot(seven[,,k] for k in 1 to 4)
2009 May 13
1
overlap contour
Friends,
I have two covariance matrices (m1 and m2) of same size (150x150). I used
contourplot function to make contour plots individually (c1 and c2). I am
interested in making one contourplot overlapping the two individual contours
so that the portion of the plot above and below the diagonal can represent
the c1 and c2. Someone suggest me how can i do the same.
Is there any way that i can