Displaying 20 results from an estimated 500 matches similar to: "X'W in Matrix"
2006 May 03
1
Inverse X'WX matrix from weighted linear regression
Dear list,
how can I compute the inverse of the X'WX matrix ("inverse of the weighted sum of squares and crossproducts matrix") from an object of class "lm" from a weigthed linear regression?
Thanks, Sven
2011 Jan 20
1
predict() for bootstrapped model coefficients
I run a multinomial regression on a data set with an outcome that
has three values. First, I build an initial model, b.mod. Then I
run a loop to bootstrap the coefficients. For the initial model,
using "predict()", I can print the wrong/false predictions table.
But how do I get this table (that is, the predictions) for the
bootstrapped model? Thanks for hints, *S*
df <-
2007 Apr 12
1
Question on ridge regression with R
Hi,
I am working on a project about hospital efficiency. Due to the high
multicolinearlity of the data, I want to fit the model using ridge
regression. However, I believe that the data from large hospital(indicated
by the number of patients they treat a year) is more accurate than from
small hosptials, and I want to put more weight on them. How do I do this
with lm.ridge?
I know I just need
2004 Mar 25
1
g-inverse question
I am using the ginv function from MASS and have run across this problem
that I do not understand. If I define the matrix A as below, its
g-inverse does not satisfy the Moore-Penrose condition
A %*% ginv(A) %*% A = A.
The matrix A is X'WX in a quadratic regression using some very large
dollar values.
The much simpler matrix B does satisfy the MP condition. Am I doing
something wrong? Is
2007 Aug 14
1
cov.unscaled in gls object
Hi list,
can I extract the cov.unscaled ("the unscaled covariance matrix") from a
gls fit (package nlme), like with summary.lm? Background: In a fixed
effect meta analysis regression the standard errors of the coefficients
can be computed as sqrt(diag(cov.unscaled)) where cov.unscaled is
(X'WX). I try do do this with a gls-fit.
Thanks, Sven
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help,
I have a four-part question about regression, matrices, and sandwich package.
1) In the sandwich package, I would like to better understand the
meat() function.
>From the bread() documentation, for a simple OLS regression, bread() returns
(1/n * X'X)^(-1)
That is, for a simple regression (per the documentation on bread()):
MyLM <- lm(y ~ x)
bread(MyLM)
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)
2009 Mar 02
2
R-help
Hi list,
When I type my question in R console using ? sign (example: ?par, when I
want to query for par), the following error message popps up:
Error in
print.help_files_with_topic("C:/PROGRA~1/R/R-24~1.1/library/maps/chm/map") :
CHM file could not be displayed
I appreciate if any body comes back to me with the solution.
Regards,
Alireza
[[alternative HTML version deleted]]
2008 Feb 14
4
FW: Memory Problem
I am sure this has been covered before, but I can find it in my
archives.
I loaded up a new server IBM x3650, 2x Intel dual core cpu's I installed
additional RAM to take it up to 7 gigs according to
http://www.centos.org/product.html#seven CentOS 5 x86 which I am using
supports up to 16gigs of RAM. Once I boot up CentOS only see's about
3.2Gigs of Ram.
I installed the kernel-PAE
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix
Class for compressed, sparse, triplet-form matrices handles
Identically indexed data instances by summing their values,
e.g.,
library(Matrix)
(Mt <- new("dgTMatrix",
i = as.integer(c(0,0,1,1,4)),
j = as.integer(c(0,1,2,2,4)),
x = as.double(1:5),
Dim = as.integer(c(5,5))))
## 5 x 5 sparse Matrix of class
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix
Class for compressed, sparse, triplet-form matrices handles
Identically indexed data instances by summing their values,
e.g.,
library(Matrix)
(Mt <- new("dgTMatrix",
i = as.integer(c(0,0,1,1,4)),
j = as.integer(c(0,1,2,2,4)),
x = as.double(1:5),
Dim = as.integer(c(5,5))))
## 5 x 5 sparse Matrix of class
2006 Jul 19
1
WLS ins systemfit question
How does one specify the weights for WLS in the
systemfit command ?
That is, there is a weight option in lm(), but there
doesn't seem to be weight option for systemfit("WLS")
Thanks!
2011 Jul 14
1
WLS regression, lm() with weights as a matrix
Dear All,
I've been trying to run a Weighted Least Squares (WLS) regression:
Dependent variables: a 60*200 matrix (*Rit*) with 200 companies and 60 dates
for each company
Independent variables: a 60*4 matrix (*Ft*) with 4 factors and 60 dates for
each factor
Weights: a 60*200 matrix (*Wit*) with weights for 200 companies and 60 dates
for each company
The WLS regression I would like to run
2016 Jun 07
2
segfault in IMAP APPEND with compressed maildir
Hi!
After upgrading from Debian wheezy with (self compiled) dovecot 2.2.15
to Debian jessie with (self compiled) 2.2.24, I observe the following
segmentation fault in the logs:
Jun 7 09:23:09 imap dovecot: imap(user at example.com): Error: read(<imap client>) failed: read(size=8003) failed: Connection reset by peer (uid=0, box=trash)
Jun 7 09:23:09 imap dovecot: imap(user at
2005 Feb 01
3
polynomials REML and ML in nlme
Hello everyone,
I hope this is a fair enough question, but I don’t have access to a copy
of Bates and Pinheiro. It is probably quite obvious but the answer might
be of general interest.
If I fit a fixed effect with an added quadratic term and then do it as
an orthogonal polynomial using maximum likelihood I get the expected
result- they have the same logLik.
2012 Nov 29
2
Confidence intervals for estimates of all independent variables in WLS regression
I would like to obtain Confidence Intervals for the estimates
(unstandardized beta weights) of each predictor in a WLS regression:
m1 = lm(x~ x1+x2+x3, weights=W, data=D)
SPSS offers that output by default, and I am not able to find a way to do
this in R. I read through predict.lm, but I do not find a way to get the
CIs for multiple independent variables.
Thank you
Torvon
[[alternative HTML
2006 Jul 13
1
ols/gls or systemfit (OLS, WLS, SUR) give identical results
I might be sorry for asking this question :-)
I have two equations and I tried to estimate them individually with "lm" and "gls", and then in a system (using systemfit) with "OLS", "WLS" and "SUR". Quite surprisingly (for myself at least) the results are identical to the last digit.
Could someone (please!) give a hint as to what am I
2009 Jul 20
1
S4 method dispatch with inheritance
Hi,
I'm trying to create a new S4 class (myMatrix) which for now just
extends dgCMatrix (from package Matrix). Then I want to use "[" which is
defined in Matrix.
Out of the box with "[" (defined in Matrix) I lose the class information
and the result is an object of class dgCMatrix. If I specify a
"["-method for myMatrix, it is not used because a signature
2010 Jun 24
1
Question on WLS (gls vs lm)
Hi all,
I understand that gls() uses generalized least squares, but I thought
that maybe optimum weights from gls might be used as weights in lm (as
shown below), but apparently this is not the case. See:
library(nlme)
f1 <- gls(Petal.Width ~ Species / Petal.Length, data = iris, weights
= varIdent(form = ~ 1 | Species))
aa <- attributes(summary(f1)$modelStruct$varStruct)$weights
f2 <-
2003 Sep 10
1
sweave problem
hi!
using:
Version 1.8.0 Under development (unstable) (2003-09-02)
using the Sweave function of the tools package i get this error when
latexing with texi2dvi --pdf
! LaTeX Error: File `upquote.sty' not found.
if i change the line
\usepackage{/users/faculty/ririzarr/R-1.8.0/lib/R/share/texmf/Sweave}
to
\usepackage{/users/faculty/ririzarr/R-1.7.1/lib/R/share/texmf/Sweave}
in the tex file,