Displaying 20 results from an estimated 2000 matches similar to: "superimpose density line over hist"
2005 Dec 13
8
superimpose density line over hist
Hi all,
I'm trying to superimpose a rchisq density line over a histogram with
something like:
hist(alnlength)
lines(density(rchisq(length(alnlength), 4)),col="red")
But the rchisq line won't appear anywhere,
Anyone knows what I am missing here?
Thanks in advance,
Albert.
1999 Aug 31
1
Suggestion for qqplot() improvement
>>>>> On Tue, 31 Aug 1999 14:57, Werner Stahel <stahel@stat.math.ethz.ch> said:
WSt> Here is a suggestion. It seems that qqplots, comparing a sample
WSt> to a distribution other than the normal, are not explicitly
WSt> available in S or R. I found
(in S-plus / Trellis it is, see below)
WSt> qqplot(y, rt(300, df = 5))
WSt> as an
2012 May 11
1
identify() doesn't return "true" numbers
Dear R community.
I am using the identify() function to identify outliers in my dataset.
This is the code I am using:
####################################################################
# Function to allow identifying points in the QQ plot (by mouseclicking)
qqInteractive <- function(..., IDENTIFY = TRUE)
{
qqplot(...) -> X
abline(a=0,b=1)
if(IDENTIFY) return(identify(X))
2002 Jan 08
0
chi square and mahalanobis
Hi all.
I am seeking for a statistical suggestion.
My data set comprises 382 measures each having 169 variables. Each measure
is the outcome of a nuclear magnetic resonance experiment, so each of the
169 points has the same unit.
As I want to do some multivariate calibration using these data, I checked
whether some multivariate outliers existed. I calculated Mahalanobis
distances and did a
2004 Aug 10
0
Check failed after compilation (PR#7159)
Full_Name: Madeleine Yeh
Version: 1.9.1
OS: AIX 5.2
Submission from: (NULL) (151.121.225.1)
After compiling R-1.9.1 on AIX 5.2 using the IBM cc compiler, I ran the
checks. One of them failed. Here is the output from running the check solo.
root@svweb:/fsapps/test/build/R/1.9.1/R-1.9.1/tests/Examples:
># ../../bin/R --vanilla < stats-Ex.R
R : Copyright 2004, The R
2006 Oct 25
1
Drawing a reference line for a qqplot with reference to Weibull distribution
Hi,
I'm trying to create a qqplot with reference to a Weibull distribution
including a reference line. This is my current code:
lights.data <- scan("lights.dat")
#Generate Weibull quantiles
prob.grid <- ppoints(length(lights.data))
prob.quant <- qweibull(prob.grid , 1.5,4)
#Draw QQ plot
qqplot(prob.quant,lights.data)
#add red reference line
qqline(lights.data,col = 2)
2011 Nov 16
2
outlier identify in qqplot
Dear Community,
I want to identify outliers in my data. I don't know how to use identify
command in the plots obtained.
I've gone through help files and use mahalanobis example for my purpose:
NormalMultivarianteComparefunc <- function(x) {
Sx <- cov(x)
D2 <- mahalanobis(x, colMeans(x), Sx)
plot(density(D2, bw=.5), main="Squared Mahalanobis distances, n=nrow(x),
2010 Aug 17
2
plotting functions of chi square
Hi! This is going to be a real newbie question, but I can't figure it out.
I'm trying to plot densities of various functions of chi-square. A simple
chi-square plot I can do with dchisq(). But e.g. chi.sq/degrees of freedom I
only know how to do using density(rchisq()/df). For example:
plot(1, type="n", xlab="", ylab="", xlim=c(0,2), ylim=c(0,7))
for (i
2005 Feb 03
0
Displaying a distribution -- was: Combining two histograms
I am immediately reminded of something I read which goes
"A sufficiently trained statistician can read the vagaries of a Q-Q plot like a sharman can read a chicken's entrails, with a similar recourse to scientific principles. Interpreting Q-Q plots is more a visceral than an intellectual exercise. The uninitiated are often mystified by the process. Experience is the key here."
2006 Jul 01
1
noncentral F-distributed random numbers (PR#9055)
Full_Name: Long Qu
Version: 2.3.1
OS: Windows XP
Submission from: (NULL) (64.113.93.235)
The QQ-plot of two versions of simulating noncentral F-distributed random
numbers has quite different scales:
> qqplot(rf(1000,2,15,3),qf(runif(1000),2,15,3))
The rf() function reads:
> rf
function (n, df1, df2, ncp = 0)
{
if (ncp == 0)
.Internal(rf(n, df1, df2))
else rchisq(n, df1,
2010 Nov 30
1
rcauchy density distribution
Hello, I'm taking samples from certain distributions and drawing a density
distribution over the histogram of the samples
It works fine for the chi-square and for the normal, but not for the cauchy. Any
idea what I'm doing wrong? Thanks
x <- rchisq(10000, df = 4)
hist(x, freq = FALSE, breaks=100)
curve(dchisq(x, df = 4), col = 2, add = TRUE)
x <- rnorm(10000)
hist(x, freq =
2010 Mar 27
5
producing a QQ plot.
Hello everyone I'm a beginner in Stats and R, I'm using R 2.10.1. I need to
create a multivariate qq plot, there is 8 variable group with each has 55
number of input. An example of what I did so far, just to get my point out:
> data=read.csv(file.choose(),header=T)
> data
country village group av_expen P2ary_ed no_fisher
1 Cook Islands Aitutaki D
2000 Dec 14
2
Accuracy problem in dchisq for non-central chi-squared
Hi,
I think I have identified a inaccuracy in dchisq when the non-centrality
parameter is non-zero and large. Here's a little test:
sys.dchisq.test <- function(N = 100000,mean = 0)
{
z <- rnorm(N,mean = mean, sd = 1)
x <- z^2
xmin <- min(x)
xmax <- max(x)
br <- seq(xmin,xmax,length = 101)
dbr <- br[2]-br[1]
hist(x,br)
p <- dchisq(br,df = 1,ncp =
2008 Apr 01
1
superimpose histogram on biplot
Hi all,
I've been trying to figure out how to superimpose a histogram on a
biplot that shows the relative contribution of each axis. I have
been using the NIPALS function (http://biomserv.univ-lyon1.fr/~dray/
files/softwares/nipals.R) to run principal component analyses. Here
is a toy example.
source("http://biomserv.univ-lyon1.fr/~dray/files/softwares/nipals.R")
2011 Nov 28
1
Superimpose two graphs
Dear R users,
I want to superimpose two graphs as well as ensure that they should have
same scale with same x & y axis.
I am using following command but it does not ensure same scale.
*pdf(file = "../RESULTS/RS1.simulated.pdf", width = 10, height =6)*
*plot(Reserves.RS, col = 1:2, screen = 1)*
*par(new= TRUE)*
*barplot(RS.active, axes = FALSE)*
*dev.off()*
*
*
Regards
Vikram
2005 Nov 29
1
Superimpose Histograms
Hi all,
I have data which is represented as a histogram and want to add more
data / another histogram to this plot using another color. That is I
need to superimpose multiple histograms.
But have no idea how to do this.
Can anybody please give me a hint?
Thanks,
Andreas
--
Andreas Wilm
Institut fuer Physikalische Biologie
Heinrich-Heine-Universitaet Duesseldorf
2009 Jul 02
1
superimpose multiple scatterplot matrices
Dear R- experts,
I am trying to superimpose two or more scatterplot matrices generated by pairs() to visualize the differences over each datasets, but have not been very successful. Two data frames, df1 and df2 for example, each has the same five variables in columns.
My goal is to paint each dataset with a color on the same plot panel for each pair of the five variables.
That is, in this
2010 Jan 21
1
superimpose histogram and fitted gamma pdf
Hi r-users,
I try to draw histogram (in terms of probabilty) and superimpose with the gamma pdf. Using this code below I can get the plots BUT the y scale for the density is out of scale. How do I change the y-axis scale to max 1? Another thing, how I do draw smooth line rather that points?
Nota that my observed data is hume_pos and the fitted data is rgam1.
hist(hume_pos,prob=TRUE)
2011 Sep 01
0
qqplot for count data
Dear list,
I just tried to do the same thing, and did not find anything on a
weighted qqplot. My weights are actually counts (positive integers).
Here is a modification of qqplot, following Duncan Murdoch's
suggestion. Any feedback would be welcome!
Thanks,
Jean-Christophe
weighted.qqplot <- function (x, y,
plot.it = TRUE, xlab = deparse(substitute(x)),
ylab = deparse(substitute(y)),
1999 Jun 07
0
How to superimpose a histogram and density plot
NCSS has a nice plot of the histogram and density plot superimposed. The
S-PLUS 4 Guide to Statistics on page 45 suggests the following code for a
general purpose density plot for a vector named data
iqd <- summary(data)[5]-summary(data)[2]
plot(density(data,width=2*iqd),xlab="x",ylab="",type="l")
Is it possible to superimpose the density plot on a histogram