[R-sig-teaching] Comparing Points on Two Regression Lines

R. Michael Weylandt michael.weylandt at gmail.com
Sun Apr 1 02:10:15 CEST 2012


? approxfun

f1 <- approxfun(x1,y1)
f2 <- approxfun(x2,y2)

f1(x) - f2(x)

But I'm not sure what you mean be compare...do you have a particular
test in mind?

Michael

On Sat, Mar 31, 2012 at 8:04 PM, AbouEl-Makarim Aboueissa
<aaboueissa at usm.maine.edu> wrote:
> Dear All:
>
> I am trying to compare points on two regression lines given some specific values of X. I am not sure how to do it in R and/or in SAS. Can someone help me, and show me how to conduct such test in R.
>
>
> You can use the following data for both lines.
>
> ### data for line 1:
> ### =========
>
> x1<-c(0.0,0.25,2.5,25.0,50.0)
> y1<-c(100.0,79.0,74.0,36.0,8.0)
>
>
>
> ### data for line 2:
> ### =========
>
> x2<-c(0.0,0.25,2.5,25.0,50.0)
> y2<-c(100.0,79.0,55.0,18.0,2.0)
>
>
> ### these are the given values of X:
> ###  ===================
>
> x<-c(0.10,0.20,2.0,15.0,35.0)
>
>
> thank you very much in advance
> abou
>
>
>
>
>
>
>
>
> ==========================
> AbouEl-Makarim Aboueissa, Ph.D.
> Associate Professor of Statistics
> Graduate Program Coordinator
> Department of Mathematics & Statistics
> University of Southern Maine
> 96 Falmouth Street
> P.O. Box 9300
> Portland, ME 04104-9300
> USA
>
>
> Tel: (207) 228-8389
> Fax: (207) 780-5607
> Email: aaboueissa at usm.maine.edu
>          aboueiss at yahoo.com
>
> Office: 301C Payson Smith
>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-teaching at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-teaching



More information about the R-sig-teaching mailing list