Multiple Linear Regression In VBA?

Oct 16, 2008

I would like to run a multiple linear regression in vba. I have one dependent and three explanatory variables. I will have to use a macro of some kind, since I need to run too many regressions to do it manually. To simplify things a little bit:

- There will always be exactly three independent variables

- There are no missing values

- The data is allways numerical

I've already got four ranges defined: Yrange, X1range, X2range, X3range. I would like to take these ranges as input parameters for the regression model. The only two parameters I need are Sum Square for Regression (SSR) and the degrees of freedom. I understand that you can use excel's matrix formulas to calculate some of the input parameters, but one doesn't really get around vba. Any (simple) source code allowing me to conduct a regression with three input parameters?

View 7 Replies


ADVERTISEMENT

Linear Regression?

Jul 21, 2006

I was handed the attached file. understand everything except how the values in row 6 were derived No formula present when I received the file, just the numbers. Row 7 is hard entered scores the units achieved

View 8 Replies View Related

Linear Regression On Single Set Of Numbers

Jan 27, 2013

If I have a set of numbers 1,2,3,4,5,6,7,8,9 in cells, how can I get a line of best fit, linear regression, in the cells next to them?

View 1 Replies View Related

Linear Regression Array - Significance Of R Testing

May 5, 2014

I have set up a linear regression array in Excel and now want to test the significance of my r2 value at a certain level of significance. I've only been able to find tables that give the critical r value, but I want to test it at 99.73% level of confidence and none of them contain that specific value. Is there a way to do this in Excel?

View 3 Replies View Related

Linear Regression Over The First 5 Points In The Set Of Data On The Same Graph

Mar 2, 2009

I have a set of data. I know how to do linear regression over the whole set of data. How do I have another linear regression over the first 5 points in the set of data on the same graph ?? I am using Excel 2007

View 14 Replies View Related

Estimate Linear Formula From Multiple Coordinate Pairs

Aug 13, 2007

I have 32 pairs of coordinates (X,Y). If I graph them using a scatter chart in Excel, I can see that it looks like they suggest a linear relationship between the points.

Other than printing the chart and trying to draw a "best fit" line manually, is there some sort of way I can get Excel to come up with the "best" linear formula (y=mx+b format)?

View 9 Replies View Related

Regression Automation In Vba

Oct 2, 2008

The above is a screenshot of the data analysis (regression) I want to automate with vba code. Like all macros, I tried to record first and only got the following

View 3 Replies View Related

Constrained Regression Using Solver

Nov 11, 2008

I have the following dataset and was wondering how I can run a constrained regression in Excel with the constraint being that the total allocation of assets is 100%:

Total return (y): 12 data points
Asset 1 (x1): 12 data points
Asset 2 (x2): 12 data points
Asset 3 (x3): 12 data points
Asset 4 (x4): 12 data points
Asset 5 (x5): 12 data points
Asset 6 (x6): 12 data points

[Attached is a spreadsheet with the actual dataset]

I know the regression equation I need is R = b1X1 + b2X2 + ….+ (1 - b1 - b2 -….- b5 )X6 + e

View 14 Replies View Related

Using The Regression Function From Within A Macro

Jul 9, 2009

I am wanting to write a macro which uses the excel multiple regression function (a part of the data analysis add-in). I tried recording a macro while I selected the regression function (Tools> Data Analysis... etc.) which produced the following:

View 3 Replies View Related

Quadratic Regression Calculation

Feb 8, 2007

I am trying to set up the formula y = ax^2 + bx + c. Is there a function for that in excel?

To get a little more into my overall goal. I will have a x constant that will remain the same, but I have 8 different sets of a,b, & c coefficients. So, I would like to set up something like, if a row is labeled A1, find the A1 set of coefficients and use them in the quadratic equation. I was thinking I would need to use a CSE, is that correct?

View 3 Replies View Related

Dynamic Trend Regression Formula?

Jan 10, 2014

Ok so heres an example workbook:

Book5.xlsx

As you can see from the workbook, each column's amount of numbers depends on the data pulled from an index/match function.

These numbers will change and I want the TREND function to dynamically change with the data.

View 4 Replies View Related

Excel 2007 :: How To Personalize The Regression

Dec 19, 2012

I have one question about the regression. i know how can i do it lineair, exponentiel ... but how can i make a personnalised regression ? for example, if i have i function f(x)=a+b*x^2 or another function ... how can i introduce my function to draw the regression ? i have excel 2007

View 2 Replies View Related

Multivariate Polynomial Regression In Excel?

Feb 8, 2010

I am trying to do multivariate polynomial regression in excel, trying to correlate data of the form y=f(x1,x2) with second order polynomials:

Y = c + a1*x1 + a2*x1^2 + a3^x1^3 + b1*x2 + b2*x2^2 + b3*x2^3

