similar to: Question about do.call()

Displaying 20 results from an estimated 60000 matches similar to: "Question about do.call()"

2007 Nov 15
2
Normalizing data
Hello, I have a data set of about 300.000 measurements made by an STM which should apporximately fix a normal (Gaussian) distribution. I have imported the data in R and used plot(density()) to get a nice plot of the distribution which in fact looks like a real Gaussian. However, the integral over the surface is not equal to one (I know since some of the plots extend to numbers greater then 1). Is
2003 Oct 31
4
dnorm() lead to a probability >1
Howdee, One of my student spotted something I can't explain: a probability >1 vs a normal probability density function. > dnorm(x=1, mean=1, sd=0.4) [1] 0.9973557 > dnorm(x=1, mean=1, sd=0.39) [1] 1.022929 > dnorm(x=1, mean=1, sd=0.3) [1] 1.329808 > dnorm(x=1, mean=1, sd=0.1) [1] 3.989423 > dnorm(x=1, mean=1, sd=0.01) [1] 39.89423 > dnorm(x=1, mean=1, sd=0.001) [1]
2007 Apr 05
1
Plotting multiple curves with lattice graphs
Hi List, I would like to plot multiple curves (parametric density curves) in one plot. For example: # parameters for three normal density curves parms = data.frame(ID=c(1,2,3),mu=c(50,55,60),sigma=c(10,12,15)) # I can easily draw three normal density curves using curve(): curve(dnorm(x,mean=parms$mu[1],sd=parms$sigma[1]),from=0, to=150, ylab="density", col="red")
2009 Sep 24
1
Fw: Re: Multiple Normal Curves
Sorry about the subject --- On Thu, 24/9/09, KABELI MEFANE <kabelimefane@yahoo.co.uk> wrote: From: KABELI MEFANE <kabelimefane@yahoo.co.uk> Subject: Re: [R] Multiply Normal Curves To: R-help@r-project.org Date: Thursday, 24 September, 2009, 11:48 AM R -helpers   i have been trying to do this problem without must success,i managed to do a graph for x, but it is not what i want to
2009 Sep 24
0
Fw: Simulating and Plotting
R -helpers   i have been trying to do this problem without must success,i managed to do a graph for x, but it is not what i want to define. I have also been able to do simple rendom sample. If possible can someone help here is the code for the graph pleae help   data.frame(ID=c(1,2,3),mu=c(10000,34000,50000),sigma=c(2000,3000,5000)) curve(dnorm(x,mean=parms$mu[1],sd=parms$sigma[1]),from=2000,
2009 Sep 24
0
Multiply Normal Curves
R -helpers   i have been trying to do this problem without must success,i managed to do a graph for x, but it is not what i want to define,(i want to specify number of observations as well). I have also been able to do simple rendom sample.   data.frame(ID=c(1,2,3),mu=c(10000,34000,50000),sigma=c(2000,3000,5000)) curve(dnorm(x,mean=parms$mu[1],sd=parms$sigma[1]),from=2000, to=80000,
2005 Feb 24
2
bug report for as.function (PR#7702)
Hi, I got the following message in R: Error in as.function.default(pdfs[1]) : invalid body argument for "function" Should NEVER happen; please bug.report() [mkCLOSXP] Operating System: Windows XP (SP2) R version: R-2.0.1 Code causing error follows: # create two probability density functions for mixtures of normal distibutions fmix1 <- function(x) {dnorm(x, mean=4, sd=2) * 0.5 +
2012 Jun 27
1
lattice histogram log and non log values
Hello all, Please consider the following library(lattice) Colors. <-rep(brewer.pal(7, "Dark2"),2) color <- 1 Data.X.. <- data.frame(UnitArea = c(rnorm(1000), rnorm(1000)), Type = c(rep("Base",1000),rep("Log",1000))) histogram( ~ UnitArea | Type, data = Data.X.., xlab = "Unit Area", type = "density", panel =
2010 Aug 13
1
Lattice: Superimposing histograms with different colors and transparency effects
Dear users, I would like to plot several histograms superimposed on the same panel with different colors, with superimposed polygons appearing with transparency effects. I also want estimated densities to appear on the same plot. For several reasons, including that I like it, I want to use the lattice package. I have several questions regarding the use of the 'histogram' function with a
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
2005 Jan 07
0
Help in customising the NLS function to spit out mean and SD ofnew fit!!
Doesn't look like nonparametric fit to me, since nls() is used to fit to a gaussian density, so the result is a gaussian density (with estimated parameter). What I do not understand is why people would do this. This is not the first time I've seen people doing this, on both R-help and S-news (if my memory is still any good). If the objective is to fit a Gaussian distribution to the
2007 Mar 23
0
plotting dnorm() issued from mclust models
Dear all I have a problem in fitting lines() of the normal distributions identified with Mclust on a histogram or a mclust1Dplot. Here is some sample code to explain : set.seed(22) foo <- c(rnorm(400, 10, 2), rnorm(500, 17, 4)) mcl <- Mclust(foo, G=2) mcl.sd <- sqrt(mcl$parameters$variance$sigmasq) mcl.size <- c(length(mcl$classification[mcl$classification==2]),
2008 May 31
2
How to add space between main title to leave space for legend?
Hello, everybody: I recently encountered an example with in which the graph was placed in a way that did not leave room for a legend. Maybe you would describe it as "legend too big", I'm not sure. I found myself wishing I could force in some space after the title. Here's working example where I'd like to make room for a legend. x <- rnorm(100) hist(x, freq=F,
2001 Oct 23
0
problems with postscript device
Hola! I am producing postscript output from R (windows 98), both using firts the windows devicd and then " copy to postscript", or using the postscript device directly. The problem shows up equally both ways. The function producing the plot is given below. The only difference I can see with this function and other I have producing plots, is that this uses split.screen(). I include the
2010 Jul 13
1
dnorm Line Plot Graphics
Hello, 1. I have a number of snow depth measurements (centimeters depth) that were acquired in a row (linear transect). A: I am trying to plot the probability density function (PDF) of these points. When I use the "dnorm" command and line type = points, the PDF is displayed correctly. When I change the line type = line, it displays the PDF curve with numerous lines connecting multiple
2004 Jul 06
3
Code density functions
Hello I would like to see the algorithm that R uses to generate density functions for several distributions (i.e. Normal,Weibull, etc). I tried: >dnorm function (x, mean = 0, sd = 1, log = FALSE) .Internal(dnorm(x, mean, sd, log)) <environment: namespace:stats> How can I see the code used for densities? Thanks!
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 Sep 25
2
Can't mix high level and low level plot functions.
Hey R-Comunity, I'd like to print out an histogram of some experimental data and add a smooth curve of a normal distribution with an ideally generated population having the same mean and standard deviation like the experimental data. The experimental data is set as vector x and its name is set to group.name. I paint the histogram as follows: hist(data, freq=FALSE,
2001 Oct 26
1
postscript problem (PR#1147)
I reported this earlier, and have got reports that others have the same promlem on UNIX machines, so it is not only a windows problem S I file a bug report. The function (boot.stat) given at the end produces a postscript file, which cannot be included correctly in LaTeX. Specifically, the image in LaTeX (when translated by dvips to postscript) becomes very small, not using the bounding box, and
2010 Feb 19
1
"Legend" question
Hi, I want to get a histogram with the legend for my data. I drew a normal density curve and kernel density curve in the histogram, and I also label mean and median in the X axis. From the code, I got two legend: One shows "Normal Density" and "Kernel Density" and their corresponding lines, the other shows "Mean = value" and "Median = value" and their