similar to: hatvalues?

Displaying 20 results from an estimated 100 matches similar to: "hatvalues?"

2009 Nov 08
2
influence.measures(stats): hatvalues(model, ...)
Hello: I am trying to understand the method 'hatvalues(...)', which returns something similar to the diagonals of the plain vanilla hat matrix [X(X'X)^(-1)X'], but not quite.  A Fortran programmer I am not, but tracing through the code it looks like perhaps some sort of correction based on the notion of 'leave-one-out' variance is being applied. Whatever the
2007 Nov 28
2
fit linear regression with multiple predictor and constrained intercept
Hi group, I have this type of data x(predictor), y(response), factor (grouping x into many groups, with 6-20 obs/group) I want to fit a linear regression with one common intercept. 'factor' should only modify the slopes, not the intercept. The intercept is expected to be >0. If I use y~ x + factor, I get a different intercept for each factor level, but one slope only if I use y~ x *
2012 Feb 09
1
passing an extra argument to an S3 generic
I'm trying to write some functions extending influence measures to multivariate linear models and also allow subsets of size m>=1 to be considered for deletion diagnostics. I'd like these to work roughly parallel to those functions for the univariate lm where only single case deletion (m=1) diagnostics are considered. Corresponding to stats::hatvalues.lm, the S3 method for class
2008 Nov 20
2
Identify command in R
Hi all, In using the identify command, I get the following message > plot(hatvalues(scireg3)) > abline(h=.0154,lty=2) # plots a reference line at (k + 1)/n > identify(1:1165, hatvalues(scireg3),row.names(sciach)) Error in xy.coords(x, y) : 'x' and 'y' lengths differ which doesn't allow me to see the observation number when I scroll over with the mouse. What
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 >
2007 Oct 19
2
In a SLR, Why Does the Hat Matrix Depend on the Weights?
I understand that the hat matrix is a function of the predictor variable alone. So, in the following example why do the values on the diagonal of the hat matrix change when I go from an unweighted fit to a weighted fit? Is the function hatvalues giving me something other than what I think it is? library(ISwR) data(thuesen) attach(thuesen) fit <- lm(short.velocity ~ blood.glucose)
2008 Nov 20
2
Identify command in R]
Let me try to be more specific. The x y coordinates are different because of NAs in the dataset. In this analysis, a set of hat values (a measure of influence in regression) is given for each observation. On the basis of the regression that was run to get these hat values, the sample size was 1164 (one removed due to NA). The length of the data set is 1165. If I remove the NA from the
2003 Jul 12
1
Problem with library "car"
I am using the Unix version of R (version 1.7.0), installed via fink on a G4 Macintosh. I recently upgraded from version 1.6.0 and found that the "car" library now has a problem: ---Begin transcript--- >library(car) Attaching package 'car': The following object(s) are masked from package:base : dfbeta dfbeta.lm dfbetas dfbetas.lm hatvalues hatvalues.lm
2006 Jan 12
1
Firths bias correction for log-linear models
Dear R-Help List, I'm trying to implement Firth's (1993) bias correction for log-linear models. Firth (1993) states that such a correction can be implemented by supplementing the data with a function of h_i, the diagonals from the hat matrix, but doesn't provide further details. I can see that for a saturated log-linear model, h_i=1 for all i, hence one just adds 1/2 to each count,
2009 Apr 06
6
Need help in calculating studentized residuals/leverage values of non-linear model [nls()]
Hi there, I hope I can get advice regarding the calculation of leverage values or studentized residual values of a non-linear regression model. It seems like rstudent() does not work on a nls object. Many thanks in advance! Best regards, Xingli
2011 Jun 24
3
Error using betareg
Dear all, I get an error using betrag on this data set :http://dl.dropbox.com/u/1866110/dump.csv. I run it like this regression f2.1=betareg(Y~X1+X2,data=dump) summary(f2.1) I get : Call: betareg(formula = Y ~ X1 + X2, data = dump) Standardized weighted residuals 2: Error in quantile.default(x$residuals) : missing values and NaN's not allowed if 'na.rm' is FALSE In addition:
2016 Apr 10
0
R.squared in summary.lm with weights
Martin - Thanks, but although hatvalues() is useful for calculating PRESS, I can't find anything directly relevant to my question in the influence help pages. After some burrowing in the literature I'm doubting there is an answer out there (PRESS R^2 is always presented in a fairly ad hoc way). This is a new topic, as you say, and perhaps better handled on a statistics list. Murray Efford
2016 Apr 09
2
R.squared in summary.lm with weights
>>>>> Murray Efford <murray.efford at otago.ac.nz> >>>>> on Fri, 8 Apr 2016 18:45:33 +0000 writes: > Thanks for these perfectly consistent replies - I didn't > understand the purpose of m = sum(w * f/sum(w)) and saw it > merely as a weighted average of the fitted values. My > ultimate concern is how to compute an appropriate
2016 Apr 10
2
R.squared in summary.lm with weights
> On Apr 10, 2016, at 3:11 AM, Murray Efford <murray.efford at otago.ac.nz> wrote: > > Martin - > Thanks, but although hatvalues() is useful for calculating PRESS, I can't find anything directly relevant to my question in the influence help pages. After some burrowing in the literature I'm doubting there is an answer out there (PRESS R^2 is always presented in a fairly
2013 May 01
1
Trouble with methods() after loading gdata package.
Greetings to r-help land. I've run into some program crashes and I've traced them back to methods() behavior after the package gdata is loaded. I provide now a minimal re-producible example. This seems bugish to me. How about you? dat <- data.frame(x = rnorm(100), y = rnorm(100)) lm1 <- lm(y ~ x, data = dat) methods(class = "lm") ## OK so far library(gdata)
2006 Aug 31
1
NaN when using dffits, stemming from lm.influence call
Hi all I'm getting a NaN returned on using dffits, as explained below. To me, there seems no obvious (or non-obvious reason for that matter) reason why a NaN appears. Before I start digging further, can anyone see why dffits might be failing? Is there a problem with the data? Consider: # Load data dep <-
2016 Apr 10
0
R.squared in summary.lm with weights
> On Apr 10, 2016, at 9:38 AM, David Winsemius <dwinsemius at comcast.net> wrote: > >> >> On Apr 10, 2016, at 3:11 AM, Murray Efford <murray.efford at otago.ac.nz> wrote: >> >> Martin - >> Thanks, but although hatvalues() is useful for calculating PRESS, I can't find anything directly relevant to my question in the influence help pages. After
2004 Apr 08
1
R/Splus code for PRESS?
Dear R-help, Does anybody know where can I find R/Splus code for computing PREdiction Sum of Squares (PRESS) in a linear regression model? I have a large regression model (~100 predictors, ~30,000 cases) and good prediction is the main goal. I remember there is a faster way to compute it (no need to repeatedly fit models), but if there is existing code...... Thanks. Mai Z
2003 Nov 03
1
Questions in R
Hello, I have 4 questions in R and I am looking for 4 answers! the questions are the below: 1) is there a function in R for the Least Significant Difference method for multiple comparisons? 2) Is there a function in R that gives me the studentized deleted residuals and the leverage points? 3) is there a way that I could create a link in a program of mine, so as to select an option when my program
2005 Jul 14
0
Pearson dispersion statistic
Thank you for your reply. I am aware of the good reasons not to use the deviance estimate in binomial, Poisson, and gamma families. However, for the inverse Gaussian, the choice seems to me less clear cut. So I just wanted to compare two different options. I have used the dispersion parameter to compute the standardized deviance residuals: summary(model.gamma)$deviance.resid