473,494 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

question about regression in Access

I am developing an Access/SQL2k app for a science lab. One of the lab
folks asked me this, and I don't know the answer:

Is it possible to do simple, straight-line trends somehow in Access
without having to export the data to a statistics package or Excel?

IOW, can I create a query (or at the very least a chart) that will show
the trendline for a data series?

Thanks for your help,

--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison
Nov 13 '05 #1
6 3497
If you've got a bit of a budget, check out Total Access Statistics, from FMS
http://www.fmsinc.com/products/statistics/index.html

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Terrell Miller" <mi******@bellsouth.net> wrote in message
news:9i*******************@bignews6.bellsouth.net. ..
I am developing an Access/SQL2k app for a science lab. One of the lab folks
asked me this, and I don't know the answer:

Is it possible to do simple, straight-line trends somehow in Access
without having to export the data to a statistics package or Excel?

IOW, can I create a query (or at the very least a chart) that will show
the trendline for a data series?

Thanks for your help,

--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison

Nov 13 '05 #2
Douglas J. Steele wrote:
If you've got a bit of a budget, check out Total Access Statistics, from FMS
http://www.fmsinc.com/products/statistics/index.html


Thanks, Doug. Budget is a theoretical concept for this government agency
these days, but I'll check it out. Looks like you can buy a single-seat
license for $600 and then include a free runtime add-in to just get the
raw stats coming out, which is all we'd need.

That may be preferable to pulling the data into SAS.

Thanks again,

--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison
Nov 13 '05 #3
Terrell Miller wrote:
I am developing an Access/SQL2k app for a science lab. One of the lab
folks asked me this, and I don't know the answer:

Is it possible to do simple, straight-line trends somehow in Access
without having to export the data to a statistics package or Excel?

IOW, can I create a query (or at the very least a chart) that will show
the trendline for a data series?

Thanks for your help,


From an old (1998) post ; you can get slope and y-intercept with
something like this.

Sub sRegressionLine()
Dim dbs As Database, rcs As Recordset
Set dbs = CurrentDb()
Set rcs = dbs.OpenRecordset("SELECT Sum(Data.X) AS SumX, " & _

"Sum([X]*[X]) AS SumXX, Sum(Data.Y) AS SumY, Sum([X]*[Y]) AS SumXY,
" & _
"Count(Data.X) AS N FROM Data " & _
"WHERE (((Data.X) Is Not Null) AND ((Data.Y) Is Not Null));")
m = (rcs!N * rcs!SumXY - rcs!SumX * rcs!SumY) / (rcs!N * rcs!SumXX -
rcs!SumX ^ 2)
b = (rcs!SumY * rcs!SumXX - rcs!SumX * rcs!SumXY) / (rcs!N *
rcs!SumXX - rcs!SumX ^ 2)
End Sub

I guess today I would do it a bit differently .. at least to use Count(*).

You can then interpolate with

"UPDATE Data SET Data.Y = " & _
"(" & m & ")" & " * [X] + (" & b & ")" & _
"WHERE (((Data.Y) Is Null) AND ((Data.X) Is Not Null));"

You could use the same query to extrapolate; need I say that
extrapolation of itself must be suspect?
Nov 13 '05 #4
The simplest thing to do is to use Access automation with Excel. Excel only
needs two columns of data (X and Y) so you export your data from a table or
query. Excel puts the regression results in a table in a specified location
on the spreadsheet so that makes importing the results into Access very
easy. All the while this is going on, Excel doesn't even have to appear on
the screen. The results will include the slope of the line, the Y intercept
and statistics about the goodness of the fit of the data.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Terrell Miller" <mi******@bellsouth.net> wrote in message
news:9i*******************@bignews6.bellsouth.net. ..
I am developing an Access/SQL2k app for a science lab. One of the lab
folks asked me this, and I don't know the answer:

Is it possible to do simple, straight-line trends somehow in Access
without having to export the data to a statistics package or Excel?

IOW, can I create a query (or at the very least a chart) that will show
the trendline for a data series?

Thanks for your help,

--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison

Nov 13 '05 #5
PC Datasheet wrote:
The simplest thing to do is to use Access automation with Excel. Excel only
needs two columns of data (X and Y) so you export your data from a table or
query. Excel puts the regression results in a table in a specified location
on the spreadsheet so that makes importing the results into Access very
easy. All the while this is going on, Excel doesn't even have to appear on
the screen. The results will include the slope of the line, the Y intercept
and statistics about the goodness of the fit of the data.


me likee, thanks!
--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison
Nov 13 '05 #6
Terrell Miller wrote:

folks, just a heads-up that you can add trendlines to a Pivot Chart.
Finally got around to fiddling around with that today. Choice of linear,
exponential or log. You can show the equation and r-squared. No
supersophisticated analysis, but for a simple fitted curve Pivot Charts
will do you just fine.
--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4894
by: Michael van der Veeke | last post by:
Hi All, Does anyone use any regression testing tools with MS Access? We have tried a few and none seem to work very well with a MS Access Front end and I need one. Can anyone provide any...
3
11017
by: sql guy123 | last post by:
This is a real challenge. I hope someone is smart enough to know how to do this. I have a table TABLE1
1
4787
by: wirecom | last post by:
Hi all, I am seeking a module that will do the equivalent of linear regression in 3D to yield a best fit a plane through a set of points (X1, Y1, Z1), (X1, Y1, Z1),... (Xn, Yn, Zn). The...
1
1760
by: Nod Lee | last post by:
Hi all Is there any tools/objects from Microsoft that I can use to perform linear regression in webform and generate the results into a graph? If not, is there any recommendations for 3rd...
1
1655
by: abefroeman | last post by:
I am trying to automate the regression function in the analysis tool pack. I tried to simply record myself doing a regression. When I run the macro, it cannot find the analysis tool pack. It says...
1
7190
by: ray pulbrook | last post by:
My questions are can you use access to query correlation and regression analysis or should i link an excel spreadsheet to the database that has those functions specific to the analysis. if you can do...
7
15875
by: PlsHelp | last post by:
Hi every1,this is my 1st time using this forum....pls can any1 tell me how to create a code in VB that can do LINEAR REGRESSION in excel.....i'm not sure how to xplain exactly what i need but...
0
3499
by: drfish | last post by:
Hi, I'm a complete novice when it comes to VB so need some help. I would like a macro that performs linear regression for different cell ranges each time it is run, depending on the number of...
30
5641
by: Barry L. Bond | last post by:
Greetings! I just got a new Peet Brothers Ultimeter 2100 Weather Station. This new one has a way to display the heat index, if you press the "dew point" key twice. Being aware of all the...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.