similar to: Bug in glm.fit() or plot.lm() (PR#778)

Displaying 20 results from an estimated 10000 matches similar to: "Bug in glm.fit() or plot.lm() (PR#778)"

2013 Oct 15
1
Q-Q plot scaling in plot.lm(); bug or thinko?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've been looking fairly carefully at the Q-Q plots produced by plot.lm() and am having difficulty understanding why plot.lm() is doing what it's doing, specifically scaling the standardized residuals by the prior weights. Can anyone explain this to me ... ? Multiplying by the weights seems to give the wrong plot, at least for binomial
2013 Sep 10
1
[PATCH] show vector length in summary()
(summary.default): show the vector length in addition to quantiles diff -u -i -p -F '^(def' -b -w -B /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old /home/sds/src/R-3.0.1/src/library/base/R/summary.R --- /home/sds/src/R-3.0.1/src/library/base/R/summary.R.old 2013-03-05 18:02:33.000000000 -0500 +++ /home/sds/src/R-3.0.1/src/library/base/R/summary.R 2013-09-10 10:19:02.682946339
2013 Apr 05
1
mixed formatting of integer and numeric (e. g., by summary.default())
Hello, eveRybody, I've been trying to find the origin for the following formatting-"inconsistency": E. g., look at the number of digits in summary.defaults()'s output when NAs occur: in my example below the number of NA's is displayed as an integer, the rest as numeric (floating point numbers): > summary.default( c( 1:2, NA)) Min. 1st Qu. Median Mean 3rd Qu.
2010 Oct 04
1
Help with apply
Suppose I have the following data: tmp <- data.frame(var1 = sample(c(0:10), 3, replace = TRUE), var2 = sample(c(0:10), 3, replace = TRUE), var3 = sample(c(0:10), 3, replace = TRUE)) I can run the following double loop and yield what I want in the end (rr1) as: library(statmod) Q <- 2 b <- runif(3) qq <- gauss.quad.prob(Q, dist = 'normal', mu = 0, sigma=1) rr1 <- matrix(0,
2016 Feb 08
1
Apparent bug in summary.data.frame() with columns of Date class and NA's present
Hi all, Based upon an exchange with G?ran Brostr?m on R-Help today: https://stat.ethz.ch/pipermail/r-help/2016-February/435992.html there appears to be a bug in summary.data.frame() in the case where a data frame contains Date class columns that contain NA's and other columns, if present, do not. Example, modified from R-Help: x <- c(18000000, 18810924, 19091227, 19027233, 19310526,
2005 Apr 28
3
have to point it out again: a distribution question
Stock returns and other financial data have often found to be heavy-tailed. Even Cauchy distributions (without even a first absolute moment) have been entertained as models. Your qq function subtracts numbers on the scale of a normal (0,1) distribution from the input data. When the input data are scaled so that they are insignificant compared to 1, say, then you get essentially the
2010 Nov 14
1
Integrate to 1? (gauss.quad)
Does anyone see why my code does not integrate to 1? library(statmod) mu <- 0 s <- 1 Q <- 5 qq <- gauss.quad(Q, kind='hermite') sum((1/(s*sqrt(2*pi))) * exp(-((qq$nodes-mu)^2/(2*s^2))) * qq$weights) ### This does what's it is supposed to myNorm <- function(theta) (1/(s*sqrt(2*pi))) * exp(-((theta-mu)^2/(2*s^2))) integrate(myNorm, -Inf, Inf)
2009 May 30
2
Simple.lm
Hi , I am struggling with two problems : 1. simple.lm - where do i find the package that installs that ... i have a looked on the help files and it says simple .... but when i go to cran through load.packages() it does not come up ? 2. whenever I use qq.plot through library(car) it mentions i need a graphics device ? perhaps you could me there as i loaded a graphics device and got an error .,
2005 Sep 13
4
plot(<lm>): new behavior in R-2.2.0 alpha
As some of you R-devel readers may know, the plot() method for "lm" objects is based in large parts on contributions by John Maindonald, subsequently "massaged" by me and other R-core members. In the statistics litterature on applied regression, people have had diverse oppinions on what (and how many!) plots should be used for goodness-of-fit / residual diagnostics, and to my
2000 Feb 24
2
(-1 as index) OR (envelope for QQ)
I'm new to R (and to S) and am wondering about code from pages 72 and 83 of MASS (Venables+Ripley, 3rd edition), to draw an envelope on a QQ plot. Copying from the book, I've got: #... code whose gist is "a.fit <- nls(..." num.points <- length(resid(a.fit)) qqnorm(residuals(a.fit)) # illustrate data-model residuals qqline(residuals(a.fit)) samp <-
2001 Jun 07
2
once more: methods on missing data
Thanks for replies, but i was not precise enough. The problem is not evaluating statistics on data with NA values. The problem is evaluation of statistics on data with length = 0. To make the problem more clear this is what i tried: This works fine: tapply(as.numeric(c(NA,2)), as.factor(c("a","b")), summary) But i need SDev, aswell, so i copied summary.default to
2010 Jun 21
1
Interpreting lm Residuals...
I am using the lm function in R to fit several linear models to a fair-sized dataset (~160 collections of ~1000 data points each). My data have intrinsic, systematic uncertainty much greater than the measurement errors on any individual point. My thought is to use the residuals of my linear fits to quantify this intrinsic uncertainty, but I am puzzled over the correct interpretation of R's
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
2018 May 11
0
Bug in plot.lm function (stats package): positioning of labels for extreme points.
Hi, ==================== Reproducible example: ==================== data(Animals, package="MASS") # interesting dataset # Run model lm1 <- lm(log10(body)~log10(brain), data=Animals) # Setup 2x2 graphics device par(mfrow=c(2,2)) # Plot diagnostics, label the two most "extreme" points based on magnitude of residuals plot(lm1, id.n=2) ==============================
2002 Dec 08
3
strange QQ-Plot
Hi, i am working on a data set with EDA. That includes QQ-Plots of residuals vs expected normal distribution. What puzzles me is that the range of ordinate and abscissae is so different: while the theoretical quantiles range from [-2, 2] the sample quantiles on the ordinate do extent from [-20, 50]. Quite obviously some kind of transformation is done. Although i intensively RTFM i could not
2008 Aug 15
2
Design-consistent variance estimate
Dear List: I am working to understand some differences between the results of the svymean() function in the survey package and from code I have written myself. The results from svymean() also agree with results I get from SAS proc surveymeans, so, this suggests I am misunderstanding something. I am never comfortable with "I did what the software" does mentality, so I am working to
2012 May 09
1
QQplots format
Dear R help, I tried to plot two qq plots in the same window using the code below.? Somehow it is plotting only one at a time.?? I borrowed the print function from xyplot. ? pdf("QQplotCorrUncorr.pdf") qq1<-qqPlot(residuals(fm), main="QQ plot for Correlated Model") qq2 <-qqPlot(residuals(fma), main="QQ plot for Uncorrelated Model") print(qq1, pos = c(0.0,
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
2010 Sep 29
1
nlminb and optim
I am using both nlminb and optim to get MLEs from a likelihood function I have developed. AFAIK, the model I has not been previously used in this way and so I am struggling a bit to unit test my code since I don't have another data set to compare this kind of estimation to. The likelihood I have is (in tex below) \begin{equation} \label{eqn:marginal} L(\beta) = \prod_{s=1}^N \int
2003 Aug 15
6
plot.lm mislabels points with na.exclude (PR#3750)
R 1.7.1 on Windows XP The "normal Q-Q plot" produced by plot.lm() mislabels points when the model is fitted using na.action=na.exclude. Example: x <- 1:50 y <- x + rnorm(50) y[c(5,10,15)] <- NA # insert some NA's y[40] <- 50 # add an outlier plot(lm(y ~ x, na.action=na.omit)) # outlier correctly labeled in all # four plots