similar to: WLS regression, lm() with weights as a matrix

Displaying 20 results from an estimated 300 matches similar to: "WLS regression, lm() with weights as a matrix"

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!
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
2012 Nov 16
2
R-Square in WLS
Hi, I am fitting a weighted least square regression and trying to compute SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know what I am coding wrong. Can you help please? xnam <-colnames(X) # colnames Design Matrix fmla1 <- as.formula(paste("Y ~",paste(xnam, collapse=
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 Mar 31
1
nonpos. def. var-cov matrix
R 1.6.2 for Windows, Win2k: I have fitted a weighted least squares model using the code "wls.out <- gls(y ~ x1 + x2 + x3 + x4 + x5 + x6 - 1, data = foo.frame, weights = varConstPower(form = ~ fitted(.), fixed = list(power = 0.5), const = 1))" The data has 62 rows and the response is zero when the covariates are zero. The purpose of the model was to account for the the fact that
2007 Sep 25
2
Constraining Predicted Values to be Greater Than 0
I have a WLS regression with 1 dependent variable and 3 independent variables. I wish to constrain the predicted values (the fitted values) so that they are greater than zero (i.e. they are positive). I do not know how to impose this constraint in R. Please respond if you have any suggestions. There are some previous postings about constraining the coefficients, but this won't accomplish
2006 Jul 13
2
MLE and QR classes
Hi, I load my data set and separate it as folowing: presu <- read.table("C:/_Ricardo/Paty/qtdata_f.txt", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE) dep<-presu[,3]; exo<-presu[,4:92]; Now, I want to use it using the wls and quantreg packages. How I change the data classes for mle and rq objects? Thanks a lot,
2008 Aug 04
2
Multivariate Regression with Weights
Hi all, I'd like to fit a multivariate regression with the variance of the error term porportional to the predictors, like the WLS in the univariate case. y_1~x_1+x_2 y_2~x_1+x_2 var(y_1)=x_1*sigma_1^2 var(y_2)=x_2*sigma_2^2 cov(y_1,y_2)=sqrt(x_1*x_2)*sigma_12^2 How can I specify this in R? Is there a corresponding function to the univariate specification lm(y~x,weights=x)??
2018 May 19
1
Bug on qr.coef when qr is created by a zero matrix with colnames and all y equals zero
Dear maintainers, I'm reporting a bug in qr.coef that mishandles the colnames of matrix. A minimal reproducible example is as follows: x <- cbind(rep(0, 10), rep(0, 10)) y <- rep(0, 10) q <- qr.default(x) qr.coef(q, y) [1] NA NA If x has colnames, then qr.coef will end up with an error: x <- cbind(x1 = rep(0, 10), x2 = rep(0, 10)) y <- rep(0, 10) q <- qr.default(x)
2003 Mar 07
1
REML option in gstat
Hi, please help!! I've been trying to fit variogram models using the REML method in the gstat package. Every time the Windows GUI crashes. For example library(gstat) data(meuse) x <- variogram(zinc ~ 1, ~x + y, meuse) v <- vgm(140000, "Sph", 800, nug = 10000) plot(x, model = fit.variogram(x, model = v, fit.method=5)) Other fit methods are non problematic (eg. fit.method=7
2011 Apr 26
1
logistic regression: wls and unbalanced samples
Greetings from Rio de Janeiro, Brazil. I am looking for advice / references on binary logistic regression with weighted least squares (using lrm & weights), on the following context: 1) unbalanced sample (n0=10000, n1=700); 2) sampling weights used to rebalance the sample (w0=1, w1=14.29); e 3) after modelling, adjust the intercept in order to reflect the expected % of 1?s in the population
2012 Oct 13
1
WLS regression weights
Hello. I'm am trying to follow a recommendation to deal with a dependent variable in a linear regression. I read that, due to the positive trend in my dependent variable residual vs mean function, I should 1) run a linear regression to estimate the standard deviations from this trend, and 2) run a second linear regression and use 1 / variance as weight. These might be terribly stupid
2012 Nov 21
1
Regression: standardized coefficients & CI
I run 9 WLS regressions in R, with 7 predictors each. What I want to do now is compare: (1) The strength of predictors within each model (assuming all predictors are significant). That is, I want to say whether x1 is stronger than x2, and also say whether it is significantly stronger. I compare strength by simply comparing standardized beta weights, correct? How do I compare if one predictor is
2006 Jun 09
1
X'W in Matrix
Hi! I have used the Matrix package (Version: 0.995-10) successfully to obtain the OLS solution for a problem where the design matrix X is 44000x6000. X is very sparse (about 80000 non-zeros elements). Now I want to do WLS: (X'WX)^-1X'Wy I tried W=Diagonal(length(w),w) and wX=solve(X,W) but after various minutes R gives a not enough memory error (Im using a 64bit machine with 16Gigs
2006 Jul 14
1
Error in Quantile Regression - Clear Message
Dear Users, I loaded my dataset as following: presu <- read.table("C:/_Ricardo/Paty/qtdata_f.txt", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE) dep<-presu[,3]; exo<-presu[,4:92]; When I try: rq(dep ~ exo, ...) or mle.stepwise(dep ~ exo, ...) I got the same error: > rq(dep ~ exo) Error in model.frame(formula, rownames,
2008 Jun 13
1
x86 SSE* Pointer Favors
Dear Statisticians--- This is not even an R question, so please forgive me. I have so much ignorance in this matter that I do not know where to begin. I hope someone can point me to documentation and/or a sample. I want to compute a covariance as quickly as non-humanly possible on an Intel core processor (up to SSE4) under linux. Alas, I have no idea how to engage CPU vectorization. Do I need
2008 Jul 23
1
Questions on weighted least squares
Hi all, I met with a problem about the weighted least square regression. 1. I simulated a Normal vector (sim1) with mean 425906 and standard deviation 40000. 2. I simulated a second Normal vector with conditional mean b1*sim1, where b1 is just a number I specified, and variance proportional to sim1. Precisely, the standard deviation is sqrt(sim1)*50. 3. Then I run a WLS regression without the
2003 Oct 13
1
OpenSSH_3.7.1p2, Solaris 8: non-interactive authentication meth od prompts for a password
Hi, The OpenSSH_3.7.1p2, Solaris 8 case: non-interactive authentication method (publickey) works for root only ---------------------------------------------------------------------------- --------- We installed OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7c We need to copy a file by SFTP from App server to a DB server with passwordless method. [cbfe-dev-app01 (client), user cbfesit]
2020 Aug 07
2
Branches which return values in SelectionDAG
Hi all, I am working on modeling an instruction similar to SystemZ's 'BRCT', which takes a register, decrements it, and branches if the register is nonzero. I saw that the LLVM backend for SystemZ generates the instruction in a MachineFunctionPass as part of a pass intended to eliminate or combine compares. I then looked at ARM, where it uses the HardwareLoops pass first, and then a