Re: [R] Forcing the intercept

2006-11-14 Thread Prof Brian Ripley
On Mon, 13 Nov 2006, Heather Maughan wrote:

 Dear R-users:

 I am doing multiple regressions using the lm function and would like to
 force the intercept to be equal to a specific value (such as 4.3).  I was
 able to find out how to force it through the origin but this does not work
 for other values.

?offset, e.g  0+x1+x2+offset(rep(4.3, 127))

You could also use y-4.3 ~ rhs, but that gives problems for prediction.

 I am also interested in forcing the regression parameters obtained from one
 regression in another regression with a subset of the data.

That makes no sense to me: do you just want to predict the fit on a 
subset? If so use predict() or fitted().

 Are either of these possible in R?  I have been searching the help guide for
 hours and have been unsuccessful.

Not sure what 'the help guide' is, but you need a book about doing 
statistics with R.


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Forcing the intercept

2006-11-13 Thread Heather Maughan
Dear R-users:

I am doing multiple regressions using the lm function and would like to
force the intercept to be equal to a specific value (such as 4.3).  I was
able to find out how to force it through the origin but this does not work
for other values. 

I am also interested in forcing the regression parameters obtained from one
regression in another regression with a subset of the data.

Are either of these possible in R?  I have been searching the help guide for
hours and have been unsuccessful.

Many thanks,
Heather

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Forcing the intercept

2006-11-13 Thread Leeds, Mark \(IED\)
you can just subtract 4.3 from the independent variable and then do
through zero. That will
Give you a force through 4.3. I don't undersarand the second part of
your statement.



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Heather Maughan
Sent: Monday, November 13, 2006 6:31 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Forcing the intercept

Dear R-users:

I am doing multiple regressions using the lm function and would like
to force the intercept to be equal to a specific value (such as 4.3).  I
was able to find out how to force it through the origin but this does
not work for other values. 

I am also interested in forcing the regression parameters obtained from
one regression in another regression with a subset of the data.

Are either of these possible in R?  I have been searching the help guide
for hours and have been unsuccessful.

Many thanks,
Heather

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Forcing the intercept

2006-11-13 Thread Jeffrey Robert Spies
Second part:  you want to look at the residuals after specifying a  
model?  Just use the dependent variables in your subsample as the  
dependent variables in your regression equation and subtract that  
from your outcome variable in  your  subsample.  Might not be the  
answer to the question you're asking though.

Jeff.
-- 
Jeffrey R. Spies
http://www.nd.edu/~jspies/


On Nov 13, 2006, at 7:00 PM, Leeds, Mark (IED) wrote:

 you can just subtract 4.3 from the independent variable and then do
 through zero. That will
 Give you a force through 4.3. I don't undersarand the second part of
 your statement.



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Heather Maughan
 Sent: Monday, November 13, 2006 6:31 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Forcing the intercept

 Dear R-users:

 I am doing multiple regressions using the lm function and would like
 to force the intercept to be equal to a specific value (such as  
 4.3).  I
 was able to find out how to force it through the origin but this does
 not work for other values.

 I am also interested in forcing the regression parameters obtained  
 from
 one regression in another regression with a subset of the data.

 Are either of these possible in R?  I have been searching the help  
 guide
 for hours and have been unsuccessful.

 Many thanks,
 Heather

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 

 This is not an offer (or solicitation of an offer) to buy/se... 
 {{dropped}}

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting- 
 guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.