Displaying 20 results from an estimated 5000 matches similar to: "plot(<lm>): new behavior in R-2.2.0 alpha"
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,
2006 Jan 10
2
standardized residuals (rstandard & plot.lm) (PR#8468)
This bug is not quite fixed - the example from my original report now =
works using R-2.2.1, but
plot(Uniform, 6)
does not. The bug is due to
if (show[6]) {
ymx <- max(cook, na.rm =3D TRUE) * 1.025
g <- hatval/(1 - hatval) # Potential division by zero here #
plot(g, cook, xlim =3D c(0, max(g)), ylim =3D c(0, ymx),=20
main =3D main, xlab =3D
2005 Apr 23
3
Enhanced version of plot.lm()
I propose the following enhancements and changes to plot.lm(),
the most important of which is the addition of a Residuals vs
Leverage plot.
(1) A residual versus leverage plot has been added, available
by specifying which = 5, and not included as one of the default
plots. Contours of Cook's distance are included, by default at
values of 0.5 and 1.0. The labeled points, if any, are those
2011 Oct 31
1
Question on estimating standard errors with noisy signals using the quantreg package
Dear all,
My question might be more of a statistics question than a question on R,
although it's on how to apply the 'quantreg' package. Please accept my
apologies if you believe I am strongly misusing this list.
To be very brief, the problem is that I have data on only a random draw, not
all of doctors' patients. I am interested in the, say, median number of
patients of
2009 Feb 17
1
plot.lm: "Cook's distance" label can overplot point labels
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, data=xy), which=5)
The "Cook's distance" text overplots the label for the point with the
2008 Mar 09
1
Formula for whether hat value is influential?
I was wondering if someone might be able to tell me what formula R's
influence.measures function uses for determining whether the hat value
it computes is influential (i.e., the true/false value in the "hat"
column of the returned is.inf data frame). The reason I'm asking is
that its results disagree with what I've just learned in my statistics
class, namely that a point
2009 Jul 07
1
error: no such index at level 2
Hi,
I am confused about how to select elements from a list.
I'm trying to select all rows of a table 'crossRsorted' such that the
mean of a related vector is > 0. The related vector is accessible as
a list element l[[i]] where i is the row index.
I thought this would work:
> crossRsorted[mean(q[[ crossRsorted[,1] ]], na.rm = TRUE) > 0, ]
Error in q[[crossRsorted[, 1]]] :
2010 Apr 20
1
3D surface plot with wireframe or persp?
Hello Dear,
I have a function, like z=f(x,y), and try a surface plot with this function.
But, on the reference of "wireframe" requires data option, so I generated x
and y, and computed z with them. But, still I have a problem to draw a
surface plot. The code and errors are
##################################################
mle_beta0=64.43707;
mle_beta1=-24365.16;
# generating for
2000 Oct 26
1
competing risks survival analysis
I will have data in the following form:
Time resp type stim type
300 a A
200 b A
155 a B
250 b B
80 c A
1000 d B
...
c is left censored observation; d is right censored
This sort of problem is discussed in Chap 9 of Cox & Oakes Analysis of
Survival Data under the name
2002 Dec 10
3
clogit and general conditional logistic regression
Can someone clarify what I cannot make out from the
documentation?
The function 'clogit' in the 'survival' package is
described as performing a "conditional logistic regression".
Its return value is stated to be "an object of class clogit
which is a wrapper for a coxph object."
This suggests that its usefulness is confined to the sort of
data which arise in
2003 Aug 28
4
Cook-distance-type plot (vertical bars)
Hi,
Figure 13 of Emmanuel Paradis's "R for Beginners" was produced by termplot
working on an aov object. The lower right-hand plot is labelled "Cook's
distance plot", and I'd really like to produce a similar type of figure,
but in a totally different context. (I'm not even sure what this kind of
figure is called, perhaps an "impulse plot", where
2012 Jan 18
1
Non-linear Least Square Optimization -- Function of two variables.
Dear All,
In the past I have often used minpack (http://bit.ly/zXVls3) relying
on the Levenberg-Marquardt algorithm to perform non-linear fittings.
However, I have always dealt with a function of a single variable.
Is there any difference if the function depends on two variables?
To fix the ideas, please consider the function
f(R,N)=(a/(log(2*N))+b)*R+c*N^d,
where a,b,c,d are fit parameters.
For
2004 Apr 09
1
loess' robustness weights in loess
hi!
i want to change the "robustness weights" used by loess. these
are described on page 316 of chambers and hastie's "statistical models in S"
book as
r_i = B(e_i,6m)
where B is tukey's biweight function, e_i are the residulas, and m is the
median average distance from 0 of the residuals. i want to
change 6m to, say, 3m.
is there a way to do this? i cant
2008 May 14
0
Cook's Distance in GLM (PR#9316)
Well I suppose a warning's not going to hurt. Even in a case like the
occupationalStatus example where you know some points have been fitted
exactly, it might be useful to be reminded that the standardised
residuals for these points are then NaN and cannot be displayed. Of
course when you don't know in advance that this issue will arise, there
is even more reason to give a warning.
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)
2017 Jan 11
2
bug with strptime, %OS, and "."
On Tue, Jan 10, 2017 at 08:13:21PM -0600, Dirk Eddelbuettel wrote:
>
> On 10 January 2017 at 17:48, frederik at ofb.net wrote:
> | Hi R Devel,
> |
> | I just ran into a corner case with 'strptime'. Recall that the "%OS"
> | conversion accepts fractional seconds:
> |
> | > strptime("17_35_14.01234.mp3","%H_%M_%OS.mp3")$sec
> |
2017 Jan 11
4
bug with strptime, %OS, and "."
Hi R Devel,
I just ran into a corner case with 'strptime'. Recall that the "%OS"
conversion accepts fractional seconds:
> strptime("17_35_14.01234.mp3","%H_%M_%OS.mp3")$sec
[1] 14.01234
Unfortunately for my application it seems to be "greedy", in that it
tries to parse a decimal point which might belong to the rest of the
format:
>
2010 Feb 21
1
tests for measures of influence in regression
influence.measures gives several measures of influence for each
observation (Cook's Distance, etc) and actually flags observations
that it determines are influential by any of the measures. Looks
good! But how does it discriminate between the influential and non-
influential observations by each of the measures? Like does it do a
Bonferroni-corrected t on the residuals identified by
2006 Jul 05
1
read.table() errors with tab as separator (PR#9061)
(1) read.table(), with sep="\t", identifies 13 our of 1400 records,
in a file with 1400 records of 3 fields each, as having only 2 fields.
This happens under version 2.3.1 for Windows as well as with
R 2.3.1 for Mac OS X, and with R-devel under Mac OS X.
[R version 2.4.0 Under development (unstable) (2006-07-03 r38478)]
(2) Using read.table() with sep="\t", the first 1569
2001 Oct 18
1
seq (PR#1133)
In the following special case, seq fails to give the right answer
(which is 0 )
> seq(0,0,1)
Error in if (dd < sqrt(.Machine$double.eps)) return(from) :
missing value where logical needed
For any other equal from and to , it works:
> seq(1,1,1)
[1] 1
The error occurs in the statement
dd <- abs(del)/max(abs(to), abs(from))
of seq.default -- for obvious reasons.