Using the following command, I have achieved this:

=LINEST(A2:A10,B2:B10^{1,2,3,0,0,0}*C2:C10^{0,0,0, 1,2,3},TRUE,TRUE)

theory Excel uses for this kind of regression?

View 4 Replies View Related

How To Plot Scatter Graph With Regression

Nov 20, 2013

Given 100 samples, to calculate: numbers of hours spent on study is dependent on numbers of hours spent on social networking site.

x (social networking site)
y (study)
x^2

xy

6
4
36
16
24

[Code] .......

SUMMARY OUTPUT

SUMMARY OUTPUT

Regression Statistics

Regression Statistics

Multiple R
0.571423290877713

[Code] ....

So, I've got the coefficient of correlation equals to 0.57, how can I plot my scatter graph?

View 1 Replies View Related

Incorporating Data Analysis: Regression Into A Macro

Apr 10, 2009

I'm trying to write a macro that will analyze data from one spreadsheet and do a regression. The information I want to be output on the same sheet. I tried to use the record function, but I got an error. It said "Run-time error '1004': ATPVBAEN.XLA could not be found. The code read:

View 2 Replies View Related

Linear Interpolation

Feb 10, 2007

need an excel simple formula or function that returns values of y for given x in a two-dimensional array and works in the following way.actually a combination of linear interpolation and lookup/linear search. as in following example

x y
1 10
2 15
3 20

if x=1.5 then y=12.5 (answer available thru FORECAST but incomplete)
if x=2 then y=15 (answer available thru LOOKUP but incomplete)

so for whatever the x i need/get a valid y thru a single formula/method !
sorry m not good in math,

View 9 Replies View Related

Regression Coefficients Estimated Incorrectly When Centered Predictors Used

May 23, 2007

to getting accurate regression coefficients from a dataset with *small* (standard) numbers, which contains centered predictors. More specifically, I have a dataset with 18 observed data points containing a criterion (y), a centered predictor variable (x), another centered predictor variable (z), and the interaction of the two centered predictor variables (xz). This multiple regression equation is structured to test for interactions between the two continuous predictor variables (x and z) as prescribed by Aiken and West (1991) in their classic book.

When I run the regression in Excel with the centered predictors, some of the regression coefficents in the output are estimated to be 0, although they are clealry *not* 0 as estimated by SPSS 14.0.2. I have spent many hours troubleshooting this problem (and searched many forums on the internet) and still do not know why this is happening.

Initially, I thought the problem might have to do with the cross-product of the centered predictors, but even just doing a regression with one of the centered predictors (for certain centered predictors) yields a regression coefficient of 0 (although it should be non-zero as per SPSS 14.0.2). When doing these multiple regressions with non-centered predictors, all regression coefficients are estimated accurately.

I was wondering if anyone had any insights on why I am experiencing these problems.... If anyone wants a sample of some test data I have used to troubleshoot these problems, you can download a file from: [url] and/or email me at (email deleted by Mod) for more datasets or questions.

View 5 Replies View Related

Absolute Value To Linear Program

Mar 29, 2013

I have to convert the first to the second program, but i don't know how to do this:

MAD.png

ABStolinear.xlsx: the first sheet is the first program which is correct (i think), the second sheet is a failed attempt to write the second program

View 5 Replies View Related

Bi-linear Interpolation VBA Code

Feb 10, 2009

I have 3 equations and have created the relevant chart from them. What I would like to do is put in a value of x & y and get result z. Having done a search through previous threads I found some BiLinear Interpolation code that works using the table in a workbook, but what I'd really like is the Interpolation of the formulae rather than the resulting table and for it to be embedded in VBA.

View 6 Replies View Related

Forecast Linear Trend Between Min & Max

Jan 4, 2007

I am using the Forecast formula to give me a value from a Linear trend. However I need to limit the resulting value that is displayed within a min and max value. Background: This is to allow me to calculate the amount of bonus someone will earn depending on the Percentages of their target they achieve. The min bonus is 25% when 80% of target is achieved and max bonus is 100% when 125% or greater of target is achieved.
So the Forecast formular works great using the existing values, but i need help limiting the results to between 25% and 100%. I was trying to use a sumif formula to copy the resulting cell but only if the value fell between the 25 and 100%. I've attached the spreadsheet as I think it will highlight what i'm trying to do better than I can explain it.

View 2 Replies View Related

Calculate Linear Interpolation

Oct 4, 2007

In the attached sheet, I have measured data from a device. It shows Input, Output, gain and delta. You can see as input increases, delta comes down. I want to find the output corresponding to delta od -1. In the table, I have enteries for delta of -0.982 then -1.382, not for -1. How to find output corresponding to delta of -1?

View 6 Replies View Related

Calculate A Linear Sliding Scale

Oct 9, 2008

