Re: [R] Cannot reproduce tutorial results

2019-02-22 Thread Bert Gunter
This is a plain text list and your html post below is pretty mangled and difficult to read. If you re-post in plain text, you are more likely to get a response. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley B

[R] Cannot reproduce tutorial results

2019-02-22 Thread Jason Hernandez via R-help
I have come back to trying to learn R after a long time away, and have begun with the YouTube tutorial videos by David Langer, as seen here Introduction to Data Science with R - Data Analysis Part 1. I am using R Studio with R version 3.4.4 (2018-03-15) -- "Someone to Lean On" Around 1:16:00 in

Re: [R] Obtaining values of estimates from a regression; How do I get values from a list?

2019-02-22 Thread Marc Schwartz via R-help
Hi, I was just about to reply with coef() when I saw John's reply come through. Note that this is covered in An Introduction to R: https://cran.r-project.org/doc/manuals/r-release/R-intro.html#Generic-functions-for-extracting-model-information If your model object is 'MOD', note that you can

Re: [R] Obtaining values of estimates from a regression; How do I get values from a list?

2019-02-22 Thread Fox, John
Dear John, This seems to be more complicated than it needs to be. One normally uses coef() to extract coefficients from a model object. Thus > coef(fitchange) (Intercept) pre -54.1010158 0.6557661 > coef(fitchange)[2] pre 0.6557661 Best, John

Re: [R] Obtaining values of estimates from a regression; How do I get values from a list?

2019-02-22 Thread Sorkin, John
Problem solved: summary(fitchange)$coefficients[2,1] John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18

Re: [R] Obtaining values of estimates from a regression; How do I get values from a list?

2019-02-22 Thread Ivan Calandra
I find that the str() function is really helpful to understand how an object is structured, and therefore how to extract part(s) of it. Try for example: str(zz) and it might help you understand why zz$coefficients[2,1] is what you were looking for. HTH Ivan -- Dr. Ivan Calandra TraCEr, laborator