Instead of something like lm(bp~height+age, data=mydata) I would like 开发者_运维技巧to specify the columns by number, not name.
I learned to get a linear fit with some points using lm in my R script. So, I did that (which worked nice), and printed out the fit:
I have a regression model for some time series data investigating drug utilisation. The purpose is to fit a spline to a time series and work out 95% CI etc. The model goes as 开发者_如何学运维follows:
Suppose I have a response variable and a data containing three covariates (as a toy example): y = c(1,4,6)
I have two dependents that both depent on two variables AND on each other, can this be modelled in R (must be!) but I can\'t figure out how, anyone a hint?
I am fitting a model to factor data and predicting. If the newdata in predict.lm() contains a single factor level that is unknown to the model, all of predict.lm() fails and returns an error.
Yesterday I worked up an example of the difference between Ordinary Least Squares (OLS) vs. Principal Components Analysis (PCA). For that illustration I wanted to show the errors minimized by OLS and
I need to modify the lm (or eventually loess) function so I can use it in ggplot2\'s geom_smooth (or stat_smooth).
I am fitting a simple regression in R on gas usage per capita. The regression formulas looks like: gas_b <- lm(log(gasq_pop) ~ log(gasp) + log(pcincome) + log(pn) +
I am currently regressing GDP on multiple factors (7 different variables to be exact), My x variable is quarterly Dates (2006-Q1 to 2020-Q4). I need need to plot my scatter plot for the GDP with Date