Showing posts with the label r

[FIXED] R Derivatives of an Inverse

Issue I have an expression that contains several parts. However, for simplicity, consider only the …

[FIXED] Plotting derivative of nls model in R

Issue I have used nls function to fit the following equation y ~ (C + (A1*exp(-x/h1)) + (A2*exp(-…

[FIXED] Plot combining regression coefficients (partial derivatives) with CIs in R, lincom + coefplot or plotbeta?

Issue Most of the time we run a regression with interactive terms, we are interested in a partial d…

[FIXED] How to create a new column with the derivative of a set of time serie values

Issue I'm looking for help with R. I want to add three columns to existing data frames that con…

[FIXED] simplify algebraic expressions in R

Issue I would like to solve a first order condition given an expression in R. I have successfully t…

[FIXED] How to create a precision recall curve from a random forest model?

Issue I am trying to create a precision recall curve from a random forest model based off of just t…

[FIXED] How to calculate 95% CI for area under the precision recall curve in R

Issue I calculate area under the precision recall curve using the Mleval package. The Mleval packag…

[FIXED] Predict on test data, using plm package in R, and calculate RMSE for test data

Issue I built a model, using plm package. The sample dataset is href="https://docs.google.com/…

[FIXED] map/loop different regression models for multiple dependent and independent variables

Issue I know there is a lot on this topic, but I still could not figure it out myself. I have a dat…

[FIXED] How could one use either an lapply or a For Loop combined with an IF in R to return just the names of LASSO IVs with coefficients > 0?

Issue I have via lots of legwork and previous helpful answers to previous Stackoverflow questions s…

[FIXED] How to make a Stepwise Regression function which runs fine on a single csv run on a folder full of csvs using lapply?

Issue I am trying to run/fit an individual Backward Elimination Stepwise Regression on each of N cs…

[FIXED] ggplot2: How to plot an orthogonal regression line?

Issue I have tested a large sample of participants on two different tests of visual perception – no…

[FIXED] Find the break point and compare slopes

Issue With my following data: structure(list(id = c("AC12-PRD-C1", "AC12-PRD-C1&quo…

[FIXED] Programmatically add residuals by group as new column

Issue I'm trying to add columns to lists in a for loop and I've tried $ notation and the f…

[FIXED] Adding Regression Line Equation and R2 on SEPARATE LINES graph

Issue A few years ago, a poster asked how to add regression line equation and R2 on ggplot graphs a…

[FIXED] Compare predicted values from group-wise linear regression models

Issue I have the following data for two groups ("Healthy" and "CAD"): df <-…

[FIXED] Custom Simple Contrasts R/emmeans, how to exclude comparisons

Issue I'm trying to exclude contrasts from simple pairs. Made up data: library(emmeans) libra…

[FIXED] Relative importance for several groups in R

Issue How do I calculate the relative importance using relaimpo package in R when I want to run it …

[FIXED] non-numeric argument to binary operator with nls

Issue I'd like to fit a non-linear model using nls , but I'm getting a non-numeric argument…

[FIXED] Using restricted spline functions in a multivariable regression model

Issue I am just struggling to find an answer to a statistical/R questions concerning the use of spl…