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 University
College Station, TX
On Fri, Nov 19, 2021 at 8:45 PM Rolf Turner wrote:
>
> On Fri, 19
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
?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
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
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
Hola,
La función case_when() del paquete dplyr te sirve
Saludos
El jue, 18 nov 2021 a las 13:36, juan manuel dias ()
escribió:
> Hola, como andan!
> Necesito crear una variable nueva "*Dirección_Final*" que sea igual a la
> variable "*Dirección*", pero que si "*Dirección" *es NA traiga
Estimados
Personalmente yo uso esa forma antes que if, pero, hay varias alternativas.
Javier Marcuzzi
El vie, 19 nov 2021 a las 5:01, Proyecto R-UCA () escribió:
> Buenas,
>
> ¿qué tal esto?
>
> Supongamos que las variables están en un data.frame d que tiene todas
> esas columnas, entonces
>
>
Hola, muchas gracias!
Lo resolví con coalesce()
##mutate(Dirección_Final=coalesce(Dirección,`Dirección
General`,Subsecretaria, Secretaria))
El vie, 19 nov 2021 a las 5:01, Proyecto R-UCA () escribió:
> Buenas,
>
> ¿qué tal esto?
>
> Supongamos que las variables están en un data.frame d que
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.
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.
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.
Buenas,
¿qué tal esto?
Supongamos que las variables están en un data.frame d que tiene todas
esas columnas, entonces
d$Direccion_Final <- d$Direccion
d$Direccion_Final[is.na(d$Direccion_Final)] <- d$Direccion_General
d$Direccion_Final[is.na(d$Direccion_Final)] <- d$Subsecretaria
13 matches
Mail list logo