Displaying 20 results from an estimated 20000 matches similar to: "abline for intercept-only simple lm models (with and without offset)"
2009 Oct 21
1
How to find the interception point of two linear fitted model in R?
Dear All,
Let have 10 pair of observations, as shown below.
######################
x <- 1:10
y <- c(1,3,2,4,5,10,13,15,19,22)
plot(x,y)
######################
Two fitted? models, with ranges of [1,5] and [5,10],?can be easily fitted separately by lm function as shown below:
#######################
mod1 <- lm(y[1:5] ~ x[1:5])
mod2 <- lm(y[5:10] ~ x[5:10])
#######################
2011 Mar 19
1
strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL
Hi Dears,
When I introduce an interaciton in a piecewise model I obtain some quite
unusual results.
If that would't take u such a problem I'd really appreciate an advise from
you.
I've reproduced an example below...
Many thanks
x<-rnorm(1000)
y<-exp(-x)+rnorm(1000)
plot(x,y)
abline(v=-1,col=2,lty=2)
mod<-lm(y~x+x*(x>-1))
summary(mod)
yy<-predict(mod)
2012 Dec 13
2
abline of an lm fit not correct
Hello fellow
R-users,
I’m stuck
with something i think is pretty stupid, but i can’t find out where i’m wrong,
and it’s turning me crazy!
I am doing
a very simple linear regression with Northing/Easting data, then I plot the
data as well as the regression line :
> plot(x=Dataset$EASTING,
y=Dataset$NORTHING)
> fit <- lm(formula = NORTHING ~ EASTING,
data = Dataset)
> abline(fit)
2010 Sep 20
3
How to set the limit of abline (regression line of lm)
Dear List,
I ran a regression model using lm and produced a regression line using
abline.
The line ranges from -20 to 20 in x axis,
and the section I only want is from -20 to 0.
Please kindly advise any function in abline () to set the range of x axes.
Thank you
Elaine
[[alternative HTML version deleted]]
2006 Jan 20
3
abline() or predict.lm() when log="x"
Hello,
I'm trying to plot a fitted lm() line on a plot when the one
explanatory variable is log transformed and log="x". I get different
lines using abline and predict.lm().
#Example
x <- 1:100
y <- rnorm(100)
plot(y ~ x, log="x")
abline(lm(y ~ log(x)))
lines(x, predict(lm(y ~ log(x))), lwd=2)
I'm sure I'm missing something but could someone tell me which
2005 Jun 02
4
plot/lm/abline
Hi,
when I run
> plot.default(z1, z2, xlab = "x", ylab = "y", main = "xxxx", pch = "+")
> abline(lm(z1 ~ z2))
then the plot is plotted perfectly (scatterplot), however, the lm()
function doesnt appear on the plot. What could be wrong?
(Yesterday it worked perfectly, with the lm() line.)
Running R 2 on OS X.
Mathias Hunsk??r Furevik
Norway
2005 Nov 09
1
using abline and a fitted 2nd degree formula
Hello all,
R2.1.1, Wk2
I am doing some two-step plotting, first using plot() to illustrate the
datapoints and then using abline() to place a trend line from a fitted
model into the plot.
Everything works well as long as the formula of the fitted model i of the
type:
m1 <- lm(Dependent ~ Independent)
then abline(m1) puts the proper straight line into the plot.
But if I use:
m2 <-
2015 Aug 30
2
[OT] new R logo in vector graphics format
L.S.
Since some time there is a new r-project.org site as announced here:
https://stat.ethz.ch/pipermail/r-announce/2015/000581.html
The logo has changed on the site, but I fail to find a vector graphics file.
For the previous logo I used to go to
https://svn.r-project.org/R-dev-web/trunk/Logo/
Is there anything similar for the new logo?
Many thanks in advance.
Kind regards,
Tobias
--
2005 May 30
3
?strptime ambiguity (PR#7907)
Full_Name: Tobias Verbeke
Version: 2.1.0
OS: GNU/Linux
Submission from: (NULL) (81.247.252.229)
Would it be possible to use a non-ambiguous example
of expressing a day according to the ISO 8601 international
standard in the first sentence of the Note section of
?strptime, e.g. "2001-04-18" instead of "2001-02-03" ?
Yours,
Tobias
2007 Apr 05
8
package for Matlab
Hallo,
does a package for Matlab exist in R?
If yes, where can I find it and how can I install it under R?
Thanks, Corinna
2008 Jun 19
4
Controlling the length of line with abline(lm())
Hi
I just realized that when I use linear regression to draw a line through my
data points with something like the following:
abline(lm(y ~ x))
the length of the line is infinite, i.e., the line goes beyond the smallest
and the largest data values. This seems not very right to me (not to mention
it looks unaesthetic). I do not mean to imply that the straight-line
behavior of my system is
2008 Aug 28
1
abline of an lm fit not correct
mac osx 10.5.4
R 2.7.1
I have fit a model
d<-lm(y~x)
with an R^2 of 0.963
but when I issue the command
abline(d)
the line is below where it ought to be. Looks like the right slope,
but not the right intercept.
thanks
--
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy
Let's not spend our time and resources thinking about things that are
so little or so large
2013 Sep 21
2
regenerate Rscript after moving R installation
L.S.
In this bug report
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14493#c1
it is mentioned that after moving an R installation
one should regenerate the Rscript executable.
Is there an easy way to do so (after an R installation has been
moved)?
I have not found any information in the R installation and
administration manual.
Many thanks in advance for any pointer.
Best wishes,
2015 Jun 06
1
NEWS file inconsistency
Many thanks, Duncan.
We will check the prerelease versions of R 3.2.1.
Best regards,
Tobias
----- Original Message -----
> From: "Duncan Murdoch" <murdoch.duncan at gmail.com>
> To: "Tobias Verbeke" <tobias.verbeke at openanalytics.eu>, "r-devel at r-project.org" <r-devel at r-project.org>
> Sent: Saturday, June 6, 2015 2:37:04 PM
>
2002 Dec 18
6
Can I build an array of regrssion model?
Hi,
I am trying to use piecewise linear regression to approximate a
nonlinear function. Actually, I don't know how many linear functions I
need, therefore, I want build an array of regression models to automate
the approximation job. Could you please give me any clue?
Attached is ongoing code:
rawData = scan("c:/zyang/mass/data/A01/1.PRN",
what=list(numeric(),numeric()));
len =
2009 Jun 21
5
Roxygen vs Sweave for S4 documentation
Hi,
I have been using R for a while. Recently, I have begun converting my
package into S4 classes. I was previously using Rdoc for documentation.
Now, I am looking to use the best tool for S4 documentation. It seems that
the best choices for me are Roxygen and Sweave (I am fine with tex).
Are there any users of Roxygen or Sweave who can comment on the strengths or
weaknesses of one or othe
2008 Dec 02
1
r2 for lm() with zero intercept
Hello list
I'm a little confused about the R2 and adjusted R2 values reported by lm() when I try to fix an intercept. When using +0 or -1 in the formula I have found that the standard error generally increases (as I would expect) but the R2 also increases
(which seems counter intuitive). I've pasted a short test script below to illustrate. I do realise that many will say I shouldn't be
2006 Jun 08
1
panel.abline and xyplot
Dear All,
I am wondering on how to use the abline.xyplot with xyplot such that I will have different vertical lines for each panel. More sepcifically, suppose that the xyplot generates 4 panels defined by the combination of two binary variables: X_1 and X_2. i.e.
xyplot(Y ~ Z | X_1*X_2, data = df)
I want something like:
abline(v = 5) if X_1=0 and X_2 = 0
abline(v =
2015 Jun 06
2
NEWS file inconsistency
L.S.
I noticed the NEWS file as made available at http://cran.r-project.org/src/base/NEWS became inconsistent in describing CHANGES for a new R version:
$ wget http://cran.r-project.org/src/base/NEWS
$ cat NEWS | grep 'CHANGES IN '
CHANGES IN 3.2.0:
CHANGES IN R 3.1.3:
CHANGES IN R 3.1.2:
CHANGES IN R 3.1.1:
CHANGES IN R 3.1.0:
CHANGES IN R 3.0.3:
CHANGES IN R 3.0.2:
CHANGES IN R 3.0.1:
2009 Mar 24
2
Properly labeling abline with text?
The result of the code shown below is posted at the following URL:
http://n2.nabble.com/Trying-to-properly-label-abline-td2524629.html
I would like to figure out a better way to label the horizontal abline.
I tried multiplying the text y position by a scale, but this didn't always put the text in a useful position. I guess I am curious if there is a preferred procedure for labeling the