Displaying 20 results from an estimated 2000 matches similar to: "kde2d error message"
2006 Jan 19
2
function kde2d
Good evening,
I am Marta Colombo, student at Milan's Politecnico.
Thank you very much for your kindness, this mailing list is really useful.
 I am using the function kde2d for two-dimensional kernel density estimation and I'd like to know something more about this kind of density estimator. In particular I'd like to know: what bandwidth is used ?
Thank you in advance for your attention
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
2007 May 02
3
the Surv function
Hi,
I'm trying to do a simple survival analysis on some data, and I'm having the
following problem (here's my code and the error message):
out <- Surv(fup,event=status)
Error in Surv(fup, event = status) : argument "time2" is missing, with no
default
>From reading the documentation, it seems that I should be able to simply
write:  Surv(time1, event)  if my data is
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
2012 Apr 18
1
ggplot2 stat_density2d issue.
Hello,
I'd be very grateful for help with some ggplot2's stat_density2d issues.
First issue is with data limits. xlim() and ylim() doesn't seem to
work; instead, estimates (and plotting) seems to be constrained to
range(x), range(y) no matter what i do. The documentation says i can
pass in kde2d's parameters to ... but pussing kde2d's "lims" parameter
achieves
2007 May 05
3
the ifelse function
Hi Everyone,
I think I found a problem with the ifelse function:  If the condition
argument is NA, it treats it as true.  Anyone agree or disagree with this?
Jen
-- 
Jennifer Dillon
Doctoral Student
Harvard Biostatistics
Room 414B, Building 1
	[[alternative HTML version deleted]]
2005 Oct 25
3
making an inicator variable
Hello,
I am almost a total novice, and I am sure there must be an easy (and 
basic) way to turn a variable of 1's and 2's into a variable of zeros 
and ones.  This is in a data frame, but if I could do it with vectors, 
that's all I need.
Can someone tell me how?
Thanks so much,
Jen
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 <-
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
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
2007 Nov 26
2
2d Joint Density Plot
Hi all,
I'm fairly new to R, so I'm still trying to feel out what is available to
me.  I would like to be able to plot joint density in a two dimensional plot
where density is indicated by color or darkness gradients, like a 2d color
coded topographic map.  Ideally, the output would be something I could then
plot other points or lines on.
Currently, I'm calculating joint density with
2010 Feb 15
4
density estimates for fixed points
Problem: 
Based on a n x 2 data matrix i want a kernel estimate of the bivariate
density. However, i also wish to specify wich points the density should be
calculated at. 
I can offcourse just write the full kernel density estimate as a R-code, but
surely there must already exist some package for this operation? 
The package density(), seems to create a new matrix (depending on n), where
the
2005 Jan 14
1
kde2d and borders
Hallo,
I want to use kde2d to visualize data on a sphere given in spherical 
coordinates. Now the problem is, that "phi == 2*pi = 0", so in principal 
I have to connect (in a graphical view) the left and right border of my 
plot (and the bottom and top). Has anyone any idea how to do that ?
Thanks,
Manuel
-- 
-------------------------------------
  Manuel Metz
  Sternwarte der
2010 Nov 20
2
How to do a probability density based filtering in 2D?
Hello,
This sounds like a problem to which many solutions should exist, but I
did not manage to find one.
Basically, given a list of datapoints, I'd like to keep those within
the X% percentile highest density.
That would be equivalent to retain only points within a given line of
a contour plot.
Thanks to anybody who could let me know which function I could use!
Best,
Emmanuel
2006 May 11
1
Conditional contour plots for estimated density functions using Lattice
Does anybody here have a suggestion for a clever way of creating contour
plots for estimated bivariate density functions conditional on a factor?
The contourplot function in the 'lattice' package only accepts data that
are on the form 'z ~ x * y', not on the form 'x,y' or 'y~x'; otherwise I
could probably have used the panel function to do the needed conversion.
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
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
2007 Jun 07
0
How to get the number of modes using kde2d
Hi,
The silverman's paper introduction offer how to find a mode for one
dimensional data based
on software
http://www.stanford.edu/~kasparr/software/silverman.r,
for two dimensional data I use kde2d to smooth it out first,  then I get a
matrix of densities for all the X(one dimension) cross Y(another
dimension).
I sort X and Y first before I pass the values to kde2d(x, y, c(hx, hy)),
the
2012 Mar 10
1
How to improve the robustness of "loess"? - example included.
Hi,
I posted a message earlier entitled "How to fit a line through the
"Mountain crest" ..."
I figured loess is probably the best way, but it seems that the
problem is the robustness of the fit. Below I paste an example to
illustrate the problem:
    tmp=rnorm(2000)
    X.background = 5+tmp; Y.background = 5+ (10*tmp+rnorm(2000))
    X.specific = 3.5+3*runif(1000);
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