Displaying 20 results from an estimated 20000 matches similar to: "Regression query ..."
2004 Aug 11
2
Advice on picking a regression method
Dear R-users,
There are tons of methods out there for fitting independant variables to a
dependent variable. All stats books tell you about the assumptions behind
OLS (ordinary least squares) and warn against abusive use of the method
(which many of us do disregard by lack of a better knowledge). Most
introductory text books stop there and don't tell you what the next best
option might be. I
2004 Nov 19
2
Performing regression using R & C
Dear All,
Is it possible to perform OLS using C code? I am trying to
optimize a n-period "moving window" OLS on a huge dataset hence was
wondering if such a thing is possible.
Ideally the solution that I am looking for would involve a
C-code accepting two float arrays and returning back computed parameters
such as t-stat, coefficient etc.
I have glanced thru the FAQ's and tried
2011 May 15
5
Question on approximations of full logistic regression model
Hi,
I am trying to construct a logistic regression model from my data (104
patients and 25 events). I build a full model consisting of five
predictors with the use of penalization by rms package (lrm, pentrace
etc) because of events per variable issue. Then, I tried to approximate
the full model by step-down technique predicting L from all of the
componet variables using ordinary least squares
2009 Mar 25
3
very fast OLS regression?
Dear R experts:
I just tried some simple test that told me that hand computing the OLS
coefficients is about 3-10 times as fast as using the built-in lm()
function. (code included below.) Most of the time, I do not care,
because I like the convenience, and I presume some of the time goes
into saving a lot of stuff that I may or may not need. But when I do
want to learn the properties of an
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,
2007 Nov 28
2
alternatives to traditional least squares method in linear regression ?
Dear list,
I have encountered a special case for searching a linear regression
where I'm not satisfied with the results obtained using the traditional
least squares method (sometimes called OLS) for estimating/optimizing
the residues to the regression line (see code below). Basically, a
group of my x-y data are a bit off the diagonal line (in my case the
diagonal represents the ideal or
2005 Feb 10
2
correcting for autocorrelation in models with panel data?
Hi
I have some panel data for the 50 US states over about 25 years, and I
would like to test a simple model via OLS, using this data. I know how
to run OLS in R, and I think I can see how to create Panel Corrected
Standard Errors using
http://jackman.stanford.edu/classes/350C/pcse.r
What I can't figure out is how to correct for autocorrelation over
time. I have found a lot of R stuff on
2006 Nov 05
2
solution to a regression with multiple independent variable
Please forgive a statistics question.
I know that a simple bivariate linear regression, y=f(x) or in R
parlance lm(y~x) can be solved using the variance-covariance matrix:
beta(x)=covariance(x,y)/variance(x). I also know that a linear
regression with multiple independent variables, for example y=f(x,z)
can also be solved using the variance-covariance matrix, but I don't
know how to do this.
2005 May 31
1
Solved: linear regression example using MLE using optim()
Thanks to Gabor for setting me right. My code is as follows. I found
it useful for learning optim(), and you might find it similarly
useful. I will be most grateful if you can guide me on how to do this
better. Should one be using optim() or stats4::mle?
set.seed(101) # For replicability
# Setup problem
X <- cbind(1, runif(100))
theta.true <- c(2,3,1)
y <- X
2005 Jun 06
1
A performance anomaly
I wrote a simple log likelihood (for the ordinary least squares (OLS)
model), in two ways. The first works out the likelihood. The second
merely calls the first, but after transforming the variance parameter,
so as to allow an unconstrained maximisation. So the second suffers a
slight cost for one exp() and then it pays the cost of calling the first.
I did performance measurement. One would
2002 May 11
2
Bug on Mac version of lm()?
Dear Mac users,
Hi, as you might have probably read the thread of
"[R] Rsquared in summary(lm)" on May 10, it seems that Mac version of
lm() seem to be working incorrectly.
I enclose the script to produce the result both for lm() and manual
calculation for a simple regression. Could you run the script and
report with the version of R, so I don't have to go through every
builds
2010 Aug 10
1
Multiple imputation, especially in rms/Hmisc packages
Hello, I have a general question about combining imputations as well as a
question specific to the rms and Hmisc packages.
The situation is multiple regression on a data set where multiple
imputation has been used to give M imputed data sets. I know how to get
the combined estimate of the covariance matrix of the estimated
coefficients (average the M covariance matrices from the individual
2006 Aug 15
1
fMultivar OLS - how to do dynamic regression?
Hi folks!
Does anybody know how to use the OLS function in fMultivar to do dynamic
regression? I've tried specifying lags in OLS using a data series
created in fSeries and it doesn't seem to work. I've done dynamic
regression using dyn$lm and I was wondering how to accomplish the same
thing using the OLS function from fMultivar. Thanks!
John
[[alternative HTML version
2005 May 30
1
Trying to write a linear regression using MLE and optim()
I wrote this:
# Setup problem
x <- runif(100)
y <- 2 + 3*x + rnorm(100)
X <- cbind(1, x)
# True OLS --
lm(y ~ x)
# OLS likelihood function --
ols.lf <- function(theta, K, y, X) {
beta <- theta[1:K]
sigma <- exp(theta[K+1])
e <- (y - X%*%beta)/sigma
logl <- sum(log(dnorm(e)))
return(logl)
}
optim(c(2,3,0), ols.lf, gr=NULL,
method="BFGS",
2009 Apr 26
3
Question of "Quantile Regression for Longitudinal Data"
Hi,
I am trying to estimate a quantile regression using panel data. I am trying
to use the model that is described in Dr. Koenker's article. So I use the
code the that is posted in the following link:
http://www.econ.uiuc.edu/~roger/research/panel/rq.fit.panel.R
How to estimate the panel data quantile regression if the regression
contains no constant term? I tried to change the code of
2010 Jun 22
2
xyplot: adding pooled regression lines to a paneled type="r" plot
Consider the following plot that shows separate regression lines ~ age
for each subject in the Pothoff-Roy Orthodont data,
with separate panels by Sex:
library(nlme)
#plot(Orthodont)
xyplot(distance ~ age|Sex, data=Orthodont, type='r', groups=Subject,
col=gray(.50),
main="Individual linear regressions ~ age")
I'd like to also show in each panel the pooled OLS
2006 Sep 27
2
Constrained OLS regression
Hello R helpers,
I am trying to do a linear OLS regression of y on two variables x1 and
x2. I want to constrain the coefficients of x1 and x2 to sum up to 1.
and therefore run a constrained OLS. Can anybody help with this? (I have
seen some answers to similar questions but it was not clear to me what I
need to do) - I have tried the lm function with offset but I must not
have used it properly.
2003 Jun 05
2
ridge regression
Hello R-user
I want to compute a multiple regression but I would to include a check for
collinearity of the variables. Therefore I would like to use a ridge
regression.
I tried lm.ridge() but I don't know yet how to get p-values (single Pr() and p
of the whole model) out of this model. Can anybody tell me how to get a
similar output like the summary(lm(...)) output? Or if there is
2008 May 08
1
R strucchange question -- robust regression
Is it possible to use some form of robust regression with the
breakpoints routine so that it is less sensitive to outliers?
--Rich
Richard Kittler
Advanced Micro Devices, Inc.
Sunnyvale, CA
2003 Oct 29
2
constrained OLS on coefficient
Hi,
I would like to know if anyone has any idea of how to run an OLS with
constraints? I need to contraint a coefficient estimate in the model equal to
1, and I am not sure how to include it into the OLS estimation...
I was hoping to find something like "cnsreg" in STATA..
thank you
Soyoko
______________________________________
Ms. Soyoko Umeno
Graduate Research Assitant for the