Displaying 20 results from an estimated 20000 matches similar to: "length of a density curve (or any curve)"
2010 Mar 14
6
barplot with a probability density curve
Dear all,
I am making a barplot as following:
barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"),xlab="diameter",ylab="flow",main="some title",space=0.1)
I am also trying to add a probability density curve, however using
lines(density(c(1,2,3,5,2,3,1))) does not give
2013 Apr 13
1
Reshaping Data for bi-partite Network Analysis [SOLVED]
Wow !
so many thanks Arun and Rui
works like a charm
problem solved
2013/4/13 arun <smartpink111@yahoo.com>
> Hi,
> Try this;
> library(reshape2)
> res<-dcast(Input,people~place,value.var="time")
> res[is.na(res)]<-0
> res
> # people beach home school sport
> #1 Joe 5 3 0 1
> #2 Marc 0 4 2 0
> #3 Mary
2010 Jan 01
2
How to calculate density function of Bivariate binomial distribution
Am trying to do some study on bivariate binomial distribution. Anyone knows
if there is package in R that I can use to calculate the density function of
bivariate binomial distribution and to generate random samples of it.
Thanks,
--
View this message in context: http://n4.nabble.com/How-to-calculate-density-function-of-Bivariate-binomial-distribution-tp992002p992002.html
Sent from the R help
2009 Nov 08
2
Counting non-empty levels of a factor
Hi everyone,
I'm struggling with a little problem for a while, and I'm wondering if
anyone could help...
I have a dataset (from retailing industry) that indicates which brands
are present in a panel of 500 stores,
store , brand
1 , B1
1 , B2
1 , B3
2 , B1
2 , B3
3 , B2
3 , B3
3 , B4
I would like to know how many brands are present in each store,
I tried:
result <-
2013 Apr 13
2
Reshaping Data for bi-partite Network Analysis
Hello
I have a dataset of people spending time in places. But most people don't
hang out in all the places.
it looks like:
> Input<-data.frame(people=c("Marc","Marc","Joe","Joe","Joe","Mary"),
+ place=c("school","home","home","sport","beach","school"),
+
2007 Oct 03
2
Shading area under density curves
Hello,
I have a question regarding shading regions under curves to display
95% confidence intervals. I generated bootstrap results for the slope
and intercept of a simple linear regression model using the following
code (borrowed from JJ Faraway 2005):
> attach(allposs.nine.d)
> x<-model.matrix(~log(d.dist,10))[,-1]
> bcoef<-matrix(0,1000,2)
> for(i in 1:1000){
+
2003 Apr 09
3
plotting the lognormal density curve
I am trying to plot a lognormal density curve on top of an existing
histogram. Can anybody suggest a simple way to do this? Even if someone
could just explain how to plot a regular normal density curve on top of an
existing histogram, it would be a big help.
Also, is there some way to search through the R-help archives other than
simple browsing?
Thank you so much. Your help and time is greatly
2012 May 28
2
import contingency table
hello everyone,
i often work on contingency table that I create from data.frame (with
table() function)
but a friend sent me an excel sheet wich *already is* a contingency
table (just a simple 2 way table !...)
any clue on how to import it in R (keeping row names and col names) ?
any tuto I come accross only mention the table transformation, but
never the import of such data
I only found
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
2011 Jun 07
1
ggplot2 Histogram with density curve
I am learning ggplot2 commands and I have figured out how to create
histograms and density curves but I am not sure how to add a density curve
on top of a histogram.
Here are the two graphs that I created.
## Histogram
t<-rnorm(500)
w<-qplot(t, main="Normal Random Sample", fill=I("blue"), colour=I("black"),
geom="histogram")
w
##Density Curve
2010 Mar 02
1
how to import map data (maptools?) from a html set of 'coords'
Dear R users,
I would like to draw map and import it in maptools/spatstat packages.
The 'raw data' I have come from a web page (<map>...</map>) and are
basically a list of coordinates of a polygon.
I would like to know how to import them in R; I checked the maptools
packages, but all the examples use existing .dbf files.
I just have a (serie of) text file(s) looking like
2011 Aug 25
2
Adding a normal density curve over the empirical curve
Hi
I have created the following plot over the empirical returns.. What I now
want to do is to overlay a curve/line with the normal density as a
comparison of the two. Does anyone know how to do this?
(NB the last two lines are the problem, and are wrong, I know).
Thank you in advance!
Rikke
http://r.789695.n4.nabble.com/file/n3768783/S%26P_500_spot_and_return_2010.csv
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
2008 Apr 23
1
Density estimation
Hi,
I am analysing a dataset containing genetic distances within and between
species. I want to show a overlap of the distributions of the intra- and
interspecific values; on a second graph I use a cut-off value to determine
these boundaries. As the dataset contains >30 000 values, I would like to do
this with a simple line rather than superimposed histograms. Hence, density
plots. 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
2008 Aug 27
2
Error producing density curve
Hi, i have never really used R before and i need to produce a density curve
for use in an assignment. Following the instructions in the manual provided
with my course i keep getting this error message:
"Error in plot.xy(xy, type, ...) : invalid plot type '1'"
The commands i have entered are:
>x=seq(0, 1800, 10)
>x
>f=dnorm(x, 1454.190, 162.6301)
>f
2008 Nov 29
1
2D density tophat
Hello R users,
I have successfully created a square (or more generally, rectangular) tophat
smoothing routine based on altering the already available KDE2D. I would be
keen to implement a circular tophat routine also, however this appears to be
much more difficult to write efficiently (I have a routine, but it's very
slow). I tried to create one based on using crossdist to create a distance
2005 Apr 27
4
Density curve over a histogram
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Thanks in advance,
Paul
2006 Jan 31
1
How do I "normalise" a power spectral density
I have done a fair bit of spectral analysis, and hadn't finished collecting my thoughts for a reply, so hadn't replied yet.
What exactly do you mean by normalize?
I have not used the functons periodogram or spectrum, however from the description for periodogram it appears that it returns the spectral density, which is already normalized by frequency, so you don't have to worry about
2007 Aug 05
1
Selectively shading areas under two density curves
Dear Listers,
I am drawing a plot of two density curves, for male and female incomes. I would
like to shade/hatch/color (whatever) the areas under the curves which are
distinctive for each gender. This is the code I have tried so far:
m <- density(topmal.d$y, bw = "sj")
f <- density(topfem.d$y, bw = "sj")
par(mfrow = c(1,1))
plot(x = c(0,400), y = c(0,0.02), type =