All you need is predict(fit, data.frame(x)) or if you had started with
a data frame:
xy <- data.frame(x, y)
fit <- lm(y~x, xy)
predict(fit, xy)
David
Professor Emeritus of Anthropology
Texas A&M University
College Station, TX
On Fri, Nov 19, 2021 at 8:45 PM Rolf Turner wrote:
>
> On Fri, 19 N
On Fri, 19 Nov 2021 18:35:23 -0800
Bert Gunter wrote:
> ?predict.lm says:
>
> "predict.lm produces predicted values, obtained by evaluating the
> regression function in the frame newdata (which defaults to
> model.frame(object)). "
>
> model.frame(fit) is:
> 1 1.37095845 -0.30663859
> 2 -0
?predict.lm says:
"predict.lm produces predicted values, obtained by evaluating the
regression function in the frame newdata (which defaults to
model.frame(object)). "
model.frame(fit) is:
1 1.37095845 -0.30663859
2 -0.56469817 -1.78130843
4 0.63286260 1.21467470
6 -0.10612452 -0.43046913
Consider the following toy example:
set.seed(42)
y <- rnorm(20)
x <- rnorm(20)
y[c(3,5,14,15)] <- NA
fit <- lm(y~x)
predict(fit)
This for some reason, which escapes me, does not provide predicted
values when the response/dependent variable is missing, despite
there being
Please read the posting guide linked below, which says:
"Questions about statistics: The R mailing lists are primarily
intended for questions and discussion about the R software. However,
questions about statistical methodology are sometimes posted. If the
question is well-asked and of interest to
Dear All:
I am conducting a Confirmatory Factor Analysis (CFA) for the attached data.
Here is what I did. please see below
I do need your help with the structure of the model. I believe that what I
used is the correlated CFA model. If I am wrong, please fix me. I need your
help with the struct
A long-ish article on code/data-analysis reproducibility in scientific
research for those of you who may be interested. Questions related to this
occasionally appear on this list. R is mentioned. Apologies if I have
strayed too far.
https://arstechnica.com/science/2021/11/keeping-science-reproduci
On Wed, 3 Nov 2021 23:04:06 +0100
frit...@web.de wrote:
> Since LICORS has not been updated since 2013, I am not sure if there
> is an active maintainer. The named maintainer works for Google since
> 2014 and may have abandoned the package.
Computing the wrong distances is a serious problem. Perh
Hi Jim and all,
All functions worked beautifully. I really appreciate your help.
*Thank you and best regards.*
On Fri, Nov 19, 2021 at 4:26 AM Jim Lemon wrote:
> Hi RosalinaZakaria,
> Talk about using a sledgehammer to crack a nut. In your example the
> two objects are character vectors. Ho
9 matches
Mail list logo