[R] about fitting a regression line

MacQueen, Don macqueen1 at llnl.gov
Thu Jun 15 01:25:44 CEST 2017


Start with the lm() function; i.e., see

  ?lm

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062


On 6/14/17, 3:40 PM, "R-help on behalf of lily li" <r-help-bounces at r-project.org on behalf of chocold12 at gmail.com> wrote:

    Hi R users,
    
    I have some data points (Xi, Yi), and they may follow such a pattern Yi =
    cCOS(Xi) + d, how to find the c and d in R? which function to use? Also,
    how to get the R2 and p value for this correlation? Thanks for any kind of
    help.
    
    	[[alternative HTML version deleted]]
    
    ______________________________________________
    R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
    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.
    



More information about the R-help mailing list