Displaying 20 results from an estimated 700 matches similar to: "plot.lm: "Cook's distance" label can overplot point labels"
2009 Mar 01
0
Wishlist for plot.lm() (PR#13560)
Full_Name: John Maindonald
Version: R-2.8.1
OS: MacOS X 10.5.6
Submission from: (NULL) (203.173.3.75)
The following code demonstrates an annoyance with plot.lm():
library(DAAGxtras)
x11(width=3.75, height=4)
nihills.lm <- lm(log(time) ~ log(dist) + log(climb), data = nihills)
plot(nihills.lm, which=5)
OR try the following
xy <- data.frame(x=c(3,1:5), y=c(-2, 1:5))
plot(lm(y ~ x,
2008 Nov 18
1
legend color problems
Hello R-folks,
I don't get the color of the legend in a lattice-plot right. I select a palette from RColorBrewer and use it in the barchart plot.
The resulting graph shows the new palette in the graph, but in the legend rectangles the standard palette is used. Adding a col argument into auto.key uses the new palette
with the legend text, but not in the rectangle fill.
What am I missing?
2008 Nov 20
1
Repost:lattice graphics -- legend color problems
Hello R-folks,
I don't get the color of the legend in a lattice-plot right.
I select a palette from RColorBrewer and use (with a col = mypalette argument) it in the barchart plot.
The resulting graph shows the new palette in the graph, but uses the standard palette in the legend rectangles.
Adding a col argument into auto.key uses the new palette
with the legend text, but not in the
2013 Jan 29
1
problem wih plotrix:cluster.overplot
Hello,
I am trying to use cluster.overplot from package plotrix and I get an error message when I add the "away" parameter:
require(plotrix)
distance <- read.table("distance.txt")
cmd <- cmdscale(distance)
cp <- cluster.overplot(cmd, away=2)
Error in if (sum(overplots) > 1) { :
missing value where TRUE/FALSE needed
If I don't use "away",
2006 Oct 24
1
Cook's Distance in GLM (PR#9316)
Hi Community,
I'm trying to reconcile Cook's Distances computed in glm. The
following snippet of code shows that the Cook's Distances contours on
the plot of Residuals v Leverage do not seem to be the same as the
values produced by cooks.distance() or in the Cook's Distance against
observation number plot.
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
2013 Mar 12
1
Cook's distance
Dear useRs,
I have some trouble with the calculation of Cook's distance in R.
The formula for Cook's distance can be found for example here:
http://en.wikipedia.org/wiki/Cook%27s_distance
I tried to apply it in R:
> y <- (1:400)^2
> x <- 1:100
> lm(y~x) -> linmod # just for the sake of a simple example
>
2005 Feb 11
1
cook's distance in weighted regression
I have a puzzle as to how R is computing Cook's distance in weighted linear
regression.
In
this case cook's distance should be given not as in OLS case by
h_ii*r_i^2/(1-hii)^2 divided by k*s^2 (1)
(where r is plain unadjusted residual, k is number of parameters in model,
etc. )
but rather by
w_ii*h_ii*r_i^2/(1-hii)^2 divided by k*s^2,
2013 Feb 15
0
CVlim
Can anyone help explain to me why the two codes below have different result? I thought I can use log(time)~. to replace log(time)~dist+climb+timef.I am using CVlm from DAAG package. I think nihills is preloaded with the package. Thanks in advance.
> CVlm(df=nihills, form.lm=formula(log(time)~.),plotit="Observed",m=2)Analysis of Variance Table
Response: log(time) Df Sum Sq
2007 Mar 22
2
quick legend() question
Hi
I have a scatterplot of points with pch=1 and a single point with
pch=3, lwd=3.
It has a high line width to attract attention to it.
The following script
plot(rnorm(10),rnorm(10),col="black")
points(rnorm(10),rnorm(10),col="red")
points(0,0,pch=3,lwd=3)
if(TRUE){
legend("bottomleft",c("a","b","Truth"),pch=c(1,1,3),col=c
2003 Dec 03
5
add a point to regression line and cook's distance
Hi,
This is more a statistics question rather than R question. But I thought people on this list may have some pointers.
MY question is like the following:
I would like to have a robust regression line. The data I have are mostly clustered around a small range. So
the regression line tend to be influenced strongly by outlier points (with large cook's distance). From the application
's
2006 Mar 10
2
Plot.date and legends
Hi:
I'm trying to plot dates on the x-axis of a code, but the legend is not being
displayed. I receive the following error:
Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", :
'arg' should be one of bottomright, bottom, bottomleft, left,
topleft, top, topright, right, center
In addition: Warning message:
longer
2006 Dec 03
0
overplot() examples fail (package:gplots)
require(gplots)
data(rtPCR)
overplot( RQ ~ Conc..ug.ml. | Test.Substance,
data=rtPCR,
subset=Detector=="ProbeType 7" & Conc..ug.ml. > 0,
same.scale=TRUE, log="xy", f=3/4,
main="Detector=ProbeType 7",
xlab="Concentration (ug/ml)",
ylab="Relative Gene Quantification"
)
# Error in lowess.default(mf[[-response]], mf[[response]], f = f,
2008 May 09
0
Incorrect fix for PR#9316: Cook's Distance & plot.lm
Bug PR#9316 noted an inconsistency between the Cook's distance contours
on plot.lm(x, which = 5) and the values given by cooks.distance(x) -- as
shown in plot.lm(x, which = 4) -- for glms:
http://bugs.r-project.org/cgi-bin/R/Analyses-fixed?id=9316;user=guest;selectid=9316
The suggested fix was to modify the contour levels by a dispersion
factor, implemented as follows:
dispersion <-
2010 Sep 22
1
legend
Hi,
there is a function to plot survival curves:
library(survival)
plot.KM <- function(survival, x, x_cut.off, main='', label='')
{
plot(survfit(survival ~ I(x >= x_cut.off)), main=main)
legend('bottomleft', c(expression(label >= x_cut.off),expression(label <
x_cut.off)))
}
Now, I need to determine as the argument what appears in the legend. I want
2000 Aug 18
0
cook's distance
Hi
Where can I find information about the cook's distance that appears in
the plot(lm.object) function ?
Thanks
ernesto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ernesto.vcf
Type: text/x-vcard
Size: 321 bytes
Desc: Card for José Ernesto Jardim
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20000818/1e5a8925/ernesto.vcf
2005 Jun 28
2
Producing character "given" i.e. "| " with plotmath
Hello!
Does someone know how to produce
L(y|mu)
with plotmath?
Some code with unsuccessfull results:
plot(dnorm(x = seq(from = -4, to = 4, by = 0.1)), type = "l")
## Not what I want
legend(legend = c(expression(L(y:mu))), x = "topright")
## Strange, is this a bug?
legend(legend = c(expression(L(y|mu))), x = "top")
## Group produces an error
legend(legend =
2011 Aug 11
1
legend position in interaction.plot
How do I move the legend from default position (right and within the plot)?to the "bottomleft" of the plot?
?
interaction.plot(YEAR, ID?GROWTH, legend=TRUE, col = 2:7,xlab="Year",
?????? ylim=c(0,2), ylab="Growth",leg.bty = "o")
Peter Maclean
Department of Economics
UDSM
2008 Jul 02
1
Multiple time series plots
Hi all:
I'm trying to plot two time series created in Rmetrics and label the
x-axis with dates. I tried the following:
dates <- as.Date(seriesPositions(x.agg))
r <- as.Date(range(dates))
ts.plot(x.agg@Data[,c(1,5)],gpars=list(ylab="Volume",
lty=c(1:2),xaxt="n",main="Plot of Volume"))
axis.Date(1, at=seq(r[1], r[2], length.out=10),
2010 Oct 30
1
two group cox model
Dear all,
I am doing
library(survival)
fit <- coxph(Surv(futime,fustat) ~ rx, ovarian)
plot(survfit(fit,newdata=ovarian),col=c(1,2))
legend("bottomleft", legend=c("rx = 0", "rx = 1"),
lty=c(1,2),col=c(1,2))
Is this correct to compare these two groups? Is the 0.31 the p-value that
the median f two groups are equal
Why lty does not work here?
Many thanks
2011 Jul 13
1
Smart legend ???
Hi, all:
Is there an automatic smart legend for R?
Since my R code is running in a row, which will produce a bunch of R plots
in a single run, some of the produced plots are really "ridiculous".
Because my legend is fixed to "topleft", sometimes, which occludes the key
parts of the figure/plots, but most of the time, the legend works just fine.
I'm wondering is there a