Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
77 views

I'm getting an odd problem where I've attempted to plot a scatter graph and fit a quadratic regression line to it. I used stat_smooth() to make the line, and stat_regline_equation() to print the ...
CJG's user avatar
  • 3
1 vote
0 answers
163 views

I am regressing Y~(X1, X2) such that this fit is perfect (R squared is 1), where the R squared for Y~X1 and Y~X2 are chosen somewhere in the interval $(0,1)$. I am trying to create the numerical ...
turtlesandwich's user avatar
1 vote
0 answers
44 views

I can't seem to wrap my head around this: What is the glm() equivalent for lm(log(y) ~ x1 + x2, data=data)? Is it? a. glm(y ~ x1 + x2, data=data, family=gausssian(link="log")) b. glm(log(y) ...
Mubita 's user avatar
0 votes
0 answers
59 views

I’m trying to create a simple model in Java that predicts marks based on study hours (using a basic linear regression formula). My goal is to make it interactive — where the user can enter the number ...
vadde sree's user avatar
2 votes
0 answers
88 views

I would like to obtain estimates of the variance explained by each predictor in multiple regression using robust linear regression (for instance with the R function lmrob from robustbase R package or ...
CafféSospeso's user avatar
-3 votes
1 answer
39 views

I just want to ask whether the function mmec is deprecated in the latest version? because when I am trying to use it, its displaying (could not find function "mmec") message. It is ...
Muhammad Kamran's user avatar
0 votes
0 answers
66 views

My code: def calc_cost_function(w, b, data): m = len(data) cost = 0 for i in range(m): x = data.iloc[i].X y = data.iloc[i].Y cost += ((x * w + b) - y)**2 return ...
Aditya Verma's user avatar
0 votes
1 answer
46 views

I'm working with DolphinDB and trying to compute weighted least squares (WLS) regression between multiple pairs of columns in a table. The mslr function (moving least squares regression) works ...
Stella.W's user avatar
1 vote
1 answer
74 views

I am planning to make a Linear Regression model using C. It takes a set of m points as input from stdin using scanf. The points are defined as a struct: typedef struct{ double x; double y; } ...
Nirav Pandey's user avatar
2 votes
1 answer
95 views

I created two models using the lm() function in R. The first model, I created the design matrix for my prediction variable and then fed that into the lm() function. copy <- data.frame(mtcars) ...
Arthur's user avatar
  • 21
3 votes
0 answers
76 views

I have some real data points, and I'm trying to use the ODR to fit linear regression and also output the uncertainty error of the slope. import numpy as np from scipy.odr import ODR, Model, RealData ...
Mom Mam's user avatar
  • 151
0 votes
1 answer
27 views

In DolphinDB, I'm trying to perform multiple regression on multiple columns by using metaprogramming function sql, but I'm getting an error. Here's my script: sql(sqlColAlias(makeUnifiedCall(toArray, ...
saki's user avatar
  • 319
2 votes
2 answers
66 views

I am quite new to the data analytics stuff and R/RStudio so I am in need of advice. I am doing a project and asked to do: for every variable that has missing value to run a linear regression model ...
petar's user avatar
  • 21
0 votes
1 answer
48 views

I'm trying to implement a simple linear regression algo, and for that I've written two functions: Cost function Gradient descent Cost function appears to work normally, as in it's not giving me ...
Lucirie's user avatar
  • 15
3 votes
1 answer
132 views

Currently using R 4.4.3 on Windows 11. I'm plotting the following data set with ggplot2 and performing a linear regression with geom_smooth: df <- data.frame(A= c(1.313, 1.3118, 1.3132, 1.3122, 1....
jeffgoblue's user avatar
6 votes
2 answers
138 views

I'm trying to conduct the residual analysis for simple linear regression. I need to prove that the residuals follow an approximate Normal Distribution. The csv file I'm using has values for Percentage ...
advaitketkar's user avatar
0 votes
0 answers
30 views

I'm new in Python. I would like to know wheter there is a package that performs the same thing as Stata's 'xtregar' ou R's 'panelAR'. I would like to estimate the following regression Y_{i,t}=\alpha+\...
jorgep's user avatar
  • 317
6 votes
1 answer
78 views

I'm looking to build out a multiple regression in Python and need to numerically encode my categorical data. I have fields such as gender (Male, Female, Prefer not to Say), education level (High ...
learning to code's user avatar
0 votes
0 answers
49 views

The pine-script below is a variant of a script published by henryph24 to plot the linear regression slope: //This source code is subject to the terms of the Mozilla Public License 2.0 at https://...
kaladendra's user avatar
2 votes
1 answer
294 views

I have a training dataset with six features and I am using SequentialFeatureSelector to find an "optimal" subset of the features for a linear regression model. The following code returns ...
CodingLikeAFox's user avatar
0 votes
0 answers
26 views

I am trying to fit a multiple regression model to my data. I am testing the hypothesis that outcome Y is linearly related to independent variable X, while controlling for a linear relationship with ...
user29991160's user avatar
0 votes
0 answers
23 views

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) num_features, bin_features, cat_features = split_features(X) preprocessor = ColumnTransformer([ ('num', ...
Nikola's user avatar
  • 1
3 votes
2 answers
103 views

It's in the title, however here is an example # df is the sample data df <- data.frame(a = c(1:10), b= c(10:20), c = c(20:30), d= c(30:40)) rq_cols <- c(a,b,c) #the desired output is: fn <- ...
ben_bjr's user avatar
  • 31
0 votes
0 answers
41 views

I’m performing linear regression in Python with statsmodels. I have two categorical predictors: sample: a factor with 8 levels distractor: a factor with 2 levels My goal is to determine the “...
Blade's user avatar
  • 1,140
0 votes
0 answers
34 views

I want to apply constrained ordinary least-squares regression similar to what is done with R here, but in Matlab. The documentation doesn't suggest how to accomplish this with the available routine ...
Buck Thorn's user avatar
  • 5,092
2 votes
0 answers
53 views

I’m using caret::train in R with method = "glmStepAIC" to perform stepwise regression with repeated cross-validation (trControl = splitRule). My model includes interaction terms and I want ...
Coraline Lowes's user avatar
1 vote
1 answer
115 views

I'm looking to make added variable / partial regression plots for a regression with an interaction, which we can do with car. # packages library(car) # linear model with 2-way interaction lm1 <- lm(...
user14278898's user avatar
0 votes
1 answer
155 views

I am trying to use predict function in RStudio on some new data. However I keep getting an error, "Error in qr.solve(qr.R(qrX)[p1, p1]) : singular matrix 'a' in solve". Where is my mistake? ...
stella1897's user avatar
1 vote
1 answer
59 views

This is my first consult, happy to share the community :) (You would notice I'm not a native english speaker and also I'm not very good using R, actually these are my firsts steps). I'm trying to ...
Josep Ramos's user avatar
0 votes
0 answers
26 views

I have a large proteomics dataset with thousands of proteins that I am regressing against an outcome to determine which proteins associate with the outcome. Some of the proteins appear multiple times ...
bbbbsp's user avatar
  • 35
0 votes
0 answers
20 views

In Vertical Federated Logistic Regression, suppose there are two parties, A and B, where Party B holds the label values. If Party A obtains the gradient information in plaintext, it can infer the ...
user23768667's user avatar
1 vote
1 answer
110 views

I have a set of linear regression problems, whose dimensionalities vary from 2D (line fitted to a single independent variable), to 3D (plane fitted to two independent variables) to nD where hyperplane ...
Suola's user avatar
  • 15
1 vote
1 answer
75 views

I am doing a course on linear regression with R using the tidymodels package and the sample code for specifying the linear regression model is: linear_model_specification <- linear_reg() %>% ...
phasedarray's user avatar
0 votes
0 answers
23 views

I want to conduct an a priori power analysis to determine the necessary sample size for a proposed project. I will estimate a regression between two continuous variables with a binary moderator (...
medusa's user avatar
  • 45
0 votes
0 answers
62 views

I'm working to minimize the RMSE for the Boston housing data set. This is a very basic result: library(Metrics) df <- MASS::Boston train <- df[1:400, ] test <- df[401:506, ] Boston_lm <- ...
Russ Conte's user avatar
0 votes
0 answers
29 views

I'm trying to train a model to predict the close column 2 steps ahead. Prepared the dataset: datetime close close_forward close_shift_1 close_shift_2 close_shift_3 close_shift_4 close_shift_5 2024-10-...
Graf 35's user avatar
2 votes
0 answers
50 views

I am using statsmodels to perform a robust linear regression on some data I have. I wanted to understand whether the slope of my regression is significantly different from 0. In scipy I due this by ...
donkey's user avatar
  • 1,458
2 votes
1 answer
118 views

I am working with stress-strain curves which initially has a linear trend after which there the trend is variable from test to test. I am trying to find the point at which the data deviates from this ...
travgeol's user avatar
0 votes
1 answer
107 views

I am working on a regression task where my feature matrix consists of two features: a linear term and its square (quadratic feature). My model is predicting values correctly, but after numerous ...
Stephen's user avatar
0 votes
0 answers
35 views

I'm quite new to ML and I'm trying to do a linear regression with quite a simple dataset: text I did two different regression, one by hand and the other one using sci kit learn, where in the latter I ...
MIKEL LASS's user avatar
0 votes
1 answer
40 views

I've programmed a linear regression model from scratch. I use the "Sum of squared residuals" as the loss function for gradient descent. For testing I use linear data (y=x) When running the ...
Blacklight's user avatar
1 vote
0 answers
59 views

I'm running a linear regression model and then a standard error mean model + trying to view their results together in a table lm1 <- lm(foodsec_pct_male ~ log(agri_employment_share) + ...
Tania Miah's user avatar
5 votes
1 answer
100 views

Recently, I was comparing two statistics exercises and found out that different outputs for the same input in R is perhaps unintended behavior of R, right? model1 <- lm(rent ~ area + bath, data = ...
Martin Dallinger's user avatar
0 votes
0 answers
36 views

I am working on an OLS regression problem where: The dependent variable (target) ranges from 1 to 6 (with steps of 1). The independent variables range from 1 to 10 (with steps of 0.5). I want to set ...
ASD's user avatar
  • 47
0 votes
0 answers
53 views

I am running models with plm with re-calculated standard errors. The challenge? I want to turn the models with the updated standards errors into a stargazer regression table. Here is some sample data ...
YouLocalRUser's user avatar
0 votes
1 answer
96 views

I have an issue with this linear regression model. The scatter plot shows data points well into the negative when no negative values are within the data set. I've checked the shapes and minimum values ...
leakie's user avatar
  • 1
0 votes
0 answers
18 views

I tried to construct dmatrix from the dataframe of dtype='complex', but I got the error: numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'multiply' output from dtype('complex128') ...
Даниил К's user avatar
0 votes
0 answers
29 views

Seeking advice on how I could forecast the below better. Ultimately I am looking to build a 5-year rent growth forecast, but as part of the forecasting process, I will need other variables. Currently, ...
jmaval's user avatar
  • 313
0 votes
1 answer
142 views

I'm trying to make a neural network model that will answer a linear regression problem (I've already made a model using sklearn's LinearRegression and I'd like to compare the two). Ultimately I'd ...
leyjfk6's user avatar
0 votes
1 answer
78 views

I am trying to write this formula in R where i = each value of the category (category can be 1 2 3 or 4) This is my code attempt but R prints this error message: Error in lm(category ~ (year * state *...
ithoughtso's user avatar

1
2 3 4 5
131