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
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
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
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
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
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
6 matches
Mail list logo