FAQ Database Discussion Community

Nonlinear total least squares/Deming regression

r,regression
I've been using nls() to fit a custom model to my data, but I don't like how the model is fitting and I would like to use an approach that minimizes residuals in both x and y axes. I've done a lot of searching, and have found solutions for fitting...

P values from fastbw regression function of rms package

r,regression,linear-regression,rms
I am trying fastbw function of rms package for backward regression as follows (using mtcars dataset): > mod = ols(mpg~am+vs+cyl+drat+wt+gear, mtcars) > mod Linear Regression Model ols(formula = mpg ~ am + vs + cyl + drat + wt + gear, data = mtcars) Model Likelihood Discrimination Ratio Test Indexes...

Multiple regressions with subsets of data using dplyr in R

r,regression,dplyr

R— repeating linear regression in a large dataset

r,regression
I'm an R newbie working with an annual time series dataset (named "timeseries"). The set has one column for year and another 600 columns with the yearly values for different locations ("L1," "L2", etc), e.g. similar to the following: Year L1 L2 L3 L4 1963 0.63 0.23 1.33 1.41 1964...

SciKit-learn for data driven regression of oscillating data

python,time-series,scikit-learn,regression,prediction
Long time lurker first time poster. I have data that roughly follows a y=sin(time) distribution, but also depends on other variables than time. In terms of correlations, since the target y-variable oscillates there is almost zero statistical correlation with time, but y obviously depends very strongly on time. The goal...

Plotting a independent variable under a parameter of another variable in R

r,plot,regression
I have a function predictshrine<-0*rain-399.8993+5*crops+50.4296*log(citysize)+ 4.5071*wonders*chief+.02301*children*deaths+1.806*children+ .10799*deaths-2.0755*wonders-.0878*children^2+.001062*children^3- .000004288*children^4-.009*deaths^2+.0000530238*deaths^3+ 7.974*sqrt(children)+.026937*wonders^2-.0001305*wonders^3 I also have a sequence children<-seq(0,100,length=500) And a for loop for(deaths in c(0,5,10,50,100,200)) Now what i want to do is be able to plot predictshrine vs children when deaths equals certain amounts and...

Modelling interactions with only a subset of the levels of a factor in R

regression,interaction
Let's first look at lm. I have a continuous explanatory $X$ and a factor $F$ modelling seasonal aspects (in the example 8 levels). Let $\beta$ denote the slope for $X$ then I want to model interactions of the slope with the factor. It is some kind of physical model thus...

How do I add a trendline with categories to HighCharts?

javascript,jquery,highcharts,regression

R: Isotonic regression Minimisation

r,regression,mathematical-optimization,linear-programming,minimization
I want minimize the following equation: F=SUM{u 1:20}sum{w 1:10} Quw(ruw-yuw) with the following constraints: yuw >= yu,w+1 yuw >= yu-1,w y20,0 >= 100 y0,10 >= 0 I have a 20*10 ruw and 20*10 quw matrix, I now need to generate a yuw matrix which adheres to the constraints. I am...

How to find algo type(regression,classification) in Caret in R for all algos at once?

r,machine-learning,classification,regression,caret

R: HAC by NeweyWest using dynlm

r,time-series,regression