I need a formula to calculate a linear sliding scale from 10%-30% (no higher, no lower). Based on the data in the below chart, if the GROR (let's say this is known and the result resides in cell A1) is less than or equal to 0.0% the payout % is 10.0% and gradually increases as the GROR increases.

The payout % is capped at 30% which is if GROR is 18% or greater. Below are just some examples of how certain thresholds should calculate.

GROR 0.0%5.0% 8.0% 11.0% 14.0% 18.0%+
payout %10.0%10.0%14.6%19.2%23.8%30.0%

View 2 Replies View Related

Linear Weighted Moving Average

Nov 25, 2006

I have done quite a bit of looking on Google and looked over the posts in this forum, however, I can't find an example Excel worksheet for a linear weighted moving average.

The data set I am applying this to has 180 data points and the linear weights should extend back over the last 30 points.

View 9 Replies View Related

Non Linear Scale Applied To Data

Mar 8, 2008

in this example below i need to work out what the divsor would be for values inbetween the data?

View 9 Replies View Related

3D Linear Algebra. Translate To Best Fit Plane

Mar 20, 2008

I have several hundred points in cartesian x,y,z coordinates. I used an Excel add-in program to calculate the equation of best fit to the points. The equation is:

z=A*x+B*y+C
where (for this case):
A= 2.29091
B= -1.77338
C= -192.494

My objective is to define the several hundred x,y,z points in cartesian coordinates about a new cartesian coordinate system whose origin is the centroid of the data points and whose z plane (ie z=0) is equal to the best fit plane defined above (when referenced from the original coordinate system).

Using Pro/e (a cad program), I was able to create the new coordinate system using the x, y, and z intercepts from the best fit plane, and then was able to redefine the points about the new coordinate system. After the points were redefined in Pro/e, I was able to export the points back to Excel; however, I would prefer to only use Excel / VBA because I prefer the calculations be transparent for optimal accuracy and validation.

View 9 Replies View Related

Regression Error - Non-Numeric Data / Contiguous And Complete Rows Or Columns

Apr 10, 2013

However I have a subject at uni that requires me to create a series of regression models, histograms, correlation matrices etc.

For part of the assignment, i have to run 4 regressions (one for men & one for women) with dependent variable as average wages, and independent as bfast 1,2,3 and dinner 1,2,3 (all of which are dummy variables) (0 for male and 1 for female).

The second two regressions are exactly the same, except average wages must be transformed into log which i have already done.

I dont know how to differentiate the regression models into male and female (if possible). We must also include residuals and residual plots.

I keep getting an error that says non-numeric data, the other says input range must be a contiguous reference.

View 1 Replies View Related

Macro To Run SOLVER Across Several Sheets On Linear Program

Nov 18, 2012

Writing a macro to run SOLVER on a linear program. I have twenty tabs, each with a linear program and a solver already set up (constraints, cells to change, and cell to maximize). I would like to run a sub that will solve each tab's LP by running the tab's SOLVER...

If it makes it easier, my cell to maximize is I17, by changing B16:H16, subject to I20:I40 SolverAdd -> SolverOk -> SolverSolve

View 1 Replies View Related

Fill Blanks With Linear Numeric Series

Apr 18, 2008

I would like to find the blanks within a column. Using the available cell values above and below compute a sort of linear function then, using that linear function fill in the blanks in between. So the values are linearly increasing or decreasing (whatever the case maybe) to the next available nonblank cell value. spreadsheet attached.

View 3 Replies View Related

Intersecting Points Of Chart Linear Plots

May 10, 2008

I would like to find the intersection points of all of the linesshown on the included chart. If that could be output into a table, by the day, that would be ultimately what I am after. http://bladeseri.50megs.com/Intersects.png. Guess 50megs.com doesn't allow this type of reference. Here is Geocities link http://www.geocities.com/bladex2007/Intersects.png

View 5 Replies View Related

Forecasting Using Historical Seasonally Effected Non-linear Data

Jan 15, 2010

Forecasting using historical seasonally effected data

I organize my thoughts in numbers so it will be easier to understand.

[1] Say I have this data from January 2009 to December 2009:

1-4-7-10-13-14-15-16-18-20-22-25

As you can see, the growth is not linear.

[2] So then, I start with this data point for Janaury 2010.

26-a-b-c-d-f-g-h-i-j-k-l

[3] I now want to forecast that data point for the rest of 2009...using the growth in [1]. SO i guess that's an easy task right? Take the percentage change from Jan 08 and Feb 08...and apply that to the 26...and so on. (am i correct here at least).

[4] But lets say we have a GOAL. So, this become a forecast/plan. In December 2010, i want to grow double the amount of that in December 09. So 25 x 2 = 50. Now, the "known" data is like this:

26-a-b-c-d-f-g-h-i-j-k-50

So how do i do this now?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved