Solved

What is Access Equivalent of RSQ Function in Excel?

Posted on 2006-10-19
4
705 Views
Last Modified: 2012-06-27
Hi All --

My niece called me (her Auntie Access Developer) asking me how to do a RSQ in Access... I found a bit of info on Pearson's Correlation, but it was a bit dated.

Can anyone tell me how to do this?  She says, " We have the known X and Y values but cannot figure out how to use the RSQ function in Access that Excel has.  It would also be helpful if we could calculate both the linear and logarithmic r-squared value. "

Kids are so smart these days...

Thanks in advance!

Ronda
0
Comment
Question by:Ronda-S
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 50 total points
ID: 17771707
I am now aware of any. Unless your excellent in School Maths :) u could code it yourself

I just checked wikipedia - Blimey!!!   http://en.wikipedia.org/wiki/Correlation


Alternative is to graph in Excel then use excel automation to calculate it. Nasty though, not fun sorting out graphs in excel via automation. I havent done that before
0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 450 total points
ID: 17772233
Sorry - don't know anything about maths... (ahem.. looks nervously around the room incase anyone realizes and *makes* me do it :-S)

:-p
As interesting as evaluating that function (maths function as opposed to VBA) could be - I'd look to avoid the work - and just reference the Excel function from Access.

Function fGetExcelRSQ(arrX, arrY)

    Dim objExcel As New Excel.Application
   
    fGetExcelRSQ = objExcel.WorksheetFunction.RSq(varrX, varrY)
   
    objExcel.Quit
    Set objExcel = Nothing
   
End Function

For it to be truly useful on a performance level though - you'd really want to have the Excel object as a module level object variable - that's opened and persisted as long as necessary for each subsequent call - and then just use the function whenever you wanted.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17772245
LPurvis has given the example of what I was talking about - excel automation
I actually thought it would be more complicated, oh well

Just to add to LPurvis's post, u had better add a reference to Microsoft Excel object library or use latebinding - create as object
0
 

Author Comment

by:Ronda-S
ID: 17789564
Thanks to both of you for your post -- I appreciate the input.

I'll pass this on... although I still don't know what the *&%! Pearson's Coefficient is supposed to ultimately do, I did learn something out of this for myself:  I have worked with some basic Excel automation, I didn't know you could create an Access function based on an Excel Function like you did, LPurvis.  I'll have to play around with that one... maybe with an Excel function I understand!

;-) Ronda
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question