similar to: density plot for weighted data

Displaying 20 results from an estimated 20000 matches similar to: "density plot for weighted data"

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
2006 Apr 06
4
weighted kernel density estimate
Dear R-users, I intend to do a spatial analysis on the genetic structuring within a population. For this I had thought to prepare a kernel density estimate map showing the spatial distribution of individuals, while incorporating the genetic distances among individuals. I have a dataset of locations of N unique individuals (XY-coordinates) and an NxN matrix with the genetic distances given as a
2005 Apr 07
1
density estimation with weighted sample
Dear all I would like to perform density estimation with a weighted sample (output of an Importance Sampling procedure) in R. Could anybody give me an advice on what function to use (in which package)? Thanks a lot, Lorenzo
2004 Mar 03
1
partial autocorrelation for Rt vs. Nt-1, ......., Nt-h
Dear list, following a previous querry we are still stuck! As pointed out by Erin Hodges the "ts" library includes a PACF function which reports the partial correlation of population density at time t against lagged population density. However, what we are trying to calculate is the partial correlation between rate of population change, Rt=log Nt/Nt-1, against lagged population
2011 Apr 13
1
Decimals in R/SQL
Hello, When I am writing in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.00000, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.0000. I appreciate any suggestions! Thanks! Example: z <- sqldf ("select ST, SUM(AGEP*PWGTP)*1.000000000/SUM(PWGTP)*1.00000000000000 as wgtage from ss09
2003 Mar 24
1
negative binomial regression
I would like to know if it is possible to perform negative binomial regression with rate data (incidence density) using the glm.nb (in MASS) function. I used the poisson regression glm call to assess the count of injuries across census tracts. The glm request was adjusted to handle the data as rates using the offset parameter since the population of census tracts can vary by a factor of
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
2010 Jul 20
2
Constrain density to 0 at 0?
I'm plotting some trip length frequencies using the following code: plot( density(zTestData$Distance, weights=zTestData$Actual), xlim=c(0,10), main="Test TLFD", xlab="Distance", col=6 ) lines(density(zTestData$Distance, weights=zTestData$FlatWeight), col=2) lines(density(zTestData$Distance, weights=zTestData$BrdWeight ), col=3) which works fine except the
2008 Feb 13
3
Generalized nonlinear mixed model function?
I am wondering if there is an R function that could estimate a generalized nonlinear mixed model. >From my reading it seems that nlme from the nlme package can fit nonlinear mixed models, while lmer from the lme4 package can fit generalized linear mixed models. One alternative I?ve found is gnlmix from the repeated package, although this only allows for a single random effect. Is there
2007 May 21
1
Graphically show population density for a specific geographic area using R
Hi, we all know that R is powerful in dealing with graphics. I am now trying to use R to show some geographic attributes for a specific geographic area on a graph. For example, if I would like to generate a graph showing the population densities (in terms of the intensity of colors) for Illinois State by zip codes. I did some research; and it seems that package "maptools" is
2011 Feb 07
1
kernel density
Hi all (again), many thanks for the answer to the optimization problem. All is fine now. The problem now is with kernel estimators in sm. package. I do all the work and the graphics good, but I need the density function data for each point, and I don't know how to get it. The only thing I get is the table at the end of the following sequence: >
2010 Mar 13
2
Is this a bug (or a feature) in hist(x)$density ??
Hi all, A friend send me a question on why does this: x<-rpois(100,1) sum( hist(x)$density ) Gives out "2" I tried this: sum( hist(x, freq =T)$density ) It didn't help. Then he came back with the following insight: # with breaks b<-c(0,0.9,1:8) sum(hist(x,breaks=b)$density) # Much more then 2 # but if we add weights according to the interval length
2011 Aug 16
1
density plot with frequency units
I would like to create a kernal density plot, but rather than show density units on the vertical axis I would like frequencies. I know histograms do this but I don't want the bars, just the density curve. Thanks!
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 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 Jan 17
1
Any tools for working with US 2000 census data?
I've been given the job of extracting some data from the United States 2000 census (files at http://www2.census.gov/census_2000/datasets/Summary_File_2/Maryland/all_ Maryland.zip 52M). I'm only interested in Census Block Groups (CBGs) located within Baltimore City, Maryland. Additionally, I just have to extract certain data fields. I think I'll be using Summary File 2. This is my first
2008 Oct 09
1
Spatstat - Several density plots using the same scale
Hi everyone, I am using the package "spatstat" for ploting kernel maps of my data. It is a marked point pattern, the result of mosquito surveillance in a area in a week. For each trap, the number of individuals captured is the mark of the point. > plot(density(X, weights=X$marks)) makes a nice kernel, but the problem is that I've got several weeks and for each week the density
2011 Feb 10
1
"Error in plot.window(...) : invalid 'xlim' value" from plot(...par(new = TRUE))
[New to the community; still in early part of R's learning curve.] Several months ago, I was requested to generate some graphs on a periodic basis. Accordingly, I managed to figure out a way to do so, using a combination of Perl and R (in a FreeBSD environment). While I've needed to adjust a few things here and there, the general approach has been pretty solid , and the R part has had
2010 Sep 03
2
density() with confidence intervals
Hello R users & R friends, I just want to ask you if density() can produce a confidence interval, indicating how "certain" the density() line follows the true frequency distribution based on the sample you feed into density(). I've heard of loess.predict(loess(y ~ x), se=TRUE) which gives you a SE estimate of the smoothed scatterplot - but density() kernel smoothing is not the
2002 Dec 18
1
Kernel smoothing.
I wish to produce a weighted (Gaussian?) kernel density estimate, in 2 dimensions, where the weights are permitted to be ***negative***. (I can ASSURE you that there are perfectly legitimate reasons why I want to do this. :-)) Clearly it is not really a density that I am trying to estimate. I had a go at using sm.density() from the sm package, but this requires that the weights be positive. Is