+ Reply to Thread
Results 1 to 3 of 3

Thread: Error in Statistica Visual Basic macro

  1. #1
    Points: 3,731, Level: 38
    Level completed: 54%, Points required for next Level: 69

    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error in Statistica Visual Basic macro



    Hi guys.

    I'm having a problem writing Statistica Visual Basic macro.
    Look at the code:

    Dim har () As Double, sample () As Double, card As Byte

    ...

    ReDim har (1 To S1.NumberOfVariables) As Double
    'S1 is active spreadsheet

    ...

    ReDim Preserve sample(1 To card) As Double
    ValStDeviation (sample, 1, card, har(j))

    I get "Expecting already dimensioned array" error.
    If one looks at ValStDeviation function description it is as follows:

    ValStDeviation(ByRef arr() As Double, ByVal Start As Long, ByVal Count As Long, ByRef result As Double) As Long
    The ValStDeviation function returns the standard deviation of the values from among the specified number of array elements beginning with the specified element and places in the result variable.

    Any thoughts on why this error might occur ?
    Thanks in advance.

  2. #2
    Points: 3,731, Level: 38
    Level completed: 54%, Points required for next Level: 69

    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got it guys.

    All I need to do is to put the comment

    '$include: "*STB.svx"

    in the beginning.

  3. #3
    Points: 6,853, Level: 54
    Level completed: 52%, Points required for next Level: 97

    Location
    Massachusetts
    Posts
    111
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Thanks for posting your fix


    Thank you for posting your fix. I use Statistica; I think it is a great tool and I'm happy when I see it getting traffic in stats forums.

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 12-05-2010, 04:07 AM
  2. Good Visual Basic Text for statistics
    By michaelperri in forum Applied Statistics
    Replies: 1
    Last Post: 10-22-2010, 05:00 PM
  3. This STATISTICA macro doesn't work. Help!
    By kobylkinks in forum Other Software
    Replies: 2
    Last Post: 12-22-2009, 06:46 AM
  4. Statistica Poisson Error ANOVA Model
    By Jimdare in forum Other Software
    Replies: 1
    Last Post: 06-04-2009, 05:40 PM
  5. Visual statistics
    By quark in forum General Discussion
    Replies: 2
    Last Post: 09-26-2005, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats