[R] lm help: using lm when one point is known (not y intercept)

John Fox jfox at mcmaster.ca
Sun Nov 28 05:49:08 CET 2004


Dear Seth,

You don't say which variable is the explanatory variable and which is the
response, but assuming that prob is to be regressed on effect, you can fit
lm(prob - 50 ~ I(effect + 37.25) - 1). That is you can shift the point
through which the regression is to go to the origin and then force the
regression through the origin.

I hope this helps,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Seth Imhoff
> Sent: Saturday, November 27, 2004 11:09 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] lm help: using lm when one point is known (not y 
> intercept)
> 
> Hello-
> 
> My question is a short one.  How can I specify a single point 
> which through the fitted linear model has to go through?  To 
> illustrate my problem, the fit to following data must go 
> through the point (-37.25(effect), 50(prob)).  Note: you can 
> ignore the label column.
> 
>     Effect      Prob Label
> 
> 1 -1143.75  7.142857     L
> 
> 2  -572.75 21.428571     D
> 
> 3  -223.75 35.714286    GL
> 
> 4   123.25 50.000000    DG
> 
> 5   359.75 64.285714     G
> 
> 6   374.75 78.571429   DGL
> 
> 7   821.75 92.857143    DL
> 
> 
> Thanks in advance!
> 
> Seth Imhoff




More information about the R-help mailing list