LinEst Documentation

neant

New Member
Joined
Apr 8, 2011
Messages
1
First of all Hi to everyone!

Im trying to write a LinEst VBA function but have some difficulties because I dont really know how to handle that LinEst correctly.
I also dont find any detailed documentation about that function in the web. So hopefully anyone here can help me.
Im using Excel 2010.

My model is one of the following type:
X = B_0 + B_1*Y + B_2*(Z)

The dependent variable X, the datas used to estimate my B's, i would like to pass to the function as a Range.
Y and Z Im going to calculate in the function.

So, when I pass X as Range to the function, and X consists of one row and twelve columns, does "Excel consider" that as a two dimensional Array like X() as Double, ReDim X(1, 12)?

Im asking that because Y and Z probably should be the same type of array as X when used in LinEst.

And assuming X, Y, Z are (1,12) Arrays, can LinEst handle that type at all?


Doing the same using a spreadsheet is pretty easy and looks like that (to make clearer what Im actually trying to do):
neuesbildsu.png

RGP is just what LinEst is called in german.

So, in the spreadsheet i have to pass the dependent variables Y and Z as one Range. Those I would now like to compute in the VBA function. Does that mean that I have to add Y and Z as one single Array with two rows and twelve columns? Like Dim YandZ() as Double, ReDim YandZ(2, 12)?
And then pass that to LinEst?

And what exactly is the return value of LinEst. Well obviously Ill recieve three B's, but do I have to save them in a one-row-three-columns-Array as in the spreadsheet?
Like Dim Results() as Double, ReDim Results(1,3),

Results = WorksheetFunction.LinEst(X, YandZ, True, False) ??


I know that are a lot of questions, and some of those may seem a bit stupid, but i just get the error message #name? all the time and so I have no idea what exactly Im doing wrongly.
Id be really thankful if someone more LinEstexperienced could help me here.
Greetings.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
You say that X,Y, and Z are arrays, but then you use something named YandZ in your call to LinEst. What is that supposed to be? Is that another array ( 2,12 maybe ) that contains all your Y and Z values?

The return of LinEst is a 3 element 1-based array, as in Results(1) and Results(2) and Results(3).
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top