Edit tour

Windows Analysis Report
XRealStats.xlam

Overview

General Information

Sample name:XRealStats.xlam
Analysis ID:1649487
MD5:fcdf666109ccefa298cf4a752dba8b9d
SHA1:d864195be124f0ea964546ba3311a3bd25f5ef08
SHA256:acdf5bcd40fcba2805ade1c9fd636ca1515bed24dacf54b9fa75d4f0b0472726
Infos:

Detection

Score:56
Range:0 - 100
Confidence:100%

Signatures

Document contains an embedded VBA macro which may execute processes
Document contains an embedded VBA with functions possibly related to ADO stream file operations
Document contains an embedded VBA with many string operations indicating source code obfuscation
Yara detected MalDoc1
Found a high number of Window / User specific system calls (may be a loop to detect user behavior)
IP address seen in connection with other malware
JA3 SSL client fingerprint seen in connection with other malware
Sample execution stops while process was sleeping (likely an evasion)
Sigma detected: Excel Network Connections
Sigma detected: Suspicious Office Outbound Connections
Suricata IDS alerts with low severity for network traffic

Classification

RansomwareSpreadingPhishingBankerTrojan / BotAdwareSpywareExploiterEvaderMinercleansuspiciousmalicious
  • System is w10x64
  • EXCEL.EXE (PID: 6300 cmdline: "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" "C:\Users\user\Desktop\XRealStats.xlam" MD5: 4A871771235598812032C822E6F68F19)
    • splwow64.exe (PID: 4496 cmdline: C:\Windows\splwow64.exe 12288 MD5: 77DE7761B037061C7C112FD3C5B91E73)
  • cleanup
No configs have been found
SourceRuleDescriptionAuthorStrings
sharedStrings.xmlJoeSecurity_MalDoc_1Yara detected MalDoc_1Joe Security

    System Summary

    barindex
    Source: Network ConnectionAuthor: Christopher Peacock '@securepeacock', SCYTHE '@scythe_io', Florian Roth '@Neo23x0", Tim Shelton: Data: DestinationIp: 13.107.246.41, DestinationIsIpv6: false, DestinationPort: 443, EventID: 3, Image: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE, Initiated: true, ProcessId: 6300, Protocol: tcp, SourceIp: 192.168.2.4, SourceIsIpv6: false, SourcePort: 49730
    Source: Network ConnectionAuthor: X__Junior (Nextron Systems): Data: DestinationIp: 192.168.2.4, DestinationIsIpv6: false, DestinationPort: 49730, EventID: 3, Image: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE, Initiated: true, ProcessId: 6300, Protocol: tcp, SourceIp: 13.107.246.41, SourceIsIpv6: false, SourcePort: 443
    TimestampSIDSeverityClasstypeSource IPSource PortDestination IPDestination PortProtocol
    2025-03-26T20:27:06.819643+010020283713Unknown Traffic192.168.2.44973013.107.246.41443TCP
    2025-03-26T20:27:13.265859+010020283713Unknown Traffic192.168.2.44973113.107.246.41443TCP
    2025-03-26T20:27:13.269165+010020283713Unknown Traffic192.168.2.44973213.107.246.41443TCP

    Click to jump to signature section

    Show All Signature Results
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile opened: C:\Program Files (x86)\Microsoft Office\root\vfs\SystemX86\MSVCR100.dllJump to behavior
    Source: unknownHTTPS traffic detected: 13.107.246.41:443 -> 192.168.2.4:49730 version: TLS 1.2

    Networking

    barindex
    Source: Yara matchFile source: sharedStrings.xml, type: SAMPLE
    Source: Joe Sandbox ViewIP Address: 13.107.246.41 13.107.246.41
    Source: Joe Sandbox ViewIP Address: 13.107.246.41 13.107.246.41
    Source: Joe Sandbox ViewJA3 fingerprint: a0e9f5d64349fb13191bc781f81f42e1
    Source: Network trafficSuricata IDS: 2028371 - Severity 3 - ET JA3 Hash - Possible Malware - Fake Firefox Font Update : 192.168.2.4:49731 -> 13.107.246.41:443
    Source: Network trafficSuricata IDS: 2028371 - Severity 3 - ET JA3 Hash - Possible Malware - Fake Firefox Font Update : 192.168.2.4:49730 -> 13.107.246.41:443
    Source: Network trafficSuricata IDS: 2028371 - Severity 3 - ET JA3 Hash - Possible Malware - Fake Firefox Font Update : 192.168.2.4:49732 -> 13.107.246.41:443
    Source: unknownUDP traffic detected without corresponding DNS query: 1.1.1.1
    Source: global trafficHTTP traffic detected: GET /rules/excel.exe-Production-v19.bundle HTTP/1.1Connection: Keep-AliveAccept-Encoding: gzipUser-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)Host: otelrules.svc.static.microsoft
    Source: global trafficHTTP traffic detected: GET /rules/rule120603v8s19.xml HTTP/1.1Connection: Keep-AliveAccept-Encoding: gzipUser-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)Host: otelrules.svc.static.microsoft
    Source: global trafficHTTP traffic detected: GET /rules/rule120607v1s19.xml HTTP/1.1Connection: Keep-AliveAccept-Encoding: gzipUser-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)Host: otelrules.svc.static.microsoft
    Source: global trafficDNS traffic detected: DNS query: otelrules.svc.static.microsoft
    Source: ~DF01A6EB287365FF40.TMP.0.dr, vbaProject.binString found in binary or memory: http://datapigtechnologies.com/blog/index.php/why-excel-has-multiple-quartile-functions-and-how-to-r
    Source: unknownNetwork traffic detected: HTTP traffic on port 443 -> 49732
    Source: unknownNetwork traffic detected: HTTP traffic on port 443 -> 49731
    Source: unknownNetwork traffic detected: HTTP traffic on port 443 -> 49730
    Source: unknownNetwork traffic detected: HTTP traffic on port 49731 -> 443
    Source: unknownNetwork traffic detected: HTTP traffic on port 49732 -> 443
    Source: unknownNetwork traffic detected: HTTP traffic on port 49730 -> 443
    Source: unknownHTTPS traffic detected: 13.107.246.41:443 -> 192.168.2.4:49730 version: TLS 1.2

    System Summary

    barindex
    Source: XRealStats.xlamOLE, VBA macro line: ' undetermined system (error)
    Source: XRealStats.xlamOLE, VBA macro line: ' singular system (error)
    Source: XRealStats.xlamOLE, VBA macro line: tmp = Application.Run(FunctionName_, (x), IndependentVariables_)
    Source: XRealStats.xlamStream path 'VBA/Analysis' : found possibly 'ADODB.Stream' functions mode, position, write
    Source: XRealStats.xlamStream path 'VBA/Arima' : found possibly 'ADODB.Stream' functions mode, read, write
    Source: XRealStats.xlamStream path 'VBA/Desc' : found possibly 'ADODB.Stream' functions mode, position, read
    Source: XRealStats.xlamStream path 'VBA/DescriptorRegression' : found possibly 'ADODB.Stream' functions mode, position, read
    Source: ~DF01A6EB287365FF40.TMP.0.dr, vbaProject.binBinary or memory string: .VBp_Des
    Source: ~DF01A6EB287365FF40.TMP.0.dr, vbaProject.binBinary or memory string: .VBp_Des0z
    Source: ~DF01A6EB287365FF40.TMP.0.dr, vbaProject.binBinary or memory string: -.VBp_Des
    Source: classification engineClassification label: mal56.troj.evad.winXLAM@3/9@1/1
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile created: C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData\Microsoft\Office\Heartbeat\HeartbeatCache.xmlJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile created: C:\Users\user\Desktop\~$XRealStats.xlamJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile created: C:\Users\user\AppData\Local\Temp\{7BAB0241-BA4D-4609-82BF-25A1E48C197A} - OProcSessId.datJump to behavior
    Source: XRealStats.xlamStream path 'VBA/LevenbergMarquardt' : VBA code
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile read: C:\Users\desktop.iniJump to behavior
    Source: unknownProcess created: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" "C:\Users\user\Desktop\XRealStats.xlam"
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess created: C:\Windows\splwow64.exe C:\Windows\splwow64.exe 12288
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess created: C:\Windows\splwow64.exe C:\Windows\splwow64.exe 12288Jump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEKey value queried: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\Wow6432Node\CLSID\{AC9F2F90-E877-11CE-9F68-00AA00574A4F}\InprocServer32Jump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEWindow found: window name: SysTabControl32Jump to behavior
    Source: Window RecorderWindow detected: More than 3 window changes detected
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEKey opened: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\CommonJump to behavior
    Source: XRealStats.xlamStatic file information: File size 5944538 > 1048576
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEFile opened: C:\Program Files (x86)\Microsoft Office\root\vfs\SystemX86\MSVCR100.dllJump to behavior

    Data Obfuscation

    barindex
    Source: XRealStats.xlamStream path 'VBA/Analysis' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/AnovaAnalysis' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/ChiSquare' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/Cluster' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/Correlation' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/Distribution' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/FactorAnalysis' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/Forecasting' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/GMM' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/LambdaLike' : High number of string operations
    Source: XRealStats.xlamStream path 'VBA/LogisticRegression' : High number of string operations
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: FAILCRITICALERRORS | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeProcess information set: NOALIGNMENTFAULTEXCEPT | NOOPENFILEERRORBOXJump to behavior
    Source: C:\Windows\splwow64.exeWindow / User API: threadDelayed 585Jump to behavior
    Source: C:\Windows\splwow64.exeLast function: Thread delayed
    Source: C:\Windows\splwow64.exeLast function: Thread delayed
    Source: C:\Windows\splwow64.exeThread delayed: delay time: 120000Jump to behavior
    Source: C:\Windows\splwow64.exeThread delayed: delay time: 120000Jump to behavior
    Source: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXEProcess information queried: ProcessInformationJump to behavior
    ReconnaissanceResource DevelopmentInitial AccessExecutionPersistencePrivilege EscalationDefense EvasionCredential AccessDiscoveryLateral MovementCollectionCommand and ControlExfiltrationImpact
    Gather Victim Identity Information3
    Scripting
    Valid AccountsWindows Management Instrumentation3
    Scripting
    1
    Process Injection
    2
    Masquerading
    OS Credential Dumping1
    Process Discovery
    Remote ServicesData from Local System1
    Encrypted Channel
    Exfiltration Over Other Network MediumAbuse Accessibility Features
    CredentialsDomainsDefault AccountsScheduled Task/JobBoot or Logon Initialization ScriptsBoot or Logon Initialization Scripts1
    Virtualization/Sandbox Evasion
    LSASS Memory1
    Virtualization/Sandbox Evasion
    Remote Desktop ProtocolData from Removable Media2
    Non-Application Layer Protocol
    Exfiltration Over BluetoothNetwork Denial of Service
    Email AddressesDNS ServerDomain AccountsAtLogon Script (Windows)Logon Script (Windows)1
    Process Injection
    Security Account Manager1
    Application Window Discovery
    SMB/Windows Admin SharesData from Network Shared Drive3
    Application Layer Protocol
    Automated ExfiltrationData Encrypted for Impact
    Employee NamesVirtual Private ServerLocal AccountsCronLogin HookLogin Hook1
    Obfuscated Files or Information
    NTDS1
    File and Directory Discovery
    Distributed Component Object ModelInput Capture1
    Ingress Tool Transfer
    Traffic DuplicationData Destruction
    Gather Victim Network InformationServerCloud AccountsLaunchdNetwork Logon ScriptNetwork Logon ScriptSoftware PackingLSA Secrets1
    System Information Discovery
    SSHKeyloggingFallback ChannelsScheduled TransferData Encrypted for Impact
    Hide Legend

    Legend:

    • Process
    • Signature
    • Created File
    • DNS/IP Info
    • Is Dropped
    • Is Windows Process
    • Number of created Registry Values
    • Number of created Files
    • Visual Basic
    • Delphi
    • Java
    • .Net C# or VB.NET
    • C, C++ or other language
    • Is malicious
    • Internet
    behaviorgraph top1 dnsIp2 2 Behavior Graph ID: 1649487 Sample: XRealStats.xlam Startdate: 26/03/2025 Architecture: WINDOWS Score: 56 15 star-azurefd-prod.trafficmanager.net 2->15 17 shed.dual-low.s-part-0013.t-0009.t-msedge.net 2->17 19 3 other IPs or domains 2->19 23 Document contains an embedded VBA with functions possibly related to ADO stream file operations 2->23 25 Document contains an embedded VBA with many string operations indicating source code obfuscation 2->25 27 Document contains an embedded VBA macro which may execute processes 2->27 29 Yara detected MalDoc1 2->29 7 EXCEL.EXE 234 75 2->7         started        signatures3 process4 dnsIp5 21 s-part-0013.t-0009.t-msedge.net 13.107.246.41, 443, 49730, 49731 MICROSOFT-CORP-MSN-AS-BLOCKUS United States 7->21 13 C:\Users\user\Desktop\~$XRealStats.xlam, data 7->13 dropped 11 splwow64.exe 7->11         started        file6 process7

    This section contains all screenshots as thumbnails, including those not shown in the slideshow.


    windows-stand
    SourceDetectionScannerLabelLink
    XRealStats.xlam0%ReversingLabs
    XRealStats.xlam2%VirustotalBrowse
    No Antivirus matches
    No Antivirus matches
    No Antivirus matches
    SourceDetectionScannerLabelLink
    http://datapigtechnologies.com/blog/index.php/why-excel-has-multiple-quartile-functions-and-how-to-r0%Avira URL Cloudsafe

    Download Network PCAP: filteredfull

    NameIPActiveMaliciousAntivirus DetectionReputation
    svc.ms-acdc-teams.office.com
    52.123.247.81
    truefalse
      high
      bg.microsoft.map.fastly.net
      199.232.38.172
      truefalse
        high
        s-part-0013.t-0009.t-msedge.net
        13.107.246.41
        truefalse
          high
          otelrules.svc.static.microsoft
          unknown
          unknownfalse
            high
            NameMaliciousAntivirus DetectionReputation
            https://otelrules.svc.static.microsoft/rules/excel.exe-Production-v19.bundlefalse
              high
              https://otelrules.svc.static.microsoft/rules/rule120607v1s19.xmlfalse
                high
                https://otelrules.svc.static.microsoft/rules/rule120603v8s19.xmlfalse
                  high
                  NameSourceMaliciousAntivirus DetectionReputation
                  http://datapigtechnologies.com/blog/index.php/why-excel-has-multiple-quartile-functions-and-how-to-r~DF01A6EB287365FF40.TMP.0.dr, vbaProject.binfalse
                  • Avira URL Cloud: safe
                  unknown
                  • No. of IPs < 25%
                  • 25% < No. of IPs < 50%
                  • 50% < No. of IPs < 75%
                  • 75% < No. of IPs
                  IPDomainCountryFlagASNASN NameMalicious
                  13.107.246.41
                  s-part-0013.t-0009.t-msedge.netUnited States
                  8068MICROSOFT-CORP-MSN-AS-BLOCKUSfalse
                  Joe Sandbox version:42.0.0 Malachite
                  Analysis ID:1649487
                  Start date and time:2025-03-26 20:25:00 +01:00
                  Joe Sandbox product:CloudBasic
                  Overall analysis duration:0h 5m 44s
                  Hypervisor based Inspection enabled:false
                  Report type:full
                  Cookbook file name:defaultwindowsofficecookbook.jbs
                  Analysis system description:Windows 10 x64 22H2 with Office Professional Plus 2019, Chrome 134, Firefox 118, Adobe Reader DC 23, Java 8 Update 381, 7zip 23.01
                  Number of analysed new started processes analysed:20
                  Number of new started drivers analysed:0
                  Number of existing processes analysed:0
                  Number of existing drivers analysed:0
                  Number of injected processes analysed:0
                  Technologies:
                  • HCA enabled
                  • EGA enabled
                  • AMSI enabled
                  Analysis Mode:default
                  Analysis stop reason:Timeout
                  Sample name:XRealStats.xlam
                  Detection:MAL
                  Classification:mal56.troj.evad.winXLAM@3/9@1/1
                  EGA Information:Failed
                  HCA Information:
                  • Successful, ratio: 100%
                  • Number of executed functions: 0
                  • Number of non-executed functions: 0
                  Cookbook Comments:
                  • Found application associated with file extension: .xlam
                  • Close Viewer
                  • Exclude process from analysis (whitelisted): MpCmdRun.exe, audiodg.exe, RuntimeBroker.exe, ShellExperienceHost.exe, SIHClient.exe, SgrmBroker.exe, backgroundTaskHost.exe, conhost.exe, svchost.exe
                  • Excluded IPs from analysis (whitelisted): 52.109.0.91, 52.109.16.112, 23.9.183.29, 199.232.38.172, 20.189.173.3, 52.123.247.81, 20.190.151.132, 52.149.20.212
                  • Excluded domains from analysis (whitelisted): slscr.update.microsoft.com, fs-wildcard.microsoft.com.edgekey.net, fs-wildcard.microsoft.com.edgekey.net.globalredir.akadns.net, e16604.dscf.akamaiedge.net, osiprod-ncus-buff-azsc-000.northcentralus.cloudapp.azure.com, ncus-azsc-000.roaming.officeapps.live.com, roaming.officeapps.live.com, login.live.com, wus-azsc-config.officeapps.live.com, officeclient.microsoft.com, prod.fs.microsoft.com.akadns.net, c.pki.goog, wu-b-net.trafficmanager.net, ecs.office.com, self-events-data.trafficmanager.net, fs.microsoft.com, ctldl.windowsupdate.com.delivery.microsoft.com, prod.configsvc1.live.com.akadns.net, self.events.data.microsoft.com, onedscolprdwus02.westus.cloudapp.azure.com, ctldl.windowsupdate.com, prod.roaming1.live.com.akadns.net, fe3cr.delivery.mp.microsoft.com, us1.roaming1.live.com.akadns.net, config.officeapps.live.com, us.configsvc1.live.com.akadns.net, ecs.office.trafficmanager.net, mira.config.skype.com
                  • Not all processes where analyzed, report is missing behavior information
                  • Report size getting too big, too many NtCreateKey calls found.
                  • Report size getting too big, too many NtQueryAttributesFile calls found.
                  • Report size getting too big, too many NtQueryValueKey calls found.
                  • Report size getting too big, too many NtReadVirtualMemory calls found.
                  • Report size getting too big, too many NtSetInformationFile calls found.
                  • Some HTTPS proxied raw data packets have been limited to 10 per session. Please view the PCAPs for the complete data.
                  TimeTypeDescription
                  15:27:06API Interceptor611x Sleep call for process: splwow64.exe modified
                  MatchAssociated Sample Name / URLSHA 256DetectionThreat NameLinkContext
                  13.107.246.41http://www.surveymonkey.com/tr/v1/te/PUEIZHbYTJGrZEIkVMWlCoicdktJQxDgUh5D5mhe1V5RrTmuIdynx7PnFHXRUx9slMgQjvZdyUWqhr_2Bl49oNXjy3TOleTjKMKR6WbsGcrstlT2syBMlSkW7U5aKlKcBD9NFqJqrxGyODSWJJr6_2BMbXsKkDA_2F0ep4iw23xw6huuM_3DGet hashmaliciousUnknownBrowse
                  • www.eand.com/en/index.html
                  02-11-2024 MVP.htmlGet hashmaliciousUnknownBrowse
                  • www.mvphealthcare.com/
                  02-11-2024 MVP.htmlGet hashmaliciousUnknownBrowse
                  • www.mvphealthcare.com/
                  http://y84x.mjt.lu/lnk/CAAABPdweCoAAAAAAAAAAAVG8MwAAAA6pnMAAAAAAAvpOQBlhIO4-ImJ1UImRBC5CNVIkLSaswAL-7Q/2/r-vXj7XjX0azsD7QNKNH-A/aHR0cHM6Ly9hcHBjZW50ZXIubXMvaW52aXRhdGlvbnMvb3JnL2IxNjM2ZDYzMTE0YTM0MjBkYWFmNTg4YTE5N2Y0N2MxNGY4ZDViNWMyM2ZjM2RhYTgxMWM0ODgwOWM1ZTZkNjQGet hashmaliciousUnknownBrowse
                  • appcenter.ms/
                  http://url7816.acetaxi.com/ls/click?upn=k9eqZnPBEZmPVPka3LxS61O1ksdCJOgznvtiwccqzi2-2BneqvfCXEJ-2FQj-2BZo7snmCwDunBahf2LYhfs7qQp7-2F23xLStq-2BkxJ70xqVvyXzkWM-3D8Cie_z5TGfmB4A65PPE2hDgRdrx6OZsZ3AmrJLHJ0M9ePWeHP5QDTWsAVp117uXam9dNn-2BGSxHeP-2BInRF-2Bgy2v-2FXBPODjmLss6NRV2RYsUYD7um77hgLl0ET9pPGTHF-2BQ1m6-2Fw7-2B-2B9DJOpakZj874YLC8uUep0F7rZMDlM46gmHmQqqAeCV477M0h2b07T2IcXu0hzUcKftN0UG2jhPq8qo00cQl0gvOLl-2BjChyaOdLpENao-3DGet hashmaliciousUnknownBrowse
                  • twiliosolutions.azurefd.net/
                  MatchAssociated Sample Name / URLSHA 256DetectionThreat NameLinkContext
                  bg.microsoft.map.fastly.netVerifiedAssetLinked.exeGet hashmaliciousAsyncRAT, KeyLogger, Quasar, XWormBrowse
                  • 199.232.90.172
                  SecuriteInfo.com.Trojan.DownLoader45.42287.31043.2783.exeGet hashmaliciousUnknownBrowse
                  • 199.232.90.172
                  SecuriteInfo.com.Trojan.MulDrop23.34226.30868.14577.exeGet hashmaliciousUnknownBrowse
                  • 199.232.90.172
                  SecuriteInfo.com.Trojan.DownLoader45.42287.31043.2783.exeGet hashmaliciousUnknownBrowse
                  • 199.232.90.172
                  SecuriteInfo.com.Trojan.MulDrop23.34226.30868.14577.exeGet hashmaliciousUnknownBrowse
                  • 199.232.90.172
                  4UuBoHs64W.exeGet hashmaliciousLummaC StealerBrowse
                  • 151.101.46.172
                  rsKsZCLFoW.ps1Get hashmaliciousSharpHideBrowse
                  • 151.101.46.172
                  J3LL20Dsf6.batGet hashmaliciousXWormBrowse
                  • 151.101.46.172
                  4MlZyXN7Co.exeGet hashmaliciousLummaC StealerBrowse
                  • 151.101.46.172
                  Suser Vacations and salaries.pdfGet hashmaliciousUnknownBrowse
                  • 199.232.90.172
                  svc.ms-acdc-teams.office.comphish_alert_sp2_2.0.0.0.emlGet hashmaliciousHTMLPhisherBrowse
                  • 52.123.251.29
                  Merged documents.docx.docGet hashmaliciousUnknownBrowse
                  • 52.123.247.60
                  FILLING SUMMON DOCUMENT.docxGet hashmaliciousHTMLPhisherBrowse
                  • 52.123.243.89
                  https://waimao-north-star-mail.qiye.163.com/api/j/html?c=https%3A%2F%2F1drv.ms%2Fo%2Fs!AjlMaeoI5pi7f_GXm50IY_RD-sw%3Fe%3DEsmwj4%3Fcid%3Dsite_nqmm3LQS7c9jn-2FWvVcVpMl0NsyUA8yUApYElnaeUm2Ly_xlUzBpbEuLGet hashmaliciousUnknownBrowse
                  • 52.123.251.3
                  ui.exeGet hashmaliciousXWormBrowse
                  • 52.123.247.93
                  Receipt.docmGet hashmaliciousUnknownBrowse
                  • 52.123.251.28
                  deyesfor.docGet hashmaliciousUnknownBrowse
                  • 52.123.247.79
                  2298633922.svgGet hashmaliciousHTMLPhisherBrowse
                  • 52.123.251.32
                  BGL-17-2025, Packing List ... . 2073799 07 [S-29-40].xlsGet hashmaliciousUnknownBrowse
                  • 52.123.247.58
                  doc12777920250311100101.docxGet hashmaliciousUnknownBrowse
                  • 52.123.243.212
                  s-part-0013.t-0009.t-msedge.netPricing Analysis - Ecomm and Amazon vs List.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  Pricing Analysis - Ecomm and Amazon vs List.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  python312.dllGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  https://www.flugger.pl/Get hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  https://www.flugger.plGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  https://app.powerbi.com/view?r=eyJrIjoiZmVlZTQ2MzYtNjAyNC00NmIzLTljNjYtYmI2NDA2NjgzYTBkIiwidCI6IjcxOGNiYTc5LTYzNTAtNDMyZS04YjYwLTk2MDFiM2VhNDNiYSJ9Get hashmaliciousEvilProxy, HTMLPhisherBrowse
                  • 13.107.246.41
                  hmm_dec.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  MatchAssociated Sample Name / URLSHA 256DetectionThreat NameLinkContext
                  MICROSOFT-CORP-MSN-AS-BLOCKUShttps://e23a311b.5f438d8b1fa34021ffea2c2f.workers.dev/&umid=ea64e973-4742-4a13-b7e6-f166cfb5aedf&auth=4c13a8eb8816953c02b02599c881676174c26b4b-2d2cb8f6bf763978670ab6e3d03aef460cd5c82cGet hashmaliciousHTMLPhisherBrowse
                  • 13.107.9.156
                  phish_alert_sp2_2.0.0.0.emlGet hashmaliciousHTMLPhisherBrowse
                  • 52.111.227.28
                  OdJqjzS22H.jarGet hashmaliciousCan StealerBrowse
                  • 204.79.197.203
                  OdJqjzS22H.jarGet hashmaliciousCan StealerBrowse
                  • 204.79.197.203
                  Pricing Analysis - Ecomm and Amazon vs List.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  Pricing Analysis - Ecomm and Amazon vs List.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  phish_alert_sp2_2.0.0.0-1.emlGet hashmaliciousUnknownBrowse
                  • 52.109.0.91
                  MatchAssociated Sample Name / URLSHA 256DetectionThreat NameLinkContext
                  a0e9f5d64349fb13191bc781f81f42e1PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  Pricing Analysis - Ecomm and Amazon vs List.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  PURCHASE ORDER 517-2025.xla.xlsxGet hashmaliciousUnknownBrowse
                  • 13.107.246.41
                  Loader.exeGet hashmaliciousLummaCBrowse
                  • 13.107.246.41
                  4UuBoHs64W.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  tHmLxo3S58.exeGet hashmaliciousLummaC Stealer, Stealc, VidarBrowse
                  • 13.107.246.41
                  4MlZyXN7Co.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  3DTcqOJmxa.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  hfRqL1uE9g.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  YpN8Ya9e0I.exeGet hashmaliciousLummaC StealerBrowse
                  • 13.107.246.41
                  No context
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:XML 1.0 document, Unicode text, UTF-16, little-endian text, with CRLF line terminators
                  Category:dropped
                  Size (bytes):118
                  Entropy (8bit):3.5700810731231707
                  Encrypted:false
                  SSDEEP:3:QaklTlAlXMLLmHlIlFLlmIK/5lTn84vlJlhlXlDHlA6l3l6Als:QFulcLk04/5p8GVz6QRq
                  MD5:573220372DA4ED487441611079B623CD
                  SHA1:8F9D967AC6EF34640F1F0845214FBC6994C0CB80
                  SHA-256:BE84B842025E4241BFE0C9F7B8F86A322E4396D893EF87EA1E29C74F47B6A22D
                  SHA-512:F19FA3583668C3AF92A9CEF7010BD6ECEC7285F9C8665F2E9528DBA606F105D9AF9B1DB0CF6E7F77EF2E395943DC0D5CB37149E773319078688979E4024F9DD7
                  Malicious:false
                  Reputation:high, very likely benign file
                  Preview:..<.?.x.m.l. .v.e.r.s.i.o.n.=.".1...0.". .e.n.c.o.d.i.n.g.=.".U.T.F.-.1.6.".?.>.....<.H.e.a.r.t.b.e.a.t.C.a.c.h.e./.>.
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:data
                  Category:dropped
                  Size (bytes):230700
                  Entropy (8bit):4.314185819275572
                  Encrypted:false
                  SSDEEP:1536:XEwLE6lWWZFVKKHaRRDqBcAQHdHTuETaK/E5A0j3kTkJIsDWpksZk/6tf2D8rsb8:Xjf8WZFVKKHSRDqBcA+FLM0Ar6t3s67
                  MD5:C3FCFE479C8B397DF48AA9C2792D11B2
                  SHA1:F1AF44BB120DCB82F485DED8C9EA65C4A1C6855E
                  SHA-256:44C7A8739517E434F4D7BE56A84C2F15F934E44E171A45DBFEA9D32AA6066F40
                  SHA-512:60C95715E41D60D38EEEAD93FCD887695E0C72421155FB802D106D0458A3486B06C0DFEDBE86D1B3978CD600BAB130D33E2AA0ECD3B6EC4425ADD0F839BA7606
                  Malicious:false
                  Reputation:low
                  Preview:MSFT................Q................................%......$....... ...................d.......,...........X....... ...........L...........x.......@...........l.......4...........`.......(...........T...................H...........t.......<...........h.......0...........\.......$...........P...........|.......D...........p.......8...........d.......,...........X....... ...........L...........x.......@........ ..l ... ..4!...!...!..`"..."..(#...#...#..T$...$...%...%...%..H&...&...'..t'...'..<(...(...)..h)...)..0*...*...*..\+...+..$,...,...,..P-...-......|.......D/.../...0..p0...0..81...1...2..d2...2..,3...3...3..X4...4.. 5...5...5..L6...6...7..x7...7..@8...8...9..l9...9..4:...:...:..`;...;..(<...<...<..T=...=...>...>...>..H?...?...@..t@...@..<A...A...B..hB.......B..........L_...............r..4...........LX...............F..............<G...............s...............u..lL..............T...............P...........................(.......................................................
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:data
                  Category:dropped
                  Size (bytes):15040
                  Entropy (8bit):4.609925900615036
                  Encrypted:false
                  SSDEEP:192:3d3xlc11DxzCOtHIT6P20eChgZjTdZ3HJV8L1I17EMBkDXrq9LwGGLVbkb:t33QxesT20lheZ3waE5D7qxIxkb
                  MD5:363FA6E3123AC70B01B7A5A66ACA33CC
                  SHA1:E5915FBD43D2674457FA0A2F592C8182DCB5E1AF
                  SHA-256:582851834A088CF0F0F7E459E2F26AAE815262581C6D22769CEDD9EAEE70F3C2
                  SHA-512:C2A046E342FBE2BAA5A2F328D8FFAE50737C35F6793E63EB72DE4FCE1403411C722201D56CF8A89A471B9AE166242E9B1439FA0B9D4BCF1E61386E96FE64CE15
                  Malicious:false
                  Reputation:low
                  Preview:MSFT................A...............................1............... ...................d.......P...,...............\...........H...4............... ...........|...............................|...............|...x...............................x...........................................................................................$!...............................................P..................................................$!..87......................................0....P..,.........................0.....................%!...:......................................H..."...................................................H.......(...................@...................P...............0.......`...............................p...X... ...............yG...w.M.t.]..jg.........E.............F...........B........`..d......."E.............F........0..............F..........E........`.M...........CPf.........0..=.......01..)....w....<WI.......\.1Y........k...U........".......|...K..a...
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:Composite Document File V2 Document, Can't read directory
                  Category:dropped
                  Size (bytes):15794176
                  Entropy (8bit):5.230910088438715
                  Encrypted:false
                  SSDEEP:98304:jfbXtS9ODWDuvz7AZNnvTqBBbb2ahCftXb8pZ/XM3Jvd:DROzgAReZ/XGvd
                  MD5:B3F780E412C072172013F0EA1C81CB45
                  SHA1:0DDD8FFE857E664F8AB4501236BAEDEFADED6915
                  SHA-256:8701EA4916393FD5673D977CD66045347FDE36499E520201BBCA5651968A7F5C
                  SHA-512:3D046A751838ECDCCA36DDB3129B64936E06F40C61641147BDF74EB33686185D1C36A6DA4480593A9B721E29784F771142271A9616B9D205C1CF840A4F30C40D
                  Malicious:false
                  Reputation:low
                  Preview:......................>................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... ...!..."...#...$...%...&...'...(...)...*...+...,...-......./...0...1...2...3...4...5...6...7...8...9...:...;...<...=...>...?...@...A...B...C...D...E...F...G...H...I...J...K...L...M...N...O...P...Q...R...S...T...U...V...W...X...Y...Z...[...\...]...^..._...`...a...b...........e...f...g...h...i...j...k...l...m...n...o...p...q...r...s...t...u...v...w...x...y...z...
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:data
                  Category:dropped
                  Size (bytes):512
                  Entropy (8bit):0.0
                  Encrypted:false
                  SSDEEP:3::
                  MD5:BF619EAC0CDF3F68D496EA9344137E8B
                  SHA1:5C3EB80066420002BC3DCC7CA4AB6EFAD7ED4AE5
                  SHA-256:076A27C79E5ACE2A3D47F9DD2E83E4FF6EA8872B3C2218F66C92B89B55F36560
                  SHA-512:DF40D4A774E0B453A5B87C00D6F0EF5D753143454E88EE5F7B607134598294C7905CCBCF94BBC46E474DB6EB44E56A6DBB6D9A1BE9D4FB5D1B5F2D0C6ED34BFE
                  Malicious:false
                  Reputation:high, very likely benign file
                  Preview:................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:Composite Document File V2 Document, Cannot read section info
                  Category:dropped
                  Size (bytes):49152
                  Entropy (8bit):7.001181550473484
                  Encrypted:false
                  SSDEEP:768:j/Eff2G34pvGPQECvOG5kcikQkxywldn5sgMGLI72p3jdn6GaQ4Goc0g:j/EffD34p+PQECvricJ9LPf1LIqhjpjC
                  MD5:2793AF0314B79F98FFBE418DC610F19B
                  SHA1:16120B45EEF9540653ED42E5817BD00EAA0F7A81
                  SHA-256:0C5957C7CFFA1DA9CE3F68767E497ECA2E1B79D1BB1DE1ECB2788F608AFA5323
                  SHA-512:E8F72B3EE6E167FE0104A4C6D74003CB5F4F8BF691FC8D843C5BA59D188A48CB5A9D5ACD37844F0AA99BACFFA3656EA80131D417F5C70474B9F043E0178308C5
                  Malicious:false
                  Reputation:low
                  Preview:......................>...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:data
                  Category:dropped
                  Size (bytes):512
                  Entropy (8bit):0.0
                  Encrypted:false
                  SSDEEP:3::
                  MD5:BF619EAC0CDF3F68D496EA9344137E8B
                  SHA1:5C3EB80066420002BC3DCC7CA4AB6EFAD7ED4AE5
                  SHA-256:076A27C79E5ACE2A3D47F9DD2E83E4FF6EA8872B3C2218F66C92B89B55F36560
                  SHA-512:DF40D4A774E0B453A5B87C00D6F0EF5D753143454E88EE5F7B607134598294C7905CCBCF94BBC46E474DB6EB44E56A6DBB6D9A1BE9D4FB5D1B5F2D0C6ED34BFE
                  Malicious:false
                  Reputation:high, very likely benign file
                  Preview:................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:Composite Document File V2 Document, Cannot read section info
                  Category:dropped
                  Size (bytes):16384
                  Entropy (8bit):0.3613836054883338
                  Encrypted:false
                  SSDEEP:3:YmsalTlLPltl2N81HRQjlORGt7RQ//W1XR9//3R9//3R9//:rl912N0xs+CFQXCB9Xh9Xh9X
                  MD5:679672A5004E0AF50529F33DB5469699
                  SHA1:427A4EC3281C9C4FAEB47A22FFBE7CA3E928AFB0
                  SHA-256:205D000AA762F3A96AC3AD4B25D791B5F7FC8EFB9056B78F299F671A02B9FD21
                  SHA-512:F8615C5E5CF768A94E06961C7C8BEF99BEB43E004A882A4E384F5DD56E047CA59B963A59971F78DCF4C35D1BB92D3A9BC7055BFA3A0D597635DE1A9CE06A3476
                  Malicious:false
                  Preview:......................>...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
                  Process:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  File Type:data
                  Category:dropped
                  Size (bytes):165
                  Entropy (8bit):1.4377382811115937
                  Encrypted:false
                  SSDEEP:3:KVC+cAmltV:KVC+cR
                  MD5:9C7132B2A8CABF27097749F4D8447635
                  SHA1:71D7F78718A7AFC3EAB22ED395321F6CBE2F9899
                  SHA-256:7029AE5479F0CD98D892F570A22B2AE8302747DCFF3465B2DE64D974AE815A83
                  SHA-512:333AC8A4987CC7DF5981AE81238A77D123996DB2C4C97053E8BD2048A64FDCF33E1245DEE6839358161F6B5EEA6BFD8D2358BC4A9188D786295C22F79E2D635E
                  Malicious:true
                  Preview:.user ..j.o.n.e.s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
                  File type:Microsoft Excel 2007+
                  Entropy (8bit):7.9920898627904196
                  TrID:
                  • Excel Microsoft Office Open XML Format document with Macro (52504/1) 54.97%
                  • Excel Microsoft Office Open XML Format document (35004/1) 36.65%
                  • ZIP compressed archive (8000/1) 8.38%
                  File name:XRealStats.xlam
                  File size:5'944'538 bytes
                  MD5:fcdf666109ccefa298cf4a752dba8b9d
                  SHA1:d864195be124f0ea964546ba3311a3bd25f5ef08
                  SHA256:acdf5bcd40fcba2805ade1c9fd636ca1515bed24dacf54b9fa75d4f0b0472726
                  SHA512:325e3d573f3c584ca33ae1f94c51faf10bab0f46e27f73c4752021eaa410de858e930bcfc81b4d6bf9df5d658013698440e0fe53ede36a578b1e3f8ef498fbfe
                  SSDEEP:98304:Ujv5ssx5UhL8FFz7+tr/ARR4nc1cFVr2EJEVbxnrT7Mhsdsrz2RB7so6+x6T1:5sTiL8FFz7+tqt1c/abxrPq8O2RB7nbm
                  TLSH:9F5633DDB1807C05CD06F9FD837CA6F0634153A9257ECA06E80DBB2677BB993598E1A0
                  File Content Preview:PK..........!..p..X...v.......[Content_Types].xml ...(.........................................................................................................................................................................................................
                  Icon Hash:cbe126242426202b
                  Document Type:OpenXML
                  Number of OLE Files:1
                  Has Summary Info:
                  Application Name:
                  Encrypted Document:False
                  Contains Word Document Stream:False
                  Contains Workbook/Book Stream:False
                  Contains PowerPoint Document Stream:False
                  Contains Visio Document Stream:False
                  Contains ObjectPool Stream:False
                  Flash Objects Count:0
                  Contains VBA Macros:True
                  Author:Charles Zaiontz
                  Last Saved By:Charles Zaiontz
                  Create Time:2010-11-30T10:03:37Z
                  Last Saved Time:2025-03-03T17:26:01Z
                  Creating Application:Microsoft Excel
                  Security:0
                  Thumbnail Scaling Desired:false
                  Contains Dirty Links:false
                  Shared Document:false
                  Changed Hyperlinks:false
                  Application Version:16.0300
                  General
                  Stream Path:VBA/Analysis
                  VBA File Name:Analysis
                  Stream Size:266304
                  Data ASCII:. . . . . . . . d . . . . . . . . d . . . . . F . . . . . . . . p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . 0 . . . . . . . < . . . . . 6 . . . . . . < . . . . . . . . . . . . . . . . p E . . . . @ b . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 82 64 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff c6 64 00 00 a2 08 03 00 46 00 00 00 01 00 00 00 d4 1f ac 70 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Analysis"
                  ' Functions used by data analysis tools
                  
                  Sub IsRange(ByVal sRangeAddress As String, ok As Boolean)
                    Dim TestRange As Range
                    ok = True
                    On Error Resume Next
                    Set TestRange = Range(sRangeAddress)
                    If err.Number <> 0 Then ok = False
                    err.Clear
                    On Error GoTo 0
                    Set TestRange = Nothing
                  End Sub
                  
                  Sub GetRange(rg As Range, s As String, ByRef ok As Boolean)
                      ' Get range with address s, set ok to true if this address is valid
                      ok = True
                      On Error GoTo ErrTrap
                      Set rg = ActiveSheet.Range(s)
                      Exit Sub
                  ErrTrap:
                      ok = False
                      Resume Next
                  End Sub
                  
                  Sub GetOutputRange(rg As Range, s As String, ByRef ok As Boolean)
                  ' Get output range with address s, set ok to true if this address is valid
                  ' If s = "" then set rg to a new worksheet
                      Dim ws As Worksheet
                      ok = True
                      On Error GoTo ErrTrap
                      If s = "" Then
                          Set ws = Sheets.Add
                          Set rg = ws.Range("A1")
                      Else
                          Set rg = ActiveSheet.Range(s).Cells(1, 1)
                      End If
                      Exit Sub
                  ErrTrap:
                      ok = False
                      Resume Next
                  End Sub
                  
                  Sub GetOptionalRange(rg As Range, s As String, ByRef ok As Boolean)
                      ' Get range with address s, set ok to true if this address is valid, can also be empty
                      ok = True
                      On Error GoTo ErrTrap
                      If s <> "" Then
                          Set rg = ActiveSheet.Range(s)
                      Else
                          Set rg = Nothing
                      End If
                      Exit Sub
                  ErrTrap:
                      ok = False
                      Resume Next
                  End Sub
                  
                  Sub ExtendRange(rg As Range, rg1 As Range)
                  ' For a given range rg, return range rg1 which extends the first row of rg until a row of empty cells is found
                  ' If first row of rg is empty then perform above on second row of rg
                      
                      On Error GoTo ErrTrap
                      
                      Dim n As Long
                      n = rg.Columns.Count
                      Dim ce As Range
                      Dim ce1 As Range
                      Set ce = rg.Cells(1, 1)
                      Dim j As Long
                      Dim ok As Boolean
                      Do
                          ok = True
                          Set ce = ce.Offset(1, 0)
                          While ce.Value <> ""
                              Set ce = ce.Offset(1, 0)
                          Wend
                          Set ce1 = ce.Offset(0, 1)
                          For j = 2 To n
                              If ce1.Value <> "" Then
                                  ok = False
                                  Exit For
                              End If
                              Set ce1 = ce1.Offset(0, 1)
                          Next
                      Loop Until ok
                      
                  ErrTrap:
                      Set rg1 = rg.Cells(1, 1).Resize(ce.row - rg.Cells(1, 1).row, n)
                  End Sub
                  
                  Sub ExtendRange2(rg As Range, rg1 As Range)
                  ' perform ExtendRange but skip two blank rows
                      
                      Dim rg2 As Range
                      Dim rg3 As Range
                      Dim rg4 As Range
                      Dim m As Long
                      Dim n As Long
                      
                      Call ExtendRange(rg, rg2)
                      
                      m = rg2.Rows.Count
                      n = rg2.Columns.Count
                      
                      Set rg3 = rg2.Cells(m + 3, 1).Resize(1, n)
                      Call ExtendRange(rg3, rg4)
                      
                      Set rg1 = rg2.Cells(1, 1).Resize(m + rg4.Rows.Count + 2, n)
                      
                  End Sub
                  
                  ' string routines
                  
                  Sub SetRowLabels(rvector As Variant, s As String)
                  ' set the values of the cells in row vector to the labels in string s
                  ' s is a list of labels separated by commas
                      Dim i As Long
                      Dim n As Long
                      n = UBound(rvector, 2)
                      Dim size As Long
                      size = Len(s)
                      Dim p As Long
                      Dim pp As Long
                      i = 1
                      p = 1
                      Do
                          pp = InStr(p, s, ",")
                          If pp <= 0 Then
                              rvector(1, i) = Mid$(s, p)
                              Exit Do
                          Else
                              rvector(1, i) = Mid$(s, p, pp - p)
                              i = i + 1
                              p = pp + 1
                          End If
                      Loop Until p > size Or i > n
                      
                  End Sub
                  
                  Sub SetColLabels(cvector As Variant, s As String)
                  ' set the values of the cells in column vector to the labels in string s
                  ' s is a list of labels separated by commas
                      Dim i As Long
                      Dim n As Long
                      n = UBound(cvector, 1)
                      Dim size As Long
                      size = Len(s)
                      Dim p As Long
                      Dim pp As Long
                      i = 1
                      p = 1
                      Do
                          pp = InStr(p, s, ",")
                          If pp <= 0 Then
                              cvector(i, 1) = Mid$(s, p)
                              Exit Do
                          Else
                              cvector(i, 1) = Mid$(s, p, pp - p)
                              i = i + 1
                              p = pp + 1
                          End If
                      Loop Until p > size Or i > n
                      
                  End Sub
                  
                  Sub GetAlpha(s As String, ByRef alpha As Double)
                  ' return alpha, which is s as a decimal number between 0 and .5 (or 0 and 50)
                  ' if s is not a decimal number in this range then return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      alpha = s
                      If ThisWorkbook.Sheets("Config").Range("B4") <> "" Then alpha = alpha / 100
                      If alpha > 0.5 Or alpha < 0# Then alpha = -1#
                      Exit Sub
                      
                  ErrTrap:
                      alpha = -1#
                  End Sub
                  
                  Sub GetNTests(s As String, ByRef ntests As Long)
                  ' return ntests, which is s as a non-negative integer
                  ' if s is not a non-negative integer then return -1
                  
                      On Error GoTo ErrTrap
                      
                      ntests = s
                      Exit Sub
                      
                  ErrTrap:
                      ntests = -1#
                  End Sub
                  
                  Sub GetPower(s As String, ByRef pow As Double)
                  ' return power, which is s as a decimal number between 0 and 1 (or 0 and 100)
                  ' if s is not a decimal number in this range then return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      pow = s
                      If ThisWorkbook.Sheets("Config").Range("B4") <> "" Then pow = pow / 100
                      If pow > 1# Or pow <= 0# Then pow = -1#
                      Exit Sub
                      
                  ErrTrap:
                      pow = -1#
                  End Sub
                  
                  Sub GetCutoff(s As String, ByRef cutoff As Double)
                  ' return cutoff, which is s as a decimal number between 0 and 1 (or 0 and 100)
                  ' if s is not a decimal number in this range then return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      cutoff = s
                      If ThisWorkbook.Sheets("Config").Range("B4") <> "" Then cutoff = cutoff / 100
                      If cutoff > 1# Or cutoff < 0# Then cutoff = -1#
                      Exit Sub
                      
                  ErrTrap:
                      cutoff = -1#
                  End Sub
                  
                  Sub GetNum(s As String, ByRef n As Double, ByRef ok As Boolean)
                  ' return n, which is s as a number; if legal set ok = True
                  
                      On Error GoTo ErrTrap
                      
                      n = Val(s)
                      ok = True
                      Exit Sub
                      
                  ErrTrap:
                      ok = False
                  End Sub
                  
                  Sub GetPosNum(s As String, ByRef n As Double)
                  ' return n, which is s as a positive number; otherwise return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      n = Val(s)
                      If n <= 0 Then n = -1#
                      Exit Sub
                      
                  ErrTrap:
                      n = -1#
                  End Sub
                  
                  Sub GetNNeg(s As String, ByRef n As Double)
                  ' return n, which is s as a non-negative number; otherwise return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      n = Val(s)
                      If n < 0 Then n = -1#
                      Exit Sub
                      
                  ErrTrap:
                      n = -1#
                  End Sub
                  
                  Sub GetPosInt(s As String, ByRef n As Long)
                  ' return n, which is s as a positive integer; otherwise return -1
                  
                      On Error GoTo ErrTrap
                      
                      n = Int(Val(s))
                      If n <= 0 Then n = -1
                      Exit Sub
                      
                  ErrTrap:
                      n = -1
                  End Sub
                  
                  Sub GetNNegInt(s As String, ByRef n As Long)
                  ' return n, which is s as a non-negative integer; otherwise return -1.0
                  
                      On Error GoTo ErrTrap
                      
                      n = Int(Val(s))
                      If n < 0 Then n = -1#
                      Exit Sub
                      
                  ErrTrap:
                      n = -1#
                  End Sub
                  
                  Sub GetNZeroNum(s As String, ByRef n As Double)
                  ' return True if s is a non-zero number
                      
                      n = Val(s)
                      
                  Exit Sub
                  errorHandler:
                      n = 0#
                  
                  End Sub
                  
                  ' Box Plots
                  
                  Sub RunBoxPlotFull(rg As Range, ce As Range, b As Boolean, bexc As Boolean)
                  ' draw box plot for the data in rg at location ce, b = true if rg contains headings
                  ' bexc = true if QUARTILE.EXC is to be used                        *** Remove for Excel 2007
                  ' must contain at least two data points per sample (i.e. rg.Rows.Count > 1)
                  ' caution: no title is displayed
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim m As Long       ' # of rows in rg
                      m = rg.Rows.Count
                      Dim n As Long       ' # of columns in rg
                      n = rg.Columns.Count
                      Dim rg0 As Range    ' rg if b = False and corrected rg if b = True
                      Dim rg1 As Range    ' first row of rg (if b = True)
                      Dim rg2 As Range    ' first column of rg0
                      Dim rg3 As Range    ' working table range
                      Dim rg4 As Range    ' all but last line of working table
                      Dim rg5 As Range    ' last line of working table
                      Dim ce1 As Range    ' cell on row where we are writing
                      Dim ce0 As Range    ' cell for min of all the elements in rg
                      Dim ce2 As Range    ' cell for where output to be graphed goes
                      Dim i As Long       ' index
                      Dim j As Long       ' index
                  
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                         
                     ' set rg0 based on whether b = True
                      If b Then
                          m = m - 1
                          Set rg1 = rg.Rows(1)
                          Set rg0 = rg.Cells(2, 1).Resize(m, n)
                      Else
                          Set rg0 = rg
                      End If
                      
                      ' format column headings
                      Set rg3 = ce.Offset(0, 1).Resize(1, n)
                      rg3.HorizontalAlignment = xlCenter
                      rg3.Font.Italic = True
                  
                      ' create working table column headings
                      If b Then
                          ce.Offset(0, 1).Formula = "=" & s & rg1.Cells(1, 1).Address(False, False)
                          If n > 1 Then rg3.FillRight
                      Else
                          Dim vector As Variant   ' rg's headings
                          ReDim vector(1 To 1, 1 To n)
                          For i = 1 To n
                              vector(1, i) = "Group " & CStr(i)
                          Next
                          rg3.Value = vector
                      End If
                      
                      ' determine whether a negative correction is required
                      Set ce0 = ce.Offset(15, 0)
                      ce0.Value = "Grand Min"
                      ce0.Offset(2, 0).Value = "Outliers"
                      Set rg3 = ce.Offset(8, 1).Resize(1, n)
                      ce0.Offset(0, 1).Formula = "=IF(MIN(" & rg3.Address(False, False) & ")>=0,0,MIN(" & rg3.Address(False, False) & "))"
                      ce0.Offset(0, 1).BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' create first working table
                      Set rg2 = rg0.Columns(1)
                      Set ce1 = ce.Offset(8, 0)
                      ce1.Value = "Min"
                      ce1.Offset(1, 0) = "Q1"
                      ce1.Offset(2, 0) = "Median"
                      ce1.Offset(3, 0) = "Q3"
                      ce1.Offset(4, 0) = "Max"
                      ce1.Offset(5, 0) = "Mean"
                      
                      ce1.Offset(0, 1).FormulaArray = "=MIN(IF(ISBLANK(" & s & rg2.Address(False, False) & "),"""",IF(" &         s & rg2.Address(False, False) & ">=" & ce1.Offset(1, 1).Address(False, False) &         "-" & ce.Offset(-2, 1).Address(False, True) & "*(" & ce1.Offset(3, 1).Address(False, False) & "-" &         ce1.Offset(1, 1).Address(False, False) & ")," & s & rg2.Address(False, False) & ","""")))"
                      If bexc Then
                          ce1.Offset(1, 1).Formula = "=QUARTILE.EXC(" & s & rg2.Address(False, False) & ",1)"
                      Else
                          ce1.Offset(1, 1).Formula = "=QUARTILE.INC(" & s & rg2.Address(False, False) & ",1)"
                      End If
                      ce1.Offset(2, 1).Formula = "=MEDIAN(" & s & rg2.Address(False, False) & ")"
                      If bexc Then
                          ce1.Offset(3, 1).Formula = "=QUARTILE.EXC(" & s & rg2.Address(False, False) & ",3)"
                      Else
                          ce1.Offset(3, 1).Formula = "=QUARTILE.INC(" & s & rg2.Address(False, False) & ",3)"
                      End If
                      ce1.Offset(4, 1).FormulaArray = "=MAX(IF(ISBLANK(" & s & rg2.Address(False, False) & "),"""",IF(" &         s & rg2.Address(False, False) & "<=" & ce1.Offset(3, 1).Address(False, False) &         "+" & ce.Offset(-2, 1).Address(False, True) & "*(" & ce1.Offset(3, 1).Address(False, False) & "-" &         ce1.Offset(1, 1).Address(False, False) & ")," & s & rg2.Address(False, False) & ","""")))"
                      ce1.Offset(5, 1).Formula = "=AVERAGE(" & s & rg2.Address(False, False) & ")"
                      
                      Call SetRange2(rg3, ce1.Offset(0, 1), 6, n)
                      If n > 1 Then rg3.FillRight
                      rg3.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' create second working table
                      Set ce2 = ce.Offset(1, 0)
                      ce2.Value = "Min"
                      ce2.Offset(1, 0) = "Q1-Min"
                      ce2.Offset(2, 0) = "Med-Q1"
                      ce2.Offset(3, 0) = "Q3-Med"
                      ce2.Offset(4, 0) = "Max-Q3"
                      ce2.Offset(5, 0) = "Mean"
                          
                      ce2.Offset(0, 1).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "-" & ce0.Offset(0, 1).Address(False, True)
                      ce2.Offset(1, 1).Formula = "=MAX(" & ce1.Offset(1, 1).Address(False, False) & "-" & ce1.Offset(0, 1).Address(False, False) & ",0)"
                      Set rg3 = ce2.Offset(1, 1).Resize(4, 1)
                      rg3.FillDown
                      ce2.Offset(5, 1).Formula = "=" & ce1.Offset(5, 1).Address(False, False) & "-" & ce0.Offset(0, 1).Address(False, True)
                      
                      Call SetRange2(rg3, ce2.Offset(0, 1), 6, n)
                      If n > 1 Then rg3.FillRight
                      rg3.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' create chart
                      Call SetRange2(rg4, ce, 5, n + 1)
                      Call SetRange2(rg5, ce2.Offset(4, 1), 1, n)
                      ActiveSheet.Shapes.AddChart.Select
                      
                      With ActiveChart
                      
                          .SetSourceData Source:=rg4
                          .ChartType = xlColumnStacked
                          .PlotBy = xlRows
                          .SeriesCollection(1).FILL.Visible = False
                          .SeriesCollection(2).FILL.Visible = False
                          .SeriesCollection(2).HasErrorBars = True
                          .SeriesCollection(2).ErrorBars.Select
                          .SeriesCollection(2).ErrorBar Direction:=xlY, Include:=xlMinusValues, Type:=xlPercent, Amount:=100
                          .SeriesCollection(4).HasErrorBars = True
                          .SeriesCollection(4).ErrorBars.Select
                          .SeriesCollection(4).ErrorBar Direction:=xlY, Include:=xlPlusValues, Type:=xlCustom, Amount:=rg5
                          
                          Set rg3 = ce2.Offset(5, 1).Resize(1, n)
                          With .SeriesCollection.NewSeries
                              .ChartType = xlXYScatter
                              .Name = "m"
                              .Values = rg3
                              .MarkerStyle = xlMarkerStyleX
                              .MarkerForegroundColor = rgb(0, 0, 0)
                          End With
                  
                          Dim k As Long       ' count of outliers
                          Dim jarr As Variant ' column number repeated for each outlier
                          For j = 1 To n
                              k = 0
                              For i = 1 To m
                                  If IsNumeric(rg0.Cells(i, j).Value) And rg0.Cells(i, j).Value <> "" Then
                                      If rg0.Cells(i, j).Value < ce1.Offset(0, j).Value Or rg0.Cells(i, j).Value > ce1.Offset(4, j).Value Then
                                          k = k + 1
                                          If ce0.Offset(0, 1) >= 0 Then
                                              ce0.Offset(k + 1, j).Formula = "=" & s & rg0.Cells(i, j).Address(False, False)
                                          Else
                                              ce0.Offset(k + 1, j).Formula = "=" & s & rg0.Cells(i, j).Address(False, False) & "-" & ce0.Offset(0, 1).Address(False, False)
                                          End If
                                      End If
                                  End If
                              Next
                              If k > 0 Then
                                  Set rg3 = ce0.Offset(2, j).Resize(k, 1)
                                  ReDim jarr(1 To k)
                                  For i = 1 To k
                                      jarr(i) = j
                                  Next
                                  With .SeriesCollection.NewSeries
                                      .ChartType = xlXYScatter
                                      .Name = "x"
                                      .Values = rg3
                                      .XValues = jarr
                                      .MarkerStyle = xlMarkerStyleCircle
                                      .MarkerForegroundColor = rgb(0, 0, 255)
                                      .MarkerBackgroundColor = rgb(255, 255, 255)
                                  End With
                              Else
                                  ce0.Offset(2, j).Value = "None"
                              End If
                          Next
                          
                          If ce0.Offset(0, 1).Value < 0 Then
                              With .SeriesCollection.NewSeries
                              .ChartType = xlXYScatter
                              .Name = "s"
                              .Values = 0
                              .MarkerStyle = xlMarkerStyleNone
                              .AxisGroup = xlSecondary
                              End With
                              .Axes(xlValue, xlSecondary).MinimumScale = .Axes(xlValue, xlPrimary).MinimumScale + ce0.Offset(0, 1).Value
                              .Axes(xlValue, xlSecondary).MaximumScale = .Axes(xlValue, xlPrimary).MaximumScale + ce0.Offset(0, 1).Value
                          End If
                         
                          .SetElement (msoElementLegendNone)
                          .HasTitle = True
                          .SetElement (msoElementChartTitleAboveChart)
                          .ChartTitle.Text = "Box Plot with Outliers"
                          
                      End With
                      
                      Application.ScreenUpdating = True
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                      
                  End Sub
                  
                  Sub RunDotPlot(rg As Range, ce As Range, b As Boolean)
                  ' draw a dot plot for the data in rg, b = true if rg contains headings
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim m As Long       ' # of rows in rg
                      m = rg.Rows.Count
                      Dim n As Long       ' # of columns in rg
                      n = rg.Columns.Count
                      Dim rg0 As Range    ' rg if b = False and corrected rg if b = True
                      Dim rg1 As Range    ' first row of rg (if b = True)
                      Application.ScreenUpdating = True
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                         
                     ' set rg0 based on whether b = True
                      If b Then
                          Set rg1 = rg.Rows(1)
                          m = m - 1
                          Set rg0 = rg.Cells(2, 1).Resize(m, n)
                      Else
                          Set rg0 = rg
                      End If
                      
                      Dim x As Variant    ' x values
                      ReDim x(1 To m, 1 To 1)
                      Dim i As Long
                      Dim j As Long
                      Dim zeros As Variant
                      ReDim zeros(1 To n)
                      For j = 1 To n
                          zeros(j) = 0
                      Next
                      
                      Set rg1 = rg.Cells(1, 1).Resize(2, n)
                  '    ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
                      ActiveSheet.Shapes.AddChart.Select
                      With ActiveChart
                          .SetSourceData Source:=rg1
                          .ChartType = xlColumnClustered
                          .HasLegend = False
                          .HasTitle = True
                          .ChartTitle.Text = "Dot Plot"
                          .SeriesCollection(1).Values = zeros
                          .SeriesCollection.NewSeries
                          .SeriesCollection(2).Values = "={1}"
                          .ChartArea.Select
                          .SeriesCollection(2).ChartType = xlXYScatter
                          For i = 1 To m
                              x(i, 1) = 1
                          Next
                          .SeriesCollection(2).XValues = x
                          .SeriesCollection(2).Values = rg0.Columns(1)
                          .SeriesCollection(2).MarkerStyle = xlMarkerStyleCircle
                          
                          For j = 2 To n
                              .SeriesCollection.NewSeries
                              .SeriesCollection(j + 1).ChartType = xlXYScatter
                              For i = 1 To m
                                  x(i, 1) = j
                              Next
                              .SeriesCollection(j + 1).XValues = x
                              .SeriesCollection(j + 1).Values = rg0.Columns(j)
                              .SeriesCollection(j + 1).MarkerStyle = xlMarkerStyleCircle
                          Next
                      End With
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                  
                  End Sub
                  
                  Sub RunBoxPlot(rg As Range, ce As Range, b As Boolean, bexc As Boolean)
                  ' draw box plot for the data in rg at location ce, b = true if rg contains headings
                  ' bexc = true if QUARTILE.EXC is to be used                        *** Remove for Excel 2007
                  ' must contain at least two data points per sample (i.e. rg.Rows.Count > 1)
                  ' caution: no title is displayed
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim n As Long       ' # of columns in rg
                      n = rg.Columns.Count
                      Dim rg0 As Range    ' rg if b = False and corrected rg if b = True
                      Dim rg1 As Range    ' first row of rg (if b = True)
                      Dim rg2 As Range    ' first column of rg0
                      Dim rg3 As Range    ' working table range
                      Dim rg4 As Range    ' all but last line of working table
                      Dim rg5 As Range    ' last line of working table
                      Dim ce1 As Range    ' cell on row where we are writing
                      Dim ce0 As Range    ' cell for min of all the elements in rg
                      Dim i As Long       ' index
                  
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                         
                     ' set rg0 based on whether b = True
                      If b Then
                          Set rg1 = rg.Rows(1)
                          Set rg0 = rg.Cells(2, 1).Resize(rg.Rows.Count - 1, n)
                      Else
                          Set rg0 = rg
                      End If
                      
                      ' format column headings
                      Set rg3 = ce.Offset(0, 1).Resize(1, n)
                      rg3.HorizontalAlignment = xlCenter
                      rg3.Font.Italic = True
                  
                      ' create working table column headings
                      If b Then
                          ce.Offset(0, 1).Formula = "=" & s & rg1.Cells(1, 1).Address(False, False)
                          If rg.Columns.Count > 1 Then rg3.FillRight
                      Else
                          Dim vector As Variant   ' r

                  General
                  Stream Path:VBA/Anova
                  VBA File Name:Anova
                  Stream Size:298402
                  Data ASCII:. . . . . . . . . . . . . . . . - . . . . . n . . . . . . . . y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . ( = . . . . . . + . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 ea e6 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 2d e7 00 00 dd 96 03 00 6e 00 00 00 01 00 00 00 d4 1f 79 b2 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Anova"
                  ' one factor anova excel format
                  
                  Function SSW(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute SSW.VB_Description = "returns SSW for one-way ANOVA"
                  Attribute SSW.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSW for single factor ANOVA on data in range rg; if bycol = False use rows instead of columns
                  
                      Dim arr As Variant
                      arr = array1
                      Dim tot As Double   ' total of DEVSQ for columns (rows) in array1 = SSW
                      Dim m As Long       ' number of rows in array1
                      m = UBound(arr, 1)
                      Dim n As Long       ' number of cols in array1
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      tot = 0#
                      Dim vect As Variant ' one row or column from array1
                      
                      If bycol Then
                          ReDim vect(1 To m, 1 To 1)
                          For j = 1 To n
                              For i = 1 To m
                                  If arr(i, j) <> "" Then
                                      vect(i, 1) = arr(i, j)
                                  Else
                                      vect(i, 1) = ""
                                  End If
                              Next
                              tot = tot + Application.WorksheetFunction.DevSq(vect)
                          Next
                      Else
                          ReDim vect(1 To n, 1 To 1)
                          For i = 1 To m
                              For j = 1 To n
                                  If arr(i, j) <> "" Then
                                      vect(j, 1) = arr(i, j)
                                  Else
                                      vect(j, 1) = ""
                                  End If
                              Next
                              tot = tot + Application.WorksheetFunction.DevSq(vect)
                          Next
                      End If
                      
                      SSW = tot
                      
                  End Function
                  
                  Function dfW(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute dfW.VB_Description = "returns dfW for one-way ANOVA"
                  Attribute dfW.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return dfW for single factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      Dim arr As Variant
                      arr = array1
                      If bycol Then
                          dfW = Application.WorksheetFunction.Count(array1) - UBound(arr, 2)
                      Else
                          dfW = Application.WorksheetFunction.Count(array1) - UBound(arr, 1)
                      End If
                  End Function
                  
                  Function MSW(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute MSW.VB_Description = "returns MSW for one-way ANOVA"
                  Attribute MSW.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSW for single factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      MSW = SSW(array1, bycol) / dfW(array1, bycol)
                  End Function
                  
                  Function SSBet(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute SSBet.VB_Description = "returns SSBet for one-way ANOVA"
                  Attribute SSBet.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSBet for single factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      SSBet = SSTot(array1) - SSW(array1, bycol)
                  End Function
                  
                  Function dfBet(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute dfBet.VB_Description = "returns dfBet for one-way ANOVA"
                  Attribute dfBet.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return dfBet for single factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      Dim arr As Variant
                      arr = array1
                      If bycol Then
                          dfBet = UBound(arr, 2) - 1
                      Else
                          dfBet = UBound(arr, 1) - 1
                      End If
                  End Function
                  
                  Function MSBet(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute MSBet.VB_Description = "returns MSBet for one-way ANOVA"
                  Attribute MSBet.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSBet for single factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      MSBet = SSBet(array1, bycol) / dfBet(array1, bycol)
                  End Function
                  
                  Function ANOVA1(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute ANOVA1.VB_Description = "returns F statistic for one-way ANOVA"
                  Attribute ANOVA1.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return F for one factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      ANOVA1 = MSBet(array1, bycol) / MSW(array1, bycol)
                  End Function
                  
                  Function ATEST(array1 As Variant, Optional bycol As Boolean = True) As Double
                  Attribute ATEST.VB_Description = "returns p-value for one-way ANOVA"
                  Attribute ATEST.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return p-value for one factor ANOVA on data in array1; if bycol = False use rows instead of columns
                      Dim f As Double     ' F
                      Dim df1 As Double   ' dfBet
                      Dim df2 As Double   ' dfW
                      df1 = dfBet(array1, bycol)
                      df2 = dfW(array1, bycol)
                      f = ANOVA1(array1, bycol)
                      ATEST = F_DIST_RT(f, df1, df2)
                  End Function
                  
                  ' residuals
                  
                  Function Anova1ResX(array1 As Variant) As Variant
                  Attribute Anova1ResX.VB_Description = "returns a column array with the residuals for the one-factor ANOVA"
                  Attribute Anova1ResX.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return the residuals for one-way ANOVA (in Excel format) for the data in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      Dim n As Long
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      Dim nn As Long
                      nn = m * n
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim avg As Variant
                      ReDim avg(1 To 1, 1 To n)
                      avg = MEANCOL(array1)
                      ReDim res(1 To nn) As Double
                      Dim temp As Double
                      
                      k = 0
                      For j = 1 To n
                          temp = avg(1, j)
                          For i = 1 To m
                              If IsNumeric(arr(i, j)) And arr(i, j) <> "" Then
                                  k = k + 1
                                  res(k) = arr(i, j) - temp
                              End If
                          Next
                      Next
                      
                      Dim outp As Variant
                      ReDim outp(1 To k, 1 To 1)
                      
                      For i = 1 To k
                          outp(i, 1) = res(i)
                      Next
                      
                      Anova1ResX = outp
                  
                  End Function
                  
                  Function Anova1Res(array1 As Variant) As Variant
                  Attribute Anova1Res.VB_Description = "returns a column array with the residuals for the one-factor ANOVA"
                  Attribute Anova1Res.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return the residuals for one-way ANOVA (in stacked format) for the data in an mx2 array array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      
                      ReDim arr1(1 To m, 1 To 1)    ' label column of array1
                      Dim i As Long
                      For i = 1 To m
                          arr1(i, 1) = arr(i, 1)
                      Next
                      Dim n As Long
                      n = COUNTAU(arr1)
                      
                      Dim lab As Variant
                      ReDim lab(1 To n, 1 To 1)
                      lab = ExtractsUnique(arr1)
                      ReDim avg(1 To n) As Double
                      ReDim nn(1 To n) As Double
                      ReDim indx(1 To m) As Long
                      Dim s As Variant
                      Dim j As Long
                      
                      For j = 1 To n
                          avg(j) = 0#
                          nn(j) = 0
                      Next
                      
                      For i = 1 To m
                          s = arr1(i, 1)
                          For j = 1 To n
                              If lab(j, 1) = s Then
                                  avg(j) = avg(j) + arr(i, 2)
                                  nn(j) = nn(j) + 1
                                  indx(i) = j
                                  Exit For
                              End If
                          Next
                      Next
                      
                      For j = 1 To n
                          avg(j) = avg(j) / nn(j)
                      Next
                      
                      Dim res As Variant
                      ReDim res(1 To m, 1 To 1)
                      For i = 1 To m
                          res(i, 1) = arr(i, 2) - avg(indx(i))
                      Next
                      
                      Anova1Res = res
                  
                  End Function
                  
                  Function Anova2Res(array1 As Variant) As Variant
                  Attribute Anova2Res.VB_Description = "returns a column array with the residuals for the two-factor ANOVA"
                  Attribute Anova2Res.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return the residuals for two-way ANOVA (in stacked format) for the data in an mx3 array array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      
                      ReDim arr1(1 To m, 1 To 1)    ' first label column of array1
                      ReDim arr2(1 To m, 1 To 1)    ' second label column of array1
                      Dim i As Long
                      For i = 1 To m
                          arr1(i, 1) = arr(i, 1)
                          arr2(i, 1) = arr(i, 2)
                      Next
                      Dim n1 As Long
                      n1 = COUNTAU(arr1)
                      Dim n2 As Long
                      n2 = COUNTAU(arr2)
                      
                      Dim lab1 As Variant
                      ReDim lab1(1 To n1, 1 To 1)
                      lab1 = ExtractsUnique(arr1)
                      Dim lab2 As Variant
                      ReDim lab2(1 To n2, 1 To 1)
                      lab2 = ExtractsUnique(arr2)
                      
                      ReDim avg(1 To n1, 1 To n2) As Double
                      ReDim nn(1 To n1, 1 To n2) As Double
                      ReDim indx1(1 To m) As Long
                      ReDim indx2(1 To m) As Long
                      Dim s1 As Variant
                      Dim s2 As Variant
                      Dim j1 As Long
                      Dim j2 As Long
                      
                      For j1 = 1 To n1
                          For j2 = 1 To n2
                              avg(j1, j2) = 0#
                              nn(j1, j2) = 0
                          Next
                      Next
                      
                      For i = 1 To m
                          s1 = arr1(i, 1)
                          s2 = arr2(i, 1)
                          For j1 = 1 To n1
                              If lab1(j1, 1) = s1 Then
                                  For j2 = 1 To n2
                                      If lab2(j2, 1) = s2 Then
                                          avg(j1, j2) = avg(j1, j2) + arr(i, 3)
                                          nn(j1, j2) = nn(j1, j2) + 1
                                          indx1(i) = j1
                                          indx2(i) = j2
                                          GoTo cont
                                      End If
                                  Next
                              End If
                          Next
                  cont:
                      Next
                      
                      For j1 = 1 To n1
                          For j2 = 1 To n2
                              avg(j1, j2) = avg(j1, j2) / nn(j1, j2)
                          Next
                      Next
                      
                      Dim res As Variant
                      ReDim res(1 To m, 1 To 1)
                      For i = 1 To m
                          res(i, 1) = arr(i, 3) - avg(indx1(i), indx2(i))
                      Next
                      
                      Anova2Res = res
                  
                  End Function
                  
                  Function Anova3Res(array1 As Variant) As Variant
                  Attribute Anova3Res.VB_Description = "returns a column array with the residuals for the three-factor ANOVA"
                  Attribute Anova3Res.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return the residuals for two-way ANOVA (in stacked format) for the data in an mx4 array array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      
                      ReDim arr1(1 To m, 1 To 1)    ' first label column of array1
                      ReDim arr2(1 To m, 1 To 1)    ' second label column of array1
                      ReDim arr3(1 To m, 1 To 1)    ' third label column of array1
                      Dim i As Long
                      For i = 1 To m
                          arr1(i, 1) = arr(i, 1)
                          arr2(i, 1) = arr(i, 2)
                          arr3(i, 1) = arr(i, 3)
                      Next
                      Dim n1 As Long
                      n1 = COUNTAU(arr1)
                      Dim n2 As Long
                      n2 = COUNTAU(arr2)
                      Dim n3 As Long
                      n3 = COUNTAU(arr3)
                      
                      Dim lab1 As Variant
                      ReDim lab1(1 To n1, 1 To 1)
                      lab1 = ExtractsUnique(arr1)
                      Dim lab2 As Variant
                      ReDim lab2(1 To n2, 1 To 1)
                      lab2 = ExtractsUnique(arr2)
                      Dim lab3 As Variant
                      ReDim lab3(1 To n3, 1 To 1)
                      lab3 = ExtractsUnique(arr3)
                      
                      ReDim avg(1 To n1, 1 To n2, 1 To n3) As Double
                      ReDim nn(1 To n1, 1 To n2, 1 To n3) As Double
                      ReDim indx1(1 To m) As Long
                      ReDim indx2(1 To m) As Long
                      ReDim indx3(1 To m) As Long
                      Dim s1 As Variant
                      Dim s2 As Variant
                      Dim s3 As Variant
                      Dim j1 As Long
                      Dim j2 As Long
                      Dim j3 As Long
                      
                      For j1 = 1 To n1
                          For j2 = 1 To n2
                              For j3 = 1 To n3
                                  avg(j1, j2, j3) = 0#
                                  nn(j1, j2, j3) = 0
                              Next
                          Next
                      Next
                      
                      For i = 1 To m
                          s1 = arr1(i, 1)
                          s2 = arr2(i, 1)
                          s3 = arr3(i, 1)
                          For j1 = 1 To n1
                              If lab1(j1, 1) = s1 Then
                                  For j2 = 1 To n2
                                      If lab2(j2, 1) = s2 Then
                                          For j3 = 1 To n3
                                              If lab3(j3, 1) = s3 Then
                                                  avg(j1, j2, j3) = avg(j1, j2, j3) + arr(i, 4)
                                                  nn(j1, j2, j3) = nn(j1, j2, j3) + 1
                                                  indx1(i) = j1
                                                  indx2(i) = j2
                                                  indx3(i) = j3
                                                  GoTo cont
                                              End If
                                          Next
                                      End If
                                  Next
                              End If
                          Next
                  cont:
                      Next
                      
                      For j1 = 1 To n1
                          For j2 = 1 To n2
                              For j3 = 1 To n3
                                  avg(j1, j2, j3) = avg(j1, j2, j3) / nn(j1, j2, j3)
                              Next
                          Next
                      Next
                      
                      Dim res As Variant
                      ReDim res(1 To m, 1 To 1)
                      For i = 1 To m
                          res(i, 1) = arr(i, 4) - avg(indx1(i), indx2(i), indx3(i))
                      Next
                      
                      Anova3Res = res
                  
                  End Function
                  
                  ' two factor anova (excel format)
                  
                  Function SSWF(array1 As Variant, r As Long) As Double
                  Attribute SSWF.VB_Description = "returns SSW for two-way ANOVA"
                  Attribute SSWF.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSW in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                  
                      If r = 1 Then
                          SSWF = SSTot(array1) - SSRow(array1, r) - SSCol(array1)
                          Exit Function
                      End If
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long       ' # of rows in array1
                      m = UBound(arr, 1)
                      Dim n As Long       ' # of cols in array1 (= # of col groups)
                      n = UBound(arr, 2)
                      Dim mm As Long      ' # of row groups
                      mm = m \ r
                      Dim i As Long       ' row index
                      Dim j As Long       ' col index
                      Dim k As Long       ' interaction index
                      Dim SSW As Double   ' SSW
                      Dim vect As Variant ' interaction group
                      ReDim vect(1 To r, 1 To 1)
                  
                      SSW = 0#
                      For i = 1 To mm
                          For j = 1 To n
                              For k = 1 To r
                                  If arr((i - 1) * r + k, j) <> "" Then
                                      vect(k, 1) = arr((i - 1) * r + k, j)
                                  Else
                                      vect(k, 1) = ""
                                  End If
                              Next
                              SSW = SSW + Application.WorksheetFunction.DevSq(vect)
                          Next
                      Next
                      SSWF = SSW
                      
                  End Function
                  
                  Function dfWF(array1 As Variant, r As Long) As Double
                  Attribute dfWF.VB_Description = "returns dfW for two-way ANOVA"
                  Attribute dfWF.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return dfW in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long       ' # of rows in array1
                      m = UBound(arr, 1)
                      Dim n As Long       ' # of cols in array1 (= # of col groups)
                      n = UBound(arr, 2)
                      Dim mm As Long      ' # of row groups
                      
                      If r <> 1 Then
                          mm = m \ r
                          dfWF = (m - mm) * n
                      Else
                          dfWF = (m - 1) * (n - 1)
                      End If
                      
                  End Function
                  
                  Function MSWF(array1 As Variant, r As Long) As Double
                  Attribute MSWF.VB_Description = "returns MSW for two-way ANOVA"
                  Attribute MSWF.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSW in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      MSWF = SSWF(array1, r) / dfWF(array1, r)
                  End Function
                  
                  Function SSRow(array1 As Variant, r As Long) As Double
                  Attribute SSRow.VB_Description = "returns SSRow for two-way ANOVA"
                  Attribute SSRow.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSRow in two factor ANOVA on data in range array1 w/o headings
                  ' assuming that r rows make up a group
                  
                      Dim arr As Variant  ' array1 as an array
                      arr = array1
                      Dim m As Long       ' # of rows in array1
                      m = UBound(arr, 1)
                      Dim n As Long       ' # of cols in array1 (= # of col groups)
                      n = UBound(arr, 2)
                      Dim mm As Long      ' # of row groups
                      mm = m \ r
                      Dim i As Long       ' row index
                      Dim j As Long       ' col index
                      Dim k As Long       ' group index
                      Dim s As Variant    ' sums of each Row level
                      ReDim s(1 To mm, 1 To 1)
                      Dim tot As Double   ' total for one row group
                      
                      For i = 1 To mm
                          tot = 0#
                          For j = 1 To n
                              For k = 1 To r
                                  tot = tot + arr((i - 1) * r + k, j)
                              Next
                          Next
                          s(i, 1) = tot
                      Next
                      SSRow = Application.WorksheetFunction.DevSq(s) / (r * n)
                      
                  End Function
                  
                  Function dfRow(array1 As Variant, r As Long) As Double
                  Attribute dfRow.VB_Description = "returns dfRow for two-way ANOVA"
                  Attribute dfRow.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return dfRow in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      Dim arr As Variant
                      arr = array1
                      dfRow = (UBound(arr, 1) \ r) - 1
                  End Function
                  
                  Function MSRow(array1 As Variant, r As Long) As Double
                  Attribute MSRow.VB_Description = "returns MSRow for two-way ANOVA"
                  Attribute MSRow.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSRow in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      MSRow = SSRow(array1, r) / dfRow(array1, r)
                  End Function
                  
                  Function SSCol(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute SSCol.VB_Description = "returns SSCol for two-way ANOVA"
                  Attribute SSCol.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSCol in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                  
                      Dim arr As Variant  ' array1 as an array
                      arr = array1
                      Dim m As Long       ' # of rows in array1
                      m = UBound(arr, 1)
                      Dim n As Long       ' # of cols in array1 (= # of col groups)
                      n = UBound(arr, 2)
                      Dim i As Long       ' row index
                      Dim j As Long       ' col index
                      Dim s As Variant    ' sums of each col level
                      ReDim s(1 To n, 1 To 1)
                      Dim tot As Double   ' column total
                      
                      For j = 1 To n
                          tot = 0#
                          For i = 1 To m
                              tot = tot + arr(i, j)
                          Next
                          s(j, 1) = tot
                      Next
                      SSCol = Application.WorksheetFunction.DevSq(s) / m
                      
                  End Function
                  
                  Function dfCol(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute dfCol.VB_Description = "returns dfCol for two-way ANOVA"
                  Attribute dfCol.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return dfCol in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                      Dim arr As Variant
                      arr = array1
                      dfCol = UBound(arr, 2) - 1
                  End Function
                  
                  Function MSCol(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute MSCol.VB_Description = "returns MSCol for two-way ANOVA"
                  Attribute MSCol.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSCol in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                      Dim arr As Variant
                      arr = array1
                      MSCol = SSCol(array1) / (UBound(arr, 2) - 1)
                  End Function
                  
                  Function SSTot(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute SSTot.VB_Description = "returns SSTot for one-way or two-way ANOVA"
                  Attribute SSTot.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                      SSTot = Application.WorksheetFunction.DevSq(array1)
                  End Function
                  
                  Function dfTot(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute dfTot.VB_Description = "returns dfTot for one-way or two-way ANOVA"
                  Attribute dfTot.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                      dfTot = Application.WorksheetFunction.Count(array1) - 1
                  End Function
                  
                  Function MSTot(array1 As Variant, Optional r As Long = 0) As Double
                  Attribute MSTot.VB_Description = "returns MSTot for one-way or two-way ANOVA"
                  Attribute MSTot.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group (not used)
                      MSTot = SSTot(array1) / dfTot(array1)
                  End Function
                  
                  Function SSInt(array1 As Variant, r As Long) As Double
                  Attribute SSInt.VB_Description = "returns SSInt for two-way ANOVA"
                  Attribute SSInt.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      If r = 1 Then
                          SSInt = 0
                      Else
                          SSInt = SSTot(array1) - SSRow(array1, r) - SSCol(array1) - SSWF(array1, r)
                      End If
                  End Function
                  
                  Function dfInt(array1 As Variant, r As Long) As Double
                  Attribute dfInt.VB_Description = "returns dfInt for two-way ANOVA"
                  Attribute dfInt.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return SSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      Dim arr As Variant
                      arr = array1
                      If r = 1 Then
                          dfInt = 0
                      Else
                          dfInt = ((UBound(arr, 1) \ r) - 1) * (UBound(arr, 2) - 1)
                      End If
                  End Function
                  
                  Function MSInt(array1 As Variant, r As Long) As Double
                  Attribute MSInt.VB_Description = "returns MSInt for two-way ANOVA"
                  Attribute MSInt.VB_ProcData.VB_Invoke_Func = " \n24"
                  ' return MSTot in two factor ANOVA on data in array1
                  ' assuming that r rows make up a group
                      If r = 1 Then
                    

                  General
                  Stream Path:VBA/AnovaAnalysis
                  VBA File Name:AnovaAnalysis
                  Stream Size:824477
                  Data ASCII:. . . . . . . . . . . . . . . . . . u . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . < . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . ` . . . . @ . X . . . . .
                  Data Raw:01 16 03 00 01 f0 00 00 00 a2 ec 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff aa ec 00 00 c6 75 09 00 00 00 00 00 01 00 00 00 d4 1f ed a8 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "AnovaAnalysis"
                  ' Anova: One Factor
                  
                  Sub RunAnova1Plus(rg As Range, ce As Range, head As Boolean, alpha As Double, anov As Boolean, lev As Boolean, krus As Boolean,     nem As Boolean, dunn As Boolean, dun As Boolean, welch As Boolean, brown As Boolean, cont As Boolean, tuk As Boolean,     game As Boolean, schef As Boolean, ran As Boolean, dunkw As Boolean, sch As Boolean, conkw As Boolean, pairwise As Boolean,     mw As Boolean, mw1 As Boolean, cono As Boolean, sidak As Boolean, ntests As Long, regw As Boolean, hsumax As Boolean,     hsumin As Boolean)
                  ' display Anova test and/or various follow-up tests for the data in rg starting at location ce, b = true if rg contains headings
                  
                      On Error GoTo errorHandler
                      
                      If alpha = 0 Then alpha = 0.05
                      
                      Dim ce1 As Range    ' current first cell for displaying
                      Dim n As Long       ' # of columns in rg
                      n = rg.Columns.Count
                      Dim off As Long     ' offset
                      off = 0
                  
                      ' anova
                      If anov Then
                          Call RunAnova1(rg, ce, head, alpha, ran)
                          off = off + 10
                      End If
                      
                      ' kruskal-wallis
                      If krus Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunKruskal(rg, ce1, head, alpha)
                          off = off + n + 3
                      End If
                      
                      ' welch's
                      If welch Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunWelch(rg, ce1, head, alpha)
                          off = off + 3
                      End If
                  
                      ' brown-forsythe
                      If brown Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunBrown(rg, ce1, head, alpha)
                          off = off + 3
                      End If
                      
                      ' levene's test
                      If lev Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunLevene(rg, ce1, head)
                          off = off + 3
                      End If
                      
                      ' contrasts
                      If cont Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunContrast(rg, ce1, head, alpha, sidak, ntests)
                          off = off + 11
                      End If
                      
                      ' tukey hsd
                      If tuk Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunTukey(rg, ce1, head, alpha)
                          off = off + 11
                      End If
                      
                      ' regwq
                      If regw Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunREGWQ(rg, ce1, True, alpha)
                          off = off + 11
                      End If
                      
                      ' dunnett's
                      If dun Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunDunnett(rg, ce1, head, alpha)
                          off = off + 10
                      End If
                      
                      ' games howell
                      If game Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunGames(rg, ce1, head, alpha)
                          off = off + 12
                      End If
                      
                      ' scheffe
                      If schef Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunScheffe(rg, ce1, head, alpha)
                          off = off + 10
                      End If
                      
                      ' hsu mcb tests
                      If hsumax Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunHsu(rg, ce1, head, alpha, True)
                          off = off + 7
                      ElseIf hsumin Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunHsu(rg, ce1, head, alpha, False)
                          off = off + 7
                      End If
                      
                      ' pairwise t tests
                      If pairwise Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunPairwiseT(rg, ce1)
                          off = off + 5
                      End If
                              
                      ' nemenyi
                      If nem Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunNemenyi(rg, ce1, head, alpha)
                          off = off + 8
                      End If
                              
                      ' dunn's test
                      If dunn Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunDunn(rg, ce1, head, alpha)
                          off = off + 8
                      End If
                      
                      ' schaich-hamerle test
                      If sch Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunSchaich(rg, ce1, head, alpha)
                          off = off + 8
                      End If
                      
                      ' conover test
                      If cono Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunConover(rg, ce1, head, alpha)
                          off = off + 8
                      End If
                             
                      ' contrasts kw
                      If conkw Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunContrastKW(rg, ce1, head, alpha, sidak, ntests)
                          off = off + 7
                      End If
                              
                      ' dunnett's kw (steel's test)
                      If dunkw Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunDunnettKW(rg, ce1, head, alpha)
                          off = off + 7
                      End If
                      
                      ' pairwise MW tests
                      If mw Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunPairwiseMW(rg, ce1)
                          off = off + 6
                      End If
                      
                      ' pairwise MW exact tests
                      If mw1 Then
                          Set ce1 = ce.Offset(0, off)
                          Call RunPairwiseMWExact(rg, ce1)
                          off = off + 6
                      End If
                             
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  Sub RunAnova1(rg As Range, ce As Range, b As Boolean, alpha As Double, ran As Boolean)
                  ' create description and Anova tables starting at location cl based on data from input rg
                  ' alpha is generally .05; if b is true then rg includes column heading; if ran = True then add random factor tables
                      
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim i As Long       ' loop index
                      Dim n As Long       ' number of columns (groups) in rg
                      n = rg.Columns.Count
                      Dim rg0 As Range    ' rg if b = False and corrected rg if b = True
                      Dim rg1 As Range    ' columns of rg0
                      Dim rg2 As Range    ' first row of rg (if b = True)
                      Dim rg3 As Range    ' used for formating
                      Dim rg4 As Range    ' group means
                      Dim ce1 As Range    ' cell on row where we are writing
                      Dim ce2 As Range    ' cell of first data row in description table
                      Dim buffer As Variant   ' buffer for labels
                  
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                      
                      ' set rg0 based on whether b = True
                      If b Then
                          Set rg2 = rg.Rows(1)
                          Call SetRange1(rg0, rg.row + 1, rg.Column, rg.Rows.Count - 1, rg.Columns.Count)
                      Else
                          Set rg0 = rg
                      End If
                      
                      ' overall heading
                      Set ce1 = ce
                      ce1.Value = "ANOVA: Single Factor"
                      Set ce1 = ce1.Offset(2, 0)
                      
                      ' headings for summary table
                      ce1.Value = "DESCRIPTION"
                      ce1.Offset(0, 5).Value = "Alpha"
                      ce1.Offset(0, 6).Value = alpha
                      Set ce1 = ce1.Offset(1, 0)
                      Call SetRowRange(rg3, ce1, 9)
                      
                      rg3.Borders(xlEdgeTop).LineStyle = xlDouble
                      rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      rg3.HorizontalAlignment = xlCenter
                      rg3.Font.Italic = True
                      buffer = rg3.Value
                      Call SetRowLabels(buffer, "Group,Count,Sum,Mean,Variance,SS,Std Err,Lower,Upper")
                      rg3.Value = buffer
                      
                     ' summary table
                      Set ce2 = ce1.Offset(1, 0)
                      Call SetRange2(rg4, ce2.Offset(0, 3), n, 1)
                      For i = 1 To n
                          Set ce1 = ce1.Offset(1, 0)
                          If b Then
                              ce1.Formula = "=" & s & rg2.Cells(1, i).Address(False, False)
                          Else
                              ce1.Value = "Group " & CStr(i)
                          End If
                          Set rg1 = rg0.Columns(i)
                          ce1.Offset(0, 1).Formula = "=COUNT(" & s & rg1.Address(False, False) & ")"
                          ce1.Offset(0, 2).Formula = "=SUM(" & s & rg1.Address(False, False) & ")"
                          ce1.Offset(0, 3).Formula = "=AVERAGE(" & s & rg1.Address(False, False) & ")"
                          ce1.Offset(0, 4).Formula = "=VAR.S(" & s & rg1.Address(False, False) & ")"
                          ce1.Offset(0, 5).Formula = "=DEVSQ(" & s & rg1.Address(False, False) & ")"
                          ce1.Offset(0, 6).Formula = "=SQRT(" & ce2.Offset(4 + n, 3).Address(False, False) & "/" &             ce1.Offset(0, 1).Address(False, False) & ")"
                          ce1.Offset(0, 7).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "-" &             ce1.Offset(0, 6).Address(False, False) & "*T.INV.2T(" & ce.Offset(2, 6).Address(False, False) &             "," & ce2.Offset(4 + n, 2).Address(False, False) & ")"
                          ce1.Offset(0, 8).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "+" &             ce1.Offset(0, 6).Address(False, False) & "*T.INV.2T(" & ce.Offset(2, 6).Address(False, False) &             "," & ce2.Offset(4 + n, 2).Address(False, False) & ")"
                      Next
                      Set ce1 = ce1.Offset(1, 0)
                      Call SetRowRange(rg3, ce1, 9)
                      rg3.Borders(xlEdgeTop).LineStyle = xlContinuous
                  
                      ' headings for ANOVA table
                      Set ce1 = ce1.Offset(1, 0)
                      Call AnovaHeading1(ce1, "ANOVA", 0#)
                      
                      ' between groups
                      Set ce1 = ce1.Offset(2, 0)
                      ce1.Value = "Between Groups"
                      ce1.Offset(0, 1).Formula = "=" & ce1.Offset(2, 1).Address(False, False) & "-" & ce1.Offset(1, 1).Address(False, False)
                      ce1.Offset(0, 2).Formula = "=COUNTA(" & Range(ce2, ce2.Offset(n - 1, 0)).Address(False, False) & ")-1"
                      ce1.Offset(0, 3).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(0, 2).Address(False, False)
                      ce1.Offset(0, 4).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "/" & ce1.Offset(1, 3).Address(False, False)
                      ce1.Offset(0, 5).Formula = "=F.DIST.RT(" & ce1.Offset(0, 4).Address(False, False) & "," &         ce1.Offset(0, 2).Address(False, False) & "," & ce1.Offset(1, 2).Address(False, False) & ")"
                      ce1.Offset(0, 6).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(2, 1).Address(False, False)
                      ce1.Offset(0, 7).Formula = "=SQRT(DEVSQ(" & rg4.Address(False, False) & ")/(" & ce1.Offset(1, 3).Address(False, False) &         "*" & ce1.Offset(0, 2).Address(False, False) & "))"
                      ce1.Offset(0, 8).Formula = "=(" & ce1.Offset(2, 1).Address(False, False) & "-" & ce1.Offset(2, 2).Address(False, False) &         "*" & ce1.Offset(1, 3).Address(False, False) & ")/(" & ce1.Offset(2, 1).Address(False, False) &         "+" & ce1.Offset(1, 3).Address(False, False) & ")"
                  
                      ' within groups
                      Set ce1 = ce1.Offset(1, 0)
                      ce1.Value = "Within Groups"
                      ce1.Offset(0, 1).Formula = "=SUM(" & Range(ce2.Offset(0, 5), ce2.Offset(n - 1, 5)).Address(False, False) & ")"
                      ce1.Offset(0, 2).Formula = "=" & ce1.Offset(1, 2).Address(False, False) & "-" & ce1.Offset(-1, 2).Address(False, False)
                      ce1.Offset(0, 3).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(0, 2).Address(False, False)
                      
                      ' total
                      Set ce1 = ce1.Offset(1, 0)
                      ce1.Value = "Total"
                      ce1.Offset(0, 1).Formula = "=DEVSQ(" & s & rg0.Address(False, False) & ")"
                      ce1.Offset(0, 2).Formula = "=COUNT(" & s & rg0.Address(False, False) & ")-1"
                      ce1.Offset(0, 3).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(0, 2).Address(False, False)
                      
                      Call SetRowRange(rg3, ce1, 9)
                      rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      
                      ' random factor tables
                      
                      Dim ce3 As Range    ' location of start of random factor tables
                      If ran Then
                      
                          Set ce3 = ce1.Offset(2, 0)
                          ce3.Value = "RANDOM FACTOR"
                  
                          ' random factor table 1
                                  
                          Set ce3 = ce3.Offset(1, 0)
                          Call SetRowRange(rg3, ce3, 7)
                          rg3.Borders(xlEdgeTop).LineStyle = xlDouble
                          rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                          rg3.HorizontalAlignment = xlCenter
                          rg3.Font.Italic = True
                          buffer = rg3.Value
                          Call SetRowLabels(buffer, "Variance,Estimate,df,chi crit -,chi crit +,Lower,Upper")
                          rg3.Value = buffer
                          
                          Set ce3 = ce3.Offset(1, 0)
                          ce3.Value = "Group"
                          ce3.Offset(0, 1).Formula = "=(" & ce1.Offset(-2, 3).Address(False, False) & "-" & ce1.Offset(-1, 3).Address(False, False) & ")/" &             ce2.Offset(0, 1).Address(False, False)
                          ce3.Offset(0, 2).Formula = "=(" & ce3.Offset(0, 1).Address(False, False) & "*" & ce2.Offset(0, 1).Address(False, False) & ")^2/(" &             ce1.Offset(-2, 3).Address(False, False) & "^2/" & ce1.Offset(-2, 2).Address(False, False) & "-" &             ce1.Offset(-1, 3).Address(False, False) & "^2/" & ce1.Offset(-1, 2).Address(False, False) & ")"
                          ce3.Offset(0, 3).Formula = "=CHISQ_INV(" & ce2.Offset(-2, 6).Address(False, False) & "/2," & ce3.Offset(0, 2).Address(False, False) & ")"
                          ce3.Offset(0, 4).Formula = "=CHISQ_INV(1-" & ce2.Offset(-2, 6).Address(False, False) & "/2," & ce3.Offset(0, 2).Address(False, False) & ")"
                          ce3.Offset(0, 5).Formula = "=" & ce3.Offset(0, 1).Address(False, False) & "*" & ce3.Offset(0, 2).Address(False, False) & "/" &             ce3.Offset(0, 4).Address(False, False)
                          ce3.Offset(0, 6).Formula = "=" & ce3.Offset(0, 1).Address(False, False) & "*" & ce3.Offset(0, 2).Address(False, False) & "/" &             ce3.Offset(0, 3).Address(False, False)
                          
                          ce3.Offset(1, 0).Value = "Error"
                          ce3.Offset(1, 1).Formula = "=" & ce1.Offset(-1, 3).Address(False, False)
                          ce3.Offset(1, 2).Formula = "=" & ce1.Offset(-1, 2).Address(False, False)
                          ce3.Offset(1, 3).Formula = "=CHISQ_INV(" & ce2.Offset(-2, 6).Address(False, False) & "/2," & ce3.Offset(1, 2).Address(False, False) & ")"
                          ce3.Offset(1, 4).Formula = "=CHISQ_INV(1-" & ce2.Offset(-2, 6).Address(False, False) & "/2," & ce3.Offset(1, 2).Address(False, False) & ")"
                          ce3.Offset(1, 5).Formula = "=" & ce3.Offset(1, 1).Address(False, False) & "*" & ce3.Offset(1, 2).Address(False, False) & "/" &             ce3.Offset(1, 4).Address(False, False)
                          ce3.Offset(1, 6).Formula = "=" & ce3.Offset(1, 1).Address(False, False) & "*" & ce3.Offset(1, 2).Address(False, False) & "/" &             ce3.Offset(1, 3).Address(False, False)
                              
                          Call SetRowRange(rg3, ce3.Offset(1, 0), 7)
                          rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                  
                          ' random factor table 2
                                  
                          Set ce3 = ce3.Offset(3, 0)
                          Call SetRowRange(rg3, ce3, 6)
                          rg3.Borders(xlEdgeTop).LineStyle = xlDouble
                          rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                          rg3.HorizontalAlignment = xlCenter
                          rg3.Font.Italic = True
                          buffer = rg3.Value
                          Call SetRowLabels(buffer, ",Estimate,Variance,t-crit,Lower,Upper")
                          rg3.Value = buffer
                  
                          Set ce3 = ce3.Offset(1, 0)
                          ce3.Value = "Mean"
                          ce3.Offset(0, 1).Formula = "=AVERAGE(" & s & rg0.Address(False, False) & ")"
                          Set rg3 = ce2.Offset(0, 1).Resize(n, 1)
                          ce3.Offset(0, 2).Formula = "=" & ce3.Offset(-10, 3).Address(False, False) & "/SUM(" & rg3.Address(False, False) & ")"
                          ce3.Offset(0, 3).Formula = "=T.INV.2T(" & ce2.Offset(-2, 6).Address(False, False) & "," & ce1.Offset(-2, 2).Address(False, False) & ")"
                          ce3.Offset(0, 4).Formula = "=" & ce3.Offset(0, 1).Address(False, False) & "-SQRT(" & ce3.Offset(0, 2).Address(False, False) & ")*" &             ce3.Offset(0, 3).Address(False, False)
                          ce3.Offset(0, 5).Formula = "=" & ce3.Offset(0, 1).Address(False, False) & "+SQRT(" & ce3.Offset(0, 2).Address(False, False) & ")*" &             ce3.Offset(0, 3).Address(False, False)
                          
                          Call SetRowRange(rg3, ce3, 6)
                          rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                  
                      End If
                      
                      Application.ScreenUpdating = True
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                  
                  End Sub
                  
                  Sub RunAnova1s(rgg As Range, rgs As Range, ce As Range, alpha As Double, Optional id As String = "")
                  ' create description and Anova tables starting at location ce based on data from group input rgg and score input rgs
                  ' alpha is generally .05, id is a label (e.g. the name of an independent variable in MANOVA post hoc analysis)
                      
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim i As Long       ' loop index
                      Dim n As Long       ' number of groups in rgg
                      n = COUNTAU(rgg)
                      Dim rg3 As Range    ' used for formating
                      Dim ce1 As Range    ' cell on row where we are writing
                      Dim buffer As Variant   ' buffer for labels
                  
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rgg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rgg.Worksheet.Name & "'!"
                          
                      ' overall heading
                      Set ce1 = ce
                      If id = "" Then
                          ce1.Value = "ANOVA: Single Factor"
                      Else
                          ce1.Value = "ANOVA: Single Factor - " & id
                      End If
                      Set ce1 = ce1.Offset(2, 0)
                      
                      ' headings for summary table
                      ce1.Value = "DESCRIPTION"
                      ce1.Offset(0, 5).Value = "Alpha"
                      ce1.Offset(0, 6).NumberFormat = "General"
                      ce1.Offset(0, 6).Value = alpha
                      Set ce1 = ce1.Offset(1, 0)
                      Call SetRowRange(rg3, ce1, 9)
                      
                      rg3.Borders(xlEdgeTop).LineStyle = xlDouble
                      rg3.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      rg3.HorizontalAlignment = xlCenter
                      rg3.Font.Italic = True
                      buffer = rg3.Value
                      Call SetRowLabels(buffer, "Groups,Count,Sum,Mean,Variance,SS,Std Err,Lower,Upper")
                      rg3.Value = buffer
                      
                     ' summary table
                      Set ce1 = ce1.Offset(1, 0)
                      Dim rg1 As Range    ' group labels
                      Set rg1 = ce1.Cells(1, 1).Resize(n, 1)
                      rg1.FormulaArray = "=SortUnique(" & s & rgg.Address(False, False) & ")"
                      Dim rg4 As Range    ' means
                      Set rg4 = ce1.Offset(0, 3).Resize(n, 1)
                      Dim rg2 As Range    ' SS's
                      Set rg2 = ce1.Offset(0, 5).Resize(n, 1)
                      
                      ce1.Offset(0, 1).Formula = "=COUNTIF(" & s & rgg.Address(True, True) & "," & ce1.Address(False, True) & ")"
                      ce1.Offset(0, 2).Formula = "=SUMIF(" & s & rgg.Address(True, True) & "," & ce1.Address(False, True) & "," & s & rgs.Address(True, True) & ")"
                      ce1.Offset(0, 3).Formula = "=AVERAGEIF(" & s & rgg.Address(True, True) & "," & ce1.Address(False, True) & "," & s & rgs.Address(True, True) & ")"
                      ce1.Offset(0, 4).FormulaArray = "=VAR.S(IF(" & s & rgg.Address(True, True) & "=" & ce1.Address(False, True) & "," & s & rgs.Address(True, True) & "))"
                      ce1.Offset(0, 5).Formula = "=(" & ce1.Offset(0, 1).Address(False, True) & "-1)*" & ce1.Offset(0, 4).Address(False, False)
                      ce1.Offset(0, 6).Formula = "=SQRT(" & ce1.Offset(4 + n, 3).Address(True, False) & "/" &         ce1.Offset(0, 1).Address(False, False) & ")"
                      ce1.Offset(0, 7).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "-" &         ce1.Offset(0, 6).Address(False, False) & "*T.INV.2T(" & ce.Offset(2, 6).Address(True, False) &         "," & ce1.Offset(4 + n, 2).Address(True, False) & ")"
                      ce1.Offset(0, 8).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "+" &         ce1.Offset(0, 6).Address(False, False) & "*T.INV.2T(" & ce.Offset(2, 6).Address(True, False) &         "," & ce1.Offset(4 + n, 2).Address(True, False) & ")"
                  
                      If n > 1 Then
                          Set rg3 = ce1.Offset(0, 1).Resize(n, 8)
                          rg3.FillDown
                      End If
                      Set ce1 = ce1.Offset(n, 0)
                      Call SetRowRange(rg3, ce1, 9)
                      rg3.Borders(xlEdgeTop).LineStyle = xlContinuous
                  
                      ' headings for ANOVA table
                      Set ce1 = ce1.Offset(1, 0)
                      Call AnovaHeading1(ce1, "ANOVA", 0#)
                      
                      ' between groups
                      Set ce1 = ce1.Offset(2, 0)
                      ce1.Value = "Between Groups"
                      ce1.Offset(0, 1).Formula = "=" & ce1.Offset(2, 1).Address(False, False) & "-" & ce1.Offset(1, 1).Address(False, False)
                      ce1.Offset(0, 2).Formula = "=COUNTAU(" & s & rgg.Address(False, False) & ")-1"
                      ce1.Offset(0, 3).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(0, 2).Address(False, False)
                      ce1.Offset(0, 4).Formula = "=" & ce1.Offset(0, 3).Address(False, False) & "/" & ce1.Offset(1, 3).Address(False, False)
                      ce1.Offset(0, 5).Formula = "=F.DIST.RT(" & ce1.Offset(0, 4).Address(False, False) & "," &         ce1.Offset(0, 2).Address(False, False) & "," & ce1.Offset(1, 2).Address(False, False) & ")"
                      ce1.Offset(0, 6).Formula = "=" & ce1.Offset(0, 1).Address(False, False) & "/" & ce1.Offset(2, 1).Address(False, False)
                      ce1.Offset(0, 7).Formula = "=SQRT(DEVSQ(" & rg4.Address(False, False) & ")/(" & ce1.Offset(1, 3).Address(False, False) &         "*" & ce1.Offset(0, 2).Address(False, False) & "))"
                      ce1.Offset(0, 8).Formula = "=(" & ce1.Offset(2, 1).Address(False, False) & "-" & ce1.Offset(2, 2).Address(False, False) &         "*" & ce1.Offset(1, 3).Address(False, False) & ")/(" & ce1.Offset(2, 1).Address(False, False) &         "+" & ce1.Offset(1, 3).Address(False, False) & ")"
                  
                      ' within groups
                      Set ce1 = ce1.Offset(1, 0)
                      ce1.Value 

                  General
                  Stream Path:VBA/Arima
                  VBA File Name:Arima
                  Stream Size:46398
                  Data ASCII:. . . . . . . . b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . . < & ( . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 62 1c 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 91 1c 00 00 c5 8b 00 00 07 00 00 00 01 00 00 00 d4 1f f9 82 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 18 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Arima"
                  Option Explicit
                  
                  '###############################################################################
                  '#######################         Arma estimation                ################
                  '###############################################################################
                  
                  '''''''''''''''''''''''''''''         usage          '''''''''''''''''''''''''''
                  '
                  'Function ARMA_Coeff():
                  '   This is the main function, it gives estimated coefficients with corresponding
                  '   p values as an array output. The coefficients are estimated by minimizing
                  '   conditional sum of squares.
                  
                  '       Parameters:
                  '           tarray - time series array or range for which we want to estimate the coefficients
                  '           p - AR order
                  '           q - MA order
                  '           initial_values - an array or range of (AR_lag+MA_lag+1) values
                  '              starting from constant followed by AR_lags initial values for AR
                  '              terms and MA_lags initial values for MA terms, where AR_lags and
                  '              MA_lags are integers denoting number of lagged terms of AR and
                  '              MA components. If omited, all take values 0.2!!!
                  '              if value is preceded by a letter, then value is a fixed constant
                  '              can also take the value True (or non-0) = constant (default) or False (or 0) = no constant
                  
                  'Function arma_fitted:
                  '   Private function that calculates FITTED values of range TimeSeriesRange for given
                  '   coefficients. This is the functions that enters as an input in function
                  '   calibrateParameters from Levenberg class in ARMA_Coeff function
                  '
                  '       Parameters:
                  '           params - which are actually initial values from ARMA_Coeff function
                  '           TimeSeries - array or range passed down from ARMA_Coeff function
                  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
                  '''''''''''''''''''''    supporting functions       ''''''''''''''''''''''''''''
                  'Hessian:
                  '   Private function that calculates finite differences hessian for
                  '   a given sum of squares function.
                  
                  '       Parameters:
                  '           FunctName - name of the function that we want to calculate the
                  '             hessian
                  '           Parameters - parameters that enter the function, that is independent
                  '             variables of function FunctName
                  '           TimeSeries_independent - time series of T length,
                  '             in the global context this is TimeSeriesRange without first AR_lag points
                  '           TimeSeries_dependent - time series of T-AR_lag length
                  '             in the global context this is TimeSeriesRange without first AR_lag points
                  '           deltaX is increment dx, the precission of derivatives depends
                  '             on this value.
                  '           *Note: Except for deltaX all parameters are here just to be passed
                  '             down to SS function
                  
                  'SS - returns sum of squares for a given function with dependent, independent variables by summing residuals
                  
                  'On the module level 4 variables have been declared in order to be
                  'shared between ARMA_Coeff and arma_fitted since otherwise
                  'Levenberg.calibrateParameters would treat them as an optimization variable
                  
                  '######################################################################################
                  '###############################         code      ####################################
                  '######################################################################################
                  
                  Dim AR_Lag                       As Integer
                  Dim MA_Lag                       As Integer
                  Dim Fixed_Parameters()           As Variant
                  Dim missing_fixed_parameters     As Boolean            'checks if fixed values for parameters are provided
                  
                  Function ARIMA_Coeff(tarray As Variant, p As Long, q As Long, Optional d As Long = 0,     Optional init_values As Variant, Optional lab As Boolean = False) As Variant
                  Attribute ARIMA_Coeff.VB_Description = "returns a column with the coefficient, standard error, t-statistic and p-value for each model coefficient"
                  Attribute ARIMA_Coeff.VB_ProcData.VB_Invoke_Func = " \n27"
                  
                      Dim params()                   As Double           'parameters for optimization-initial values
                      ReDim params(1 To (p + q + 1))
                      Dim i, j, jj, ii, non_fixed As Long                'non_fixed = # of non-fixed parameters
                      Dim independent_variables()    As Double           'whole time series, used in arma_fitted for lagged terms (rhs of ARMA equation)
                      Dim dependent_variables()      As Double           'level time series without first AR_lag point, lhs of ARMA equation
                      Dim res()                      As Double           'optimized parameters
                      Dim Residuals                  As Variant
                      Dim SumOfSquares               As Double
                      Dim variance                   As Double
                      Dim Hessian                    As Variant
                      Dim InverseHessian             As Variant
                      Dim Coefs_Errors()             As Variant
                      Dim CoefErrorMatrix()          As Double
                  '    Dim LogLik                     As Double
                  '    Dim AIC                        As Double
                  '    Dim BIC                        As Double
                  '    Dim AIC_aug                    As Double
                  '    Dim BIC_aug                    As Double
                  '    Dim p_values()                 As Variant
                  '    Dim statistics()               As Variant
                      Dim size                       As Long
                      Dim final_result()             As Variant
                      Dim n                          As Long             'length of init_values
                      Dim iarr                       As Variant          'init_values as an array
                      Dim di                         As Long             'dimension of init_values
                      Dim tarr                       As Variant          'tarray (time series) as array differenced d times
                      tarr = tarray
                      Dim t                          As Long             'time series length
                      t = UBound(tarr, 1) - d
                      If d > 0 Then
                          ReDim tarr(1 To t, 1 To 1)
                          tarr = ADIFF(tarray, d)
                      End If
                      
                      '-------------------------------------------------------------------------------------|
                      '--------------------------   checking input data           --------------------------|
                      '-------------------------------------------------------------------------------------|
                      
                      'check init_values
                      ReDim Fixed_Parameters(1 To p + q + 1)
                      For i = 1 To p + q + 1
                          params(i) = 0.2
                          Fixed_Parameters(i) = ""
                      Next
                      missing_fixed_parameters = True
                      
                      On Error GoTo keepOn
                      If Not IsMissing(init_values) Then
                          If init_values = False Then
                              Fixed_Parameters(1) = 0
                              params(1) = 0
                              missing_fixed_parameters = False
                          ElseIf init_values = True Then
                          Else
                  keepOn:
                              On Error GoTo 0
                              iarr = init_values
                              di = fDim(iarr)
                              If di = 1 Then
                                  n = UBound(iarr)
                                  If n > p + q + 1 Then n = p + q + 1
                                  For i = 1 To n
                                      If IsNumeric(iarr(i)) Then
                                          params(i) = iarr(i)
                                      Else
                                          params(i) = Mid(iarr(i), 2)
                                          Fixed_Parameters(i) = params(i)
                                          missing_fixed_parameters = False
                                      End If
                                  Next
                              ElseIf di = -1 Then
                                  n = UBound(iarr, 1)
                                  If n > 1 Then
                                      If n > p + q + 1 Then n = p + q + 1
                                      For i = 1 To n
                                          If IsNumeric(iarr(i, 1)) Then
                                              params(i) = iarr(i, 1)
                                          Else
                                              params(i) = Mid(iarr(i, 1), 2)
                                              Fixed_Parameters(i) = params(i)
                                              missing_fixed_parameters = False
                                          End If
                                      Next
                                  Else
                                      n = UBound(iarr, 2)
                                      If n > p + q + 1 Then n = p + q + 1
                                      For i = 1 To n
                                          If IsNumeric(iarr(1, i)) Then
                                              params(i) = iarr(1, i)
                                          Else
                                              params(i) = Mid(iarr(1, i), 2)
                                              Fixed_Parameters(i) = params(i)
                                              missing_fixed_parameters = False
                                          End If
                                      Next
                                  End If
                              End If
                          End If
                      End If
                      
                      On Error GoTo 0
                      
                      '|-------------------------------------------------------------------------------|
                      '|-------------------------    creating lagged series        --------------------|
                      '|-------------------------------------------------------------------------------|
                      
                      'assign lags to public variables in order to pass them to arima function
                      'in order to avoid passing them as parameters
                      AR_Lag = p
                      MA_Lag = q
                      
                      'create lagged series to be used in as dependent variable
                      'create lagged series to be base for calculating right side of arma equation,
                      '   *note that this is column vector, there was no need of creating
                      '    multiple column of laged series since we are looping them anyway
                      ReDim independent_variables(1 To t)
                      ReDim dependent_variables(1 To t - AR_Lag)
                      
                      With Application.WorksheetFunction
                          For i = 1 To t
                            independent_variables(i) = tarr(i, 1)
                          Next i
                          For i = 1 To t - AR_Lag
                            dependent_variables(i) = tarr(i + AR_Lag, 1)
                          Next i
                      End With
                      
                      '-------------------------------------------------------------------------------------|
                      '--------------------------   calibrate parameters          --------------------------|
                      '-------------------------------------------------------------------------------------|
                      'create new instance of Levenberg object
                      Dim levObj As New LevenbergMarquardt
                      
                      'estimate the coefficients by minimizing:
                      '           sum((y-arma_fitted(params, independent_variables)^2)
                      res = levObj.CalibrateParameters("arma_fitted", independent_variables, dependent_variables, params)
                      
                      '|------------------------------------------------------------------------------------|
                      '|-------------------------   calculating statistics     -----------------------------|
                      '|------------------------------------------------------------------------------------|
                      
                      'take out the residuals from levObj class
                      Residuals = levObj.fvec
                      
                      'calculate the sum of squares
                  '    SumOfSquares = Application.WorksheetFunction.SumProduct(residuals, residuals)
                      SumOfSquares = Application.WorksheetFunction.SumSq(Residuals)
                      
                      'calculate unbiased variance
                  '    size = t - AR_lag
                      Dim nfixed As Long
                      nfixed = 0
                      For i = 1 To p + q + 1
                          If Fixed_Parameters(i) <> "" Then nfixed = nfixed + 1
                      Next
                      size = t - AR_Lag - AR_Lag - MA_Lag - 1 + nfixed
                      variance = SumOfSquares / size
                      
                      'calculate hessian of SS function for optimized coefficient values
                      'Hessian = Hessian_("SS", res, independent_variables, dependent_variables, 0.00001)
                      
                      Dim Jacobian
                      Jacobian = levObj.Jacobian
                      
                      With Application.WorksheetFunction
                          Hessian = .MMult(.Transpose(Jacobian), Jacobian)
                      End With
                      
                      'in case of fixed parameters exclude zeros from hessian in order to take the inverse
                      'call the new created hessian HessianCorrected and assign it to be new hessian
                      If missing_fixed_parameters = False Then 'calculate the number of non fixed parameters
                          
                          non_fixed = 0
                          
                          For i = 1 To UBound(Hessian)
                              If Fixed_Parameters(i) = "" Then non_fixed = 1 + non_fixed
                          Next i
                          
                          Dim HessianCorrected() 'create new hessian without fixed values
                          ReDim HessianCorrected(1 To non_fixed, 1 To non_fixed) As Variant
                          
                          ii = 0
                          'take only variable values from hessian matrix into new corrected hessian
                          For i = 1 To UBound(Hessian)
                          If Fixed_Parameters(i) = "" Then
                              ii = ii + 1
                              jj = 0
                              For j = 1 To UBound(Hessian)
                                   If Fixed_Parameters(j) = "" Then
                                      jj = jj + 1
                                      HessianCorrected(ii, jj) = Hessian(i, j)
                                  End If
                              Next j
                          End If
                          Next i
                          
                          'overwrite the old hessian..
                          ReDim Hessian(1 To non_fixed, 1 To non_fixed)
                          Hessian = HessianCorrected 'hessian without zeros
                      End If
                      
                      InverseHessian = Application.WorksheetFunction.MInverse(Hessian)
                      
                      'calculate covariance matrix of coefficients errors
                      ReDim CoefErrorMatrix(1 To UBound(Hessian), 1 To UBound(Hessian))
                      For i = 1 To UBound(Hessian)
                          For j = 1 To UBound(Hessian)
                              If UBound(Hessian) = 1 Then
                                  CoefErrorMatrix(i, j) = InverseHessian(i) * variance * 2
                              Else
                                  CoefErrorMatrix(i, j) = InverseHessian(i, j) * variance * 2  'took me a while, still cant figure out this one
                              End If
                          Next j
                      Next i
                      
                      'calculating coefficients errors
                      ReDim Coefs_Errors(1 To UBound(params))
                      ii = 0
                      On Error GoTo errorHandler
                      For i = 1 To UBound(params)
                      If missing_fixed_parameters = False Then
                          If Fixed_Parameters(i) <> "" Then
                              ii = ii + 1
                              Coefs_Errors(i) = CVErr(xlErrNA) 'put error on place of fixed parameter
                          Else
                              'On Error GoTo 0 'in case of negative values under the sqr
                              
                              Coefs_Errors(i) = Sqr(CoefErrorMatrix(i - ii, i - ii))
                          End If
                      Else
                          Coefs_Errors(i) = Sqr(CoefErrorMatrix(i, i))
                      End If
                      Next i
                      
                      'creating output array
                      Dim h As Long
                      h = 0
                      If lab Then h = 1
                      ReDim final_result(1 To AR_Lag + MA_Lag + h + 1, 1 To h + 4)
                      
                      If lab Then
                          final_result(1, 1) = ""
                          final_result(1, 2) = "coeff"
                          final_result(1, 3) = "s.e."
                          final_result(1, 4) = "t-stat"
                          final_result(1, 5) = "p-value"
                          final_result(2, 1) = "constant"
                          For i = 1 To p
                              final_result(i + 2, 1) = "psi " & Str(i)
                          Next
                          For i = 1 To q
                              final_result(i + p + 2, 1) = "theta " & Str(i)
                          Next
                      End If
                      
                      For i = 1 To AR_Lag + MA_Lag + 1
                          final_result(h + i, h + 1) = res(i)
                          final_result(h + i, h + 2) = Coefs_Errors(i)
                          final_result(h + i, h + 3) = res(i) / Coefs_Errors(i)
                          final_result(h + i, h + 4) = T_DIST_2T(Abs(final_result(h + i, h + 3)), size - p - q - 1)
                      Next i
                      
                      Erase Fixed_Parameters 'IMPORTANT
                      
                      ARIMA_Coeff = final_result
                      
                      Exit Function
                      
                  errorHandler:
                      
                      Coefs_Errors(i) = CVErr(xlErrNum) 'in case of negative errors under sqrt due to numerical imprecision
                      Resume Next
                      
                  End Function
                  
                  Private Function arma_fitted(params As Variant, TimeSeries() As Double)
                  Dim t                   As Long
                  Dim i                   As Long
                  Dim j                   As Long
                  Dim function_values     As Variant
                  Dim R_coef()            As Double
                  Dim e_coef()            As Double
                  Dim constant            As Double
                  Dim AR_laged()          As Double
                  Dim MA_laged()          As Double
                  Dim AR_sum              As Double
                  Dim MA_sum              As Double
                  'read in time series
                  t = UBound(TimeSeries)
                  
                  'check if there are fixed values and assign them to params if there are any
                  If missing_fixed_parameters = False Then
                      For i = 1 To UBound(params)
                          If Fixed_Parameters(i) <> "" Then
                              params(i) = Fixed_Parameters(i)
                           End If
                      Next i
                  End If
                  'create AR coefs
                  If AR_Lag > 0 Then
                      ReDim R_coef(1 To AR_Lag)
                      For i = 2 To (2 + AR_Lag - 1)
                          R_coef(i - 1) = params(i)
                      Next i
                  Else
                      ReDim R_coef(1 To 1)
                      R_coef(1) = 0
                  End If
                  
                  'create MA coefs
                  If MA_Lag > 0 Then
                      ReDim e_coef(1 To MA_Lag)
                      For i = 2 + AR_Lag To (2 + AR_Lag + MA_Lag - 1)
                          e_coef(i - 1 - AR_Lag) = params(i)
                      Next i
                  Else
                      ReDim e_coef(1 To 1)
                      e_coef(1) = 0
                  End If
                  
                  'create AR terms
                  If AR_Lag > 0 Then
                      ReDim AR_laged(1 To AR_Lag)
                      For i = 1 To AR_Lag
                          AR_laged(i) = TimeSeries(AR_Lag - i + 1)
                          AR_sum = AR_sum + AR_laged(i) * R_coef(i)
                      Next i
                  Else
                      ReDim AR_laged(1 To 1)
                      AR_laged(1) = 0
                  End If
                  
                  'create MA terms
                  If MA_Lag > 0 Then
                      ReDim MA_laged(1 To MA_Lag)
                      For i = 1 To MA_Lag
                          MA_laged(i) = 0
                      Next i
                  Else
                      ReDim MA_laged(1 To 1)
                      MA_laged(1) = 0
                  End If
                  
                  ReDim function_values(1 To t - AR_Lag)
                  
                  constant = params(1)
                  
                  For i = 1 To (t - AR_Lag)
                      
                      function_values(i) = constant + AR_sum + MA_sum
                      
                      AR_sum = 0
                      MA_sum = 0
                      
                      If AR_Lag > 0 Then
                          For j = 1 To AR_Lag
                              AR_laged(j) = TimeSeries(i + AR_Lag - j + 1)
                              AR_sum = AR_sum + AR_laged(j) * R_coef(j)
                          Next j
                      End If
                      
                      If MA_Lag > 0 Then
                          For j = 1 To MA_Lag
                              If i - j + 1 < 1 Then
                                  Exit For
                              End If
                              MA_laged(j) = TimeSeries(i - j + 1 + AR_Lag) - function_values(i - j + 1)
                              MA_sum = MA_sum + e_coef(j) * MA_laged(j)
                          Next j
                      End If
                      
                  Next i
                  
                  arma_fitted = function_values
                  
                  End Function
                  
                  Private Function fDim(array1 As Variant) As Long
                  ' return number of dimensions of array1: 0, 1 or -1 (i.e. >= 2)
                  ' assumes that array1 is not a range
                      On Error GoTo ErrTrap
                      Dim n As Long
                      Dim errcode As Long
                      errcode = 0
                      n = UBound(array1, 1)
                      errcode = 1
                      n = UBound(array1, 2)
                      fDim = -1
                      Exit Function
                  ErrTrap:
                      fDim = errcode
                  End Function
                  
                  Function Arima_Stats(tarray As Variant, carray As Variant, p As Long, q As Long, Optional d As Long = 0,     Optional con As Boolean = True, Optional lab As Boolean = False) As Variant
                  Attribute Arima_Stats.VB_Description = "returns a column with LL, SS, MSE, AIC, BIC, AIC augmented, BIC augmented"
                  Attribute Arima_Stats.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' output various statistics for an Arima model: LL, SS, MSE, AIC, BIC, AIC aug, BIC aug, when p < q
                  
                      Dim tarr As Variant     ' tarray (time series) as array differenced d times
                      tarr = tarray
                      Dim carr As Variant     ' carray as array
                      carr = carray
                      Dim t As Long           ' time series length
                      t = UBound(tarr, 1) - d
                      If d > 0 Then
                          ReDim tarr(1 To t, 1 To 1)
                          tarr = ADIFF(tarray, d)
                      End If
                      
                      Dim c As Double         ' constant term
                      Dim i As Long
                      Dim j As Long
                      Dim temp As Double
                      Dim SumOfSquares As Double
                      Dim variance As Double
                      Dim size As Long
                      size = t - p
                      Dim t0 As Long
                      If q > p Then
                          t0 = p - q + 1
                      Else
                          t0 = 1
                      End If
                      Dim Residuals As Variant
                      ReDim Residuals(t0 To t, 1 To 1)
                      
                      Dim h As Long
                      h = 1
                      If lab Then h = 2
                      ReDim outp(1 To 7, 1 To h)
                      
                      If lab Then
                          outp(1, 1) = "LL"
                          outp(2, 1) = "SS"
                          outp(3, 1) = "MSE"
                          outp(4, 1) = "AIC"
                          outp(5, 1) = "BIC"
                          outp(6, 1) = "AIC aug"
                          outp(7, 1) = "BIC aug"
                      End If
                      
                      Dim k As Long       ' # of parameters
                      k = p + q + 2
                      If con Then
                          temp = 0#
                          For j = 1 To p
                              temp = temp + carr(j + 1, 1)
                          Next
                          c = carr(1, 1) / (1 - temp)
                          For i = 1 To t
                              tarr(i, 1) = tarr(i, 1) - c
                          Next
                      Else
                          k = k - 1
                      End If
                      
                      For i = t0 To p
                          Residuals(i, 1) = 0#
                      Next
                      For i = p + 1 To t
                          temp = tarr(i, 1)
                          For j = 1 To p
                              temp = temp - carr(j + 1, 1) * tarr(i - j, 1)
                          Next
                          For j = 1 To q
                              temp = temp - carr(j + p + 1, 1) * Residuals(i - j, 1)
                          Next
                          Residuals(i, 1) = temp
                      Next
                      
                      With Application.WorksheetFunction
                          SumOfSquares = .SumSq(Residuals)
                          variance = SumOfSquares / size
                          outp(2, h) = SumOfSquares
                          outp(3, h) = variance
                          outp(4, h) = size * .ln(variance) + 2 * k
                          outp(5, h) = size * .ln(variance) + .ln(size) * k
                          outp(6

                  General
                  Stream Path:VBA/Basic
                  VBA File Name:Basic
                  Stream Size:9348
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . y . . . . . . . . . . . . i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . @ . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 82 0e 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff c5 0e 00 00 79 1e 00 00 0d 00 00 00 01 00 00 00 d4 1f 69 ae 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Basic"
                  Public SavedRange As String
                  
                  ' Setting cell ranges
                  
                  Sub SetCell(rg As Range, r As Long, c As Long)
                  ' set rg to be the cell in row r and column c
                      Set rg = Cells(r, c)
                  End Sub
                  
                  Sub SetRange(rg As Range, r1 As Long, c1 As Long, r2 As Long, c2 As Long)
                  ' set rg to a range with first cell in row r1 and col c1 and second in row r2 and col c2
                      Set rg = Range(Cells(r1, c1), Cells(r2, c2))
                  End Sub
                  
                  Sub SetRange1(rg As Range, r1 As Long, c1 As Long, r2 As Long, c2 As Long)
                  ' set rg to a range with first cell in row r1 and col c1 and height r2 and width c2
                      Set rg = Cells(r1, c1).Resize(r2, c2)
                  End Sub
                  
                  Sub SetRange2(rg As Range, rg0 As Range, r As Long, c As Long)
                  ' set rg to a range with first cell in rg1 and height r and width c
                      Set rg = rg0.Cells(1, 1).Resize(r, c)
                  End Sub
                  
                  Sub SetRange3(rg As Range, rg0 As Range, rg1 As Range)
                  ' set rg to a range with first cell of rg0 and shape of rg1
                      Set rg = rg0.Cells(1, 1).Resize(rg1.Rows.Count, rg1.Columns.Count)
                  End Sub
                  
                  Sub SetRowRange(rg As Range, rg0 As Range, c As Long)
                  ' set rg to the range begining at the first cell in rg1 and of width c
                  '    Call SetRange(rg, rg0.Row, rg0.Column, rg0.Row, rg0.Column + c - 1)
                      Set rg = rg0.Cells(1, 1).Resize(1, c)
                  End Sub
                  
                  Sub SetColRange(rg As Range, rg0 As Range, r As Long)
                  ' set rg to the range begining at the first cell in rg1 and of height of r
                  '    Call SetRange(rg, rg0.Row, rg0.Column, rg0.Row + r - 1, rg0.Column)
                      Set rg = rg0.Cells(1, 1).Resize(r, 1)
                  End Sub
                  
                  ' Set formulas
                  
                  Sub SetFormula(rg As Range, s As String, rg1 As Range, Optional b1 As Boolean = False, Optional b2 As Boolean = False)
                  ' set cell rg to string with formula defined by s on range rg1,using absolute/relative addresing defined by b1 and b2
                      rg = "=" & s & "(" & rg1.Address(b1, b2) & ")"
                  End Sub
                  
                  Sub SetFormulaArray(rg As Range, s As String, rg1 As Range, Optional b1 As Boolean = False, Optional b2 As Boolean = False)
                  ' set cell rg to string with an array formula defined by s on range rg1
                  ' using absolute/relative addresing defined by b1 and b2
                      rg.FormulaArray = "=" & s & "(" & rg1.Address(b1, b2) & ")"
                  End Sub
                  
                  ' range tests
                  
                  Function IsCell(rg As Variant) As Boolean
                  Attribute IsCell.VB_Description = "returns TRUE if rg is a cell"
                  Attribute IsCell.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' returns true if range rg is a single cell or equivalent (i.e. a scalar)
                      If TypeOf rg Is Range Then
                          IsCell = (rg.Rows.Count = 1 And rg.Columns.Count = 1)
                      Else
                          IsCell = (VarType(rg) < vbArray)
                      End If
                  End Function
                  
                  Function IsSquare(rg As Variant) As Boolean
                  Attribute IsSquare.VB_Description = "returns TRUE if rg is a square range or array"
                  Attribute IsSquare.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' returns true if rg is a square range
                  
                      On Error GoTo ErrTrap
                  
                      If TypeOf rg Is Range Then
                          IsSquare = (rg.Rows.Count = rg.Columns.Count)
                      ElseIf VarType(rg) < vbArray Then
                          IsSquare = True
                      Else
                          IsSquare = (UBound(rg, 1) = UBound(rg, 2))
                      End If
                      Exit Function
                  
                  ErrTrap:
                      IsSquare = False
                  End Function
                  
                  ' simple displays
                  
                  Sub SeqRow(ce As Range, n As Long)
                  ' display sequence 1, 2, 3, ... horizontally starting in cell ce
                      Dim rg As Range
                      ce.Value = 1
                      If n > 1 Then
                          ce.Offset(0, 1).Formula = "=" & ce.Address(False, False) & "+1"
                          If n > 2 Then
                              Set rg = ce.Offset(0, 1).Resize(1, n - 1)
                              rg.FillRight
                          End If
                      End If
                  End Sub
                  
                  Sub SeqColumn(ce As Range, n As Long)
                  ' display sequence 1, 2, 3, ... vertically starting in cell ce
                      Dim rg As Range
                      ce.Value = 1
                      If n > 1 Then
                          ce.Offset(1, 0).Formula = "=" & ce.Address(False, False) & "+1"
                          If n > 2 Then
                              Set rg = ce.Offset(1, 0).Resize(n - 1, 1)
                              rg.FillDown
                          End If
                      End If
                  End Sub
                  

                  General
                  Stream Path:VBA/Bayes
                  VBA File Name:Bayes
                  Stream Size:18532
                  Data ASCII:. . . . . . . . j . . . . . . . . . . . . 6 . . . . . . . . . . . x : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . ( . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 6a 11 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff ad 11 00 00 f9 36 00 00 07 00 00 00 01 00 00 00 d4 1f 78 3a 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Bayes"
                  ' Bayesian Analysis
                  
                  Function GRID_HDI(xarray As Variant, yarray As Variant, Optional lab As Boolean = False, Optional p As Double = 0.05,     Optional lprec As Double = 0.1, Optional uprec As Double = 0.1) As Variant
                  Attribute GRID_HDI.VB_Description = "returns a column array containing end points of 1-p HDI for the distribution defined by the grid, length of the interval and estimated 1-p value"
                  Attribute GRID_HDI.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' returns the end points of the 1-p HDI for the distribution defined by the x values in column array x array and
                  ' f(x) values in yarray; actually the 1-p HDI has tolerance of 1-(1-prec)*p to 1-(1+prec)*p
                  
                      Dim xarr As Variant
                      xarr = xarray
                      Dim yarr As Variant
                      yarr = yarray
                      Dim p0 As Double
                      p0 = 1 - p
                      Dim plower As Double
                      plower = 1 - p * (1 + lprec)
                      Dim pupper As Double
                      pupper = 1 - p * (1 - uprec)
                      
                      Dim n As Long
                      n = UBound(xarr, 1)
                      Dim i As Long
                      Dim j As Long
                      Dim pp As Double
                      Dim x As Double
                      Dim imin As Double
                      Dim jmin As Double
                      Dim xmin As Double
                      Dim pmin As Double
                      xmin = xarr(n, 1) - xarr(1, 1) + 1#
                      pmin = 2#
                      
                      Dim parr As Variant ' cumulative version of yarray
                      ReDim parr(n)
                      parr(0) = 0
                      For i = 1 To n
                          parr(i) = parr(i - 1) + yarr(i, 1)
                      Next
                      
                      For i = 1 To n
                          pp = parr(i - 1)
                          x = xarr(i, 1)
                          If parr(n) - pp < plower Then Exit For
                          For j = n To i + 1 Step -1
                              If parr(j) - pp <= pupper Then
                                  If xarr(j, 1) - x < xmin Then
                                      xmin = xarr(j, 1) - x
                                      pmin = Abs(parr(j) - p0)
                                      jmin = j
                                      imin = i
                                  ElseIf xarr(j, 1) - x = xmin Then
                                      If Abs(parr(j) - pp - p0) < pmin Then
                                          pmin = Abs(parr(j) - pp - p0)
                                          jmin = j
                                          imin = i
                                      End If
                                  End If
                              End If
                              If parr(j - 1) - pp < plower Then Exit For
                          Next
                      Next
                      
                      If lab Then
                          h = 2
                          ReDim outp(1 To 4, 1 To 2)
                          outp(1, 1) = "lower"
                          outp(2, 1) = "upper"
                          outp(3, 1) = "length"
                          outp(4, 1) = "1-p"
                      Else
                          h = 1
                          ReDim outp(1 To 4, 1 To 1)
                      End If
                      
                      outp(1, h) = xarr(imin, 1)
                      outp(2, h) = xarr(jmin, 1)
                      outp(3, h) = outp(2, h) - outp(1, h)
                      outp(4, h) = parr(jmin) - parr(imin - 1)
                      
                      GRID_HDI = outp
                     
                  End Function
                  
                  Function SAMPLE_HDI(xarray As Variant, Optional lab As Boolean = False, Optional p As Double = 0.05) As Variant
                  Attribute SAMPLE_HDI.VB_Description = "returns a column array containing end points of 1-p HDI for the distribution defined by the sample and length of the interval"
                  Attribute SAMPLE_HDI.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' finds the 1-p HDI for the data in xarray
                  
                      Dim arr As Variant
                      arr = xarray
                      Dim n As Long
                      n = UBound(arr, 1)
                      Call sQSort(arr)
                      Dim amax As Long
                      amax = p * n + 1
                      Dim inc As Long
                      inc = n - amax
                      Dim mn As Double
                      Dim amin As Long
                      mn = arr(inc + 1, 1) - arr(1, 1)
                      amin = 1
                      
                      For i = 2 To amax
                          If arr(inc + i, 1) - arr(i, 1) < mn Then
                              mn = arr(inc + i, 1) - arr(i, 1)
                              amin = i
                          End If
                      Next
                      
                      Dim outp As Variant
                      If lab Then
                          h = 2
                          ReDim outp(1 To 3, 1 To 2)
                          outp(1, 1) = "lower"
                          outp(2, 1) = "upper"
                          outp(3, 1) = "length"
                      Else
                          h = 1
                          ReDim outp(1 To 3, 1 To 1)
                      End If
                      
                      outp(1, h) = arr(amin, 1)
                      outp(2, h) = outp(1, h) + mn
                      outp(3, h) = mn
                      
                      SAMPLE_HDI = outp
                      
                  End Function
                  
                  Function ESS(xarray As Variant, Optional cutoff As Double = 0.05) As Double
                  Attribute ESS.VB_Description = "returns effective sample size (ESS) of the sample xarray"
                  Attribute ESS.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' ESS value for the column array xarray
                  
                      Dim i As Long
                      Dim n As Long
                      n = Application.WorksheetFunction.Count(xarray)
                      Dim temp As Double
                      Dim tot As Double
                      tot = 0#
                      For i = 1 To n
                          temp = ACF(xarray, i)
                          If temp < cutoff Then Exit For
                          tot = tot + temp
                      Next
                      ESS = n / (2 * tot + 1#)
                          
                  End Function
                  
                  Sub SubstituteFormula(ce As Range, ce0 As Range, ce1 As Range, ByRef s As Variant)
                  ' takes the formula in cell ce and replaces all instances of the string that is the address of cell ce0
                  ' by the string that is the address of cell ce1 and outputs the string s
                  ' it is assumed that all cell references in the formula in ce use absolute formatting except the address of ce
                  ' which uses relative addressing
                      Dim ss As String
                      Dim s0 As String
                      Dim s1 As String
                      ss = ce.Formula
                      s0 = ce0.Address(False, False)
                      s1 = ce1.Address(False, False)
                      s = Replace(ss, s0, s1)
                  End Sub
                  
                  Function NORM_GAMMA(mu0 As Double, phi0 As Double, n0 As Double, avg As Double, var As Double, n As Long,     Optional lab As Boolean = False) As Variant
                  Attribute NORM_GAMMA.VB_Description = "returns a column array with the mean, variance and size for the posterior GammaNorm distribution"
                  Attribute NORM_GAMMA.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return posterior corresponding to the NormGamma prior defined by mu, phi, n
                  
                      Dim outp As Variant
                      Dim n1 As Double
                      If lab Then
                          h = 2
                          ReDim outp(1 To 3, 1 To 2)
                          outp(1, 1) = "mu"
                          outp(2, 1) = "phi"
                          outp(3, 1) = "n"
                      Else
                          h = 1
                          ReDim outp(1 To 3, 1 To 1)
                      End If
                      
                      n1 = n + n0
                      outp(3, h) = n1
                      outp(1, h) = (n0 * mu0 + n * avg) / n1
                      outp(2, h) = ((n - 1) * var + (n0 - 1) * phi0 + n * n0 * (avg - mu0) ^ 2 / n1) / (n1 - 1)
                      
                      NORM_GAMMA = outp
                      
                  End Function
                  
                  Sub RunGrid(rg As Range, ce As Range, mn As Double, mx As Double, inc As Double)
                  ' create a grid for Bayesian analysis
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim rg1 As Range
                      Dim buffer As Variant
                  
                      ce.Value = "Grid for Bayesian Analysis"
                  
                      ' display column headings
                      Call SetRowRange(rg1, ce.Offset(2, 0), 5)
                      rg1.Borders(xlEdgeTop).LineStyle = xlDouble
                      rg1.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      rg1.HorizontalAlignment = xlCenter
                      rg1.Font.Italic = True
                      buffer = rg1.Value
                      Call SetRowLabels(buffer, "data,prior,lik'hood,prod,posterior")
                      rg1.Value = buffer
                          
                      ' display grid data
                      Dim ss As String
                      Dim n As Long
                      n = Application.WorksheetFunction.RoundUp((mx - mn) / inc, 0) + 1
                      ce.Offset(3, 0).Value = mn
                      ce.Offset(4, 0).Formula = "=" & ce.Offset(3, 0).Address(False, False) & "+" & CStr(inc)
                      If n > 3 Then
                          Set rg1 = ce.Offset(4, 0).Resize(n - 2, 1)
                          rg1.FillDown
                      End If
                      ce.Offset(n + 2, 0) = mx
                      Call SubstituteFormula(rg.Cells(2, 1), rg.Cells(1, 1), ce.Offset(3, 0), ss)
                      ce.Offset(3, 1).Formula = ss
                      Call SubstituteFormula(rg.Cells(3, 1), rg.Cells(1, 1), ce.Offset(3, 0), ss)
                      ce.Offset(3, 2).Formula = ss
                      ce.Offset(3, 3).Formula = "=" & ce.Offset(3, 1).Address(False, False) & "*" & ce.Offset(3, 2).Address(False, False)
                      ce.Offset(3, 4).Formula = "=" & ce.Offset(3, 3).Address(False, False) & "/" & ce.Offset(n + 3, 3).Address(True, False)
                      If n > 1 Then
                          Set rg1 = ce.Offset(3, 1).Resize(n, 4)
                          rg1.FillDown
                      End If
                      
                      ' get total for product column
                      Set rg1 = ce.Offset(3, 0).Resize(n, 5)
                      rg1.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      Set rg1 = ce.Offset(3, 3).Resize(n, 1)
                      ce.Offset(n + 3, 3).Formula = "=SUM(" & rg1.Address(False, False) & ")"
                      Set rg1 = ce.Offset(n + 3, 3).Resize(1, 2)
                      rg1.FillRight
                      
                      Application.ScreenUpdating = True
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                  
                  End Sub
                  
                  Sub RunGibbs(rg As Range, ce As Range, n As Long)
                  ' use Gibbs Sampler
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim rg1 As Range
                      Dim buffer As Variant
                  
                      ce.Value = "Gibbs Sampler"
                  
                      ' display column headings
                      Call SetRowRange(rg1, ce.Offset(2, 0), 2)
                      rg1.Borders(xlEdgeTop).LineStyle = xlDouble
                      rg1.Borders(xlEdgeBottom).LineStyle = xlContinuous
                      rg1.HorizontalAlignment = xlCenter
                      rg1.Font.Italic = True
                      buffer = rg1.Value
                      Call SetRowLabels(buffer, "x,y")
                      rg1.Value = buffer
                          
                      ' display Gibbs Sampler
                      Dim ss As String
                      ce.Offset(3, 0).Formula = "=" & rg.Cells(1, 1).Address(True, True)
                      ce.Offset(3, 1).Formula = "=" & rg.Cells(1, 2).Address(True, True)
                      Call SubstituteFormula(rg.Cells(2, 1), rg.Cells(1, 2), ce.Offset(3, 1), ss)
                      ce.Offset(4, 0).Formula = ss
                      Call SubstituteFormula(rg.Cells(2, 2), rg.Cells(2, 1), ce.Offset(4, 0), ss)
                      ce.Offset(4, 1).Formula = ss
                      If n > 2 Then
                          Set rg1 = ce.Offset(4, 0).Resize(n, 2)
                          rg1.FillDown
                      End If
                      
                      Application.ScreenUpdating = True
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                  
                  End Sub
                  

                  General
                  Stream Path:VBA/BoundReg
                  VBA File Name:BoundReg
                  Stream Size:33931
                  Data ASCII:. . . . . . . . " . . . . . . . . . P . . . f . . . . . . . . . . . f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . . . + .
                  Data Raw:01 16 03 00 06 f0 00 00 00 22 18 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 50 18 00 00 d8 66 00 00 07 00 00 00 01 00 00 00 d4 1f f7 66 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "BoundReg"
                  Function BRegCoeff(xarray As Variant, yarray As Variant, larray As Variant, uarray As Variant) As Variant
                  Attribute BRegCoeff.VB_Description = "returns a column array consisting of the regression coefficients subject to the specified bounds"
                  Attribute BRegCoeff.VB_ProcData.VB_Invoke_Func = " \n28"
                      
                      Dim key As Boolean
                      key = True
                      Dim xarr As Variant
                      xarr = DESIGN(xarray)
                      Dim m As Long
                      m = UBound(xarr, 1)
                      Dim n As Long
                      n = UBound(xarr, 2)
                      Dim mm As Long
                      mm = m
                      If n < m Then mm = n
                      Dim yarr As Variant
                      yarr = yarray
                      Dim larr As Variant
                      larr = larray
                      Dim uarr As Variant
                      uarr = uarray
                      Dim i As Long
                      
                      Dim bl As Variant
                      ReDim bl(1 To n)
                      Dim bu As Variant
                      ReDim bu(1 To n)
                      Dim y As Variant
                      ReDim y(1 To m)
                      
                      For i = 1 To n
                          bl(i) = larr(i, 1)
                          bu(i) = uarr(i, 1)
                      Next
                      For i = 1 To m
                          y(i) = yarr(i, 1)
                      Next
                      
                      Dim w As Variant
                      ReDim w(1 To n)
                      Dim istate As Variant
                      ReDim istate(1 To n + 1)
                      Dim act As Variant
                      ReDim act(1 To m, 1 To mm + 2)
                      Dim zz As Variant
                      ReDim zz(1 To m)
                      Dim ok As Boolean
                      Dim loopA As Long
                      
                      
                      Dim b As Variant
                      ReDim b(1 To n)
                      
                      Call BVLS(key, m, n, xarr, y, bl, bu, b, w, act, zz, istate, loopA, ok)
                      
                      Dim outp As Variant
                      
                      If ok Then
                          ReDim outp(1 To n, 1 To 1)
                          For i = 1 To n
                              outp(i, 1) = b(i)
                          Next
                          BRegCoeff = outp
                      Else
                          BRegCoeff = CVErr(xlErrNA)
                      End If
                  
                  End Function
                  
                  Sub BVLS(key As Boolean, m As Long, n As Long, a As Variant, b As Variant, bl As Variant, bu As Variant,     x As Variant, w As Variant, act As Variant, zz As Variant, istate As Variant, loopA As Variant, ok As Boolean)
                  ' bounded-variable linear-squares algorithm
                  ' finds x that minimizes ||ax-b|| such that bl<=x<=bu
                  ' a is an m x n array, b is an m x 1 array, x is n x 1 array (unknown), bl and bu are n x 1 array
                  ' w is n x 1 array (neg gradiant), zz is m x 1 array, istate is n+1 x 1 array, act is m x mm+2 array
                  ' key is used to initialize x, absolute values of elements in istate correspond to index of elements in x
                  ' first istate(n+1) elements in istate correspond to bound elements in x
                  ' for bound elements; i.e. j <= istate(n+1) : istate(j) < 0 : x uses lower bound, istate(j) > j : x uses upper bound
                  ' any free element in x is initialized to average of lower and upper bound
                  
                      ' step 1: initialize
                      Dim mm As Long
                      mm = m
                      If n < m Then mm = n
                      Dim MM1 As Long
                      MM1 = mm + 1
                      Dim eps As Double
                      eps = 0.000000000001
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      ok = True
                      Dim resq As Double
                      
                      ' calculate bdiff
                      Dim bdiff As Double     ' max difference between bounds
                      bdiff = 0#
                      For j = 1 To n
                          If bl(j) > bu(j) Then
                              ok = False      ' improper bounds
                              Exit Sub
                          End If
                          If bu(j) - bl(j) > bdiff Then bdiff = bu(j) - bl(j)
                      Next
                      If bdiff = 0# Then
                          ok = False
                          Exit Sub
                      End If
                      
                      ' initialize nbound, nact, istate
                      Dim nbound As Long      ' number of bound elements in x
                      Dim nact As Long        ' number of free elements in x
                      If key Then ' initialize using bounds
                          nbound = n
                          For j = 1 To nbound
                              istate(j) = -j
                          Next
                      Else    ' warm start
                          nbound = istate(n + 1)
                      End If
                      nact = n - nbound
                      If nact > mm Then
                          ok = False      ' too many free variables in BVLS starting solution
                          Exit Sub
                      End If
                      
                      ' initialize x
                      For j = 1 To nbound
                          k = Abs(istate(j))
                          If istate(j) < 0 Then
                              x(k) = bl(k)
                          ElseIf istate(j) > 0 Then
                              x(k) = bu(k)
                          End If
                      Next
                      For j = nbound + 1 To n
                          k = istate(j)
                          x(k) = (bl(k) + bu(k)) / 2
                      Next
                      
                      ' calculate length of b vector
                      Dim bnorm As Double     ' length of b vector
                      bnorm = 0#
                      For i = 1 To m
                          bnorm = bnorm + b(i) * b(i)
                      Next
                      bnorm = Sqr(bnorm)
                      
                      ' main loop
                      
                      Dim bad As Double
                      Dim worst As Double
                      Dim nn As Long
                      nn = 3 * n
                      Dim obj As Double   ' value of ||ax-b||
                      Dim r As Double     ' residual
                      Dim kk As Long
                      kk = 0
                      Dim ifrom5 As Long
                      ifrom5 = 0
                      Dim it As Long
                      Dim j1 As Long
                      Dim iact As Long
                      Dim bound As Double
                      Dim alpha As Double
                      Dim alf As Double
                      Dim sk As Long
                      Dim noldb As Long
                      Dim bb As Variant
                      ReDim bb(1 To m)
                      
                      For loopA = 1 To nn
                      
                          ' step 2: initialize negative gradiant vector w
                          obj = 0#
                          For j = 1 To n
                              w(j) = 0#
                          Next
                          
                          ' place residuals b - ax in mm+1st column of act
                          For i = 1 To m
                              r = b(i)
                              For j = 1 To n
                                  r = r - a(i, j) * x(j)
                              Next
                              obj = obj + r ^ 2
                              For j = 1 To n
                                  w(j) = w(j) + r * a(i, j)
                              Next
                              act(i, MM1) = r
                          Next
                          
                          ' check for convergence
                          If Sqr(obj) <= bnorm * eps Or (loopA > 1 And nbound = 0) Then
                              istate(n + 1) = nbound
                              w(1) = Sqr(obj)
                              Exit Sub
                          End If
                          
                          ' add contribution of the free components back into the residual
                          For j = nbound + 1 To n
                              k = istate(j)
                              For i = 1 To m
                                  act(i, MM1) = act(i, MM1) + a(i, k) * x(k)
                              Next
                          Next
                  
                          ' first iteration in a warm start requires immediate QR
                          If loopA = 1 And Not key Then GoTo lab2
                  lab1:
                          ' step 3 & 4: find the bound element that most wants to be free.
                          worst = 0#
                          it = 1
                          For j = 1 To nbound
                              k = Abs(istate(j))
                              bad = w(k) * Sgn(istate(j))
                              If bad < worst Then
                                  it = j
                                  worst = bad
                                  iact = k
                              End If
                          Next
                  
                          ' test whether the Kuhn-Tucker condition is met.
                          If worst >= 0# Then
                              istate(n + 1) = nbound
                              w(1) = Sqr(obj)
                              Exit Sub
                          End If
                          
                          ' x(iact) most wants to become free.
                          ' if the last successful change in the free set was to move x(iact) to a bound, then
                          ' don't free x(iact) now: set the derivative of the misfit wrt x(iact) to 0 and return to the Kuhn-Tucker test
                          If iact = kk Then
                              w(kk) = 0#
                              GoTo lab1
                          End If
                  
                          ' step 5: undo the effect of the new (potentially) free variable on the residual vector
                          If istate(it) > 0 Then bound = bu(iact)
                          If istate(it) < 0 Then bound = bl(iact)
                          For i = 1 To m
                              act(i, MM1) = act(i, MM1) + bound * a(i, iact)
                          Next
                          
                          ' set flag ifrom5, indicating that Step 6 was entered from Step 5; test for instability
                          ifrom5 = istate(it)
                          istate(it) = istate(nbound)
                          nbound = nbound - 1
                          nact = nact + 1
                          istate(nbound + 1) = iact
                          If mm < nact Then
                              ok = False  ' too many free variables in BVLS
                              Exit Sub
                          End If
                  lab2:
                          ' step 6: load array act with the appropriate columns of a for QR and improve stability
                          For i = 1 To m
                              act(i, MM1 + 1) = act(i, MM1)
                              For j = nbound + 1 To n
                                  k = istate(j)
                                  act(i, nact + 1 - j + nbound) = a(i, k)
                              Next
                          Next
                          For i = 1 To m
                              bb(i) = act(i, MM1 + 1)
                          Next
                  '       Call QR(m, nact, act, act(1, mm1 + 1), zz, resq)
                          Call QR(m, nact, act, bb, zz, resq)
                          
                          ' test for linear dependence in qr and for an instability
                          If resq < 0# Or (ifrom5 > 0 And zz(nact) > bu(iact)) Or (ifrom5 < 0 And zz(nact) < bl(iact)) Then
                              nbound = nbound + 1
                              istate(nbound) = istate(nbound) * Sgn(x(iact) - bu(iact))
                              nact = nact - 1
                              For i = 1 To m
                                  act(i, MM1) = act(i, MM1) - x(iact) * a(i, iact)
                              Next
                              ifrom5 = 0
                              w(iact) = 0#
                              GoTo lab1
                          End If
                          
                          ' if Step 6 was entered from Step 5, a new variable has been successfully introduced into the free set
                          ' the last variable that was fixed as bound is again permitted to become free
                          If ifrom5 <> 0 Then kk = 0
                          ifrom5 = 0
                          
                          ' step 7: check for strict feasibility of the new QR solution
                          For j = 1 To nact
                              j1 = j
                              k = istate(j + nbound)
                              If zz(nact + 1 - j) < bl(k) Or zz(nact + 1 - j) > bu(k) Then GoTo lab3
                          Next
                          For j = 1 To nact
                              k = istate(j + nbound)
                              x(k) = zz(nact + 1 - j)
                          Next
                          GoTo lab4
                  lab3:
                          ' step 8 and 9
                          alpha = 2#
                          alf = alpha
                          For j = j1 To nact
                              k = istate(j + nbound)
                              If zz(nact + 1 - j) > bu(k) Then alf = (bu(k) - x(k)) / (zz(nact + 1 - j) - x(k))
                              If zz(nact + 1 - j) < bl(k) Then alf = (bl(k) - x(k)) / (zz(nact + 1 - j) - x(k))
                              If alf < alpha Then
                                  alpha = alf
                                  kk = k
                                  sk = Sgn(zz(nact + 1 - j) - bl(k))
                              End If
                          Next
                          
                          ' step 10
                          For j = 1 To nact
                              k = istate(j + nbound)
                              x(k) = x(k) + alpha * (zz(nact + 1 - j) - x(k))
                          Next
                          
                          ' step 11
                          noldb = nbound
                          For j = 1 To nact
                              k = istate(j + noldb)
                              If bu(k) - x(k) <= 0# Or (k = kk And sk > 0#) Then
                              ' move x(k) to its upper bound
                                  x(k) = bu(k)
                                  istate(j + noldb) = istate(nbound + 1)
                                  istate(nbound + 1) = k
                                  nbound = nbound + 1
                                  For i = 1 To m
                                      act(i, MM1) = act(i, MM1) - bu(k) * a(i, k)
                                  Next
                              ElseIf x(k) - bl(k) <= 0# Or (k = kk And sk < 0#) Then
                              ' move x(k) to its lower bound
                                  x(k) = bl(k)
                                  istate(j + noldb) = istate(nbound + 1)
                                  istate(nbound + 1) = -k
                                  nbound = nbound + 1
                                  For i = 1 To m
                                      act(i, MM1) = act(i, MM1) - bl(k) * a(i, k)
                                  Next
                              End If
                          Next
                          nact = n - nbound
                          
                          ' if there are still free variables left repeat the qr; if not, go back to the top
                          If nact > 0 Then GoTo lab2
                  lab4:
                      Next
                      
                      ' fail to converge error
                      ok = False
                  
                  End Sub
                  
                  Private Function QRSolver(a As Variant, b As Variant) As Variant
                  ' returns x that solves ax = b
                  
                      Dim arr As Variant
                      arr = a
                      Dim barr As Variant
                      barr = b
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim resq As Double
                      Dim x As Variant
                      ReDim x(1 To n)
                      Dim bb As Variant
                      ReDim bb(1 To m)
                      Dim i As Long
                      
                      For i = 1 To m
                          bb(i) = barr(i, 1)
                      Next
                      
                      Call QR(m, n, arr, bb, x, resq)
                      If resq < 0 Then
                          QRSolver = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      Dim outp As Variant
                      ReDim outp(1 To n, 1 To 1)
                      For i = 1 To n
                          outp(i, 1) = x(i)
                      Next
                      QRSolver = outp
                       
                  End Function
                  
                  Private Sub QR(m As Long, n As Long, a As Variant, b As Variant, x As Variant, resq As Double)
                  ' solves ax = b where a(m,n), b(m), x(n)
                  ' resq = the sum of squared residuals of optimal solution; -1 if singular, -2 if system is undetermined
                  ' a and b are overwritten
                  
                      Dim dot As Double
                      Dim tot As Double
                      Dim sq As Double
                      Dim qv1 As Double
                      Dim i As Long
                      Dim ii As Long
                      Dim j As Long
                      Dim j1 As Long
                      Dim jj As Long
                      Dim cons As Double
                      Dim u1 As Double
                      
                      ' undetermined system (error)
                      If m < n Then
                          resq = -2#
                          Exit Sub
                      End If
                      
                      ' convert a into a triangular matrix
                      
                      For j = 1 To n
                      
                          ' get norm of the jth column of a
                          sq = 0#
                          For i = j To m
                              sq = a(i, j) ^ 2 + sq
                          Next
                          
                          ' singular system (error)
                          If sq = 0# Then
                              resq = -1#
                              Exit Sub
                          End If
                          
                          ' handle diagonal
                          qv1 = -Sqr(sq) * Sgn(a(j, j))
                          u1 = a(j, j) - qv1
                          a(j, j) = qv1
                          j1 = j + 1
                          
                          ' rotate remaining columns of sub-matrix
                          For jj = j1 To n
                              dot = u1 * a(j, jj)
                              For i = j1 To m
                                  dot = a(i, jj) * a(i, j) + dot
                              Next
                              cons = dot / Abs(qv1 * u1)
                              For i = j1 To m
                                  a(i, jj) = a(i, jj) - cons * a(i, j)
                              Next
                              a(j, jj) = a(j, jj) - cons * u1
                          Next
                          
                          ' rotate b vector
                          dot = u1 * b(j)
                          For i = j1 To m
                              dot = b(i) * a(i, j) + dot
                          Next
                          cons = dot / Abs(qv1 * u1)
                          b(j) = b(j) - cons * u1
                          For i = j1 To m
                              b(i) = b(i) - cons * a(i, j)
                          Next
                          
                      Next
                      
                      ' solve triangu1ar system by back-substitution
                      For ii = 1 To n
                          i = n - ii + 1
                          tot = b(i)
                          For j = i + 1 To n
                              tot = tot - a(i, j) * x(j)
                          Next
                          If a(i, i) = 0# Then
                              resq = -1#
                              Exit Sub
                          End If
                          x(i) = tot / a(i, i)
                      Next
                      
                      ' find residual in over-determined case
                      resq = 0#
                      For i = n + 1 To m
                          resq = b(i) ^ 2 + resq
                      Next
                  
                  End Sub
                  
                  Function CRegCoeff(xarray As Variant, yarray As Variant, carray As Variant) As Variant
                  Attribute CRegCoeff.VB_Description = "returns a column array consisting of the regression coefficients subject to the specified constraints"
                  Attribute CRegCoeff.VB_ProcData.VB_Invoke_Func = " \n28"
                  ' calculate regression coefficients for the data in xarray and yarray based on the coefficients in carray
                      Dim carr As Variant
                      carr = carray
                      If carr(1, 1) = 0# Then
                          CRegCoeff = CRegCoeff1(xarray, yarray, carray)
                      Else
                          CRegCoeff = CRegCoeff0(xarray, yarray, carray)
                      End If
                  End Function
                  
                  Private Function CRegCoeff0(xarray As Variant, yarray As Variant, carray As Variant) As Variant
                  ' assume first element in carray is not zero
                  
                      Dim xarr As Variant
                      xarr = xarray
                      Dim m As Long
                      m = UBound(xarr, 1)
                      Dim n As Long
                      n = UBound(xarr, 2)
                      Dim yarr As Variant
                      yarr = yarray
                      Dim carr As Variant
                      carr = carray
                      Dim i As Long
                      Dim j As Long
                      
                      Dim x As Variant
                      ReDim x(1 To m, 1 To n)
                      Dim y As Variant
                      ReDim y(1 To m, 1 To 1)
                      
                      Dim a0 As Double
                      a0 = carr(1, 1)
                      Dim c0 As Double
                      c0 = carr(n + 2, 1) / a0
                      
                      For i = 1 To m
                          y(i, 1) = yarr(i, 1) - c0
                          For j = 1 To n
                              x(i, j) = xarr(i, j) - carr(j + 1, 1) / a0
                          Next
                      Next
                      
                      Dim b As Variant
                      ReDim b(1 To n, 1 To 1)
                      b = RegCoeff(x, y, False)
                      
                      Dim bb As Variant
                      ReDim bb(1 To n + 1, 1 To 1)
                      Dim b0 As Double
                      b0 = carr(n + 2, 1)
                      For j = 1 To n
                          bb(j + 1, 1) = b(j, 1)
                          b0 = b0 - carr(j + 1, 1) * b(j, 1)
                      Next
                      bb(1, 1) = b0 / a0
                      
                      CRegCoeff0 = bb
                  
                  End Function
                  
                  Private Function CRegCoeff1(xarray As Variant, yarray As Variant, carray As Variant) As Variant
                  ' assume first element in carray is zero
                  
                      Dim xarr As Variant
                      xarr = xarray
                      Dim m As Long
                      m = UBound(xarr, 1)
                      Dim n As Long
                      n = UBound(xarr, 2)
                      Dim yarr As Variant
                      yarr = yarray
                      Dim carr As Variant
                      carr = carray
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim temp As Double
                      
                      Dim x As Variant
                      ReDim x(1 To m, 1 To n - 1)
                      Dim y As Variant
                      ReDim y(1 To m, 1 To 1)
                      
                      Dim h As Long       ' index of largest c(i,1) in absolute value with i > 0
                      Dim ah As Double    ' largest c(i,1) in absolute value
                      ah = -1
                      For j = 2 To n
                          If Abs(carr(j, 1)) > ah Then
                              h = j - 1
                              ah = Abs(carr(j, 1))
                          End If
                      Next
                      ah = carr(h + 1, 1)   ' need to restore the sign
                      
                      Dim c0 As Double
                      c0 = carr(n + 2, 1) / ah
                      
                      For i = 1 To m
                          y(i, 1) = yarr(i, 1) - c0 * xarr(i, h)
                      Next
                      
                      k = 0
                      For j = 1 To n
                          If j <> h Then
                              k = k + 1
                              temp = carr(j + 1, 1) / ah
                              For i = 1 To m
                                  x(i, k) = xarr(i, j) - temp * xarr(i, h)
                              Next
                          End If
                      Next
                      
                      Dim b As Variant
                      ReDim b(1 To n, 1 To 1)
                      b = RegCoeff(x, y)
                      
                      Dim bb As Variant
                      ReDim bb(1 To n + 1, 1 To 1)
                      Dim bh As Double
                      bh = carr(n + 2, 1)
                      bb(1, 1) = b(1, 1)
                      k = 2
                      For j = 2 To n
                          If j = h + 1 Then k = k + 1
                          bb(k, 1) = b(j, 1)
                          bh = bh - carr(k, 1) * bb(k, 1)
                          k = k + 1
                      Next
                      bb(h + 1, 1) = bh / ah
                      
                      CRegCoeff1 = bb
                  
                  End Function
                  
                  

                  General
                  Stream Path:VBA/ChiSquare
                  VBA File Name:ChiSquare
                  Stream Size:162618
                  Data ASCII:. . . . . . . . r . . . . . . . . 5 s . . . . 2 . . . . . . . . / 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . - . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . p . . + . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 f2 72 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 35 73 00 00 d5 eb 01 00 32 00 00 00 01 00 00 00 d4 1f 2f 33 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "ChiSquare"
                  ' Private
                  
                  Private Function CHIPDF(x As Double, df As Double) As Double
                  ' return the pdf of the chi-square distribution with df degrees of freedom at x     *** not used
                      Dim k As Double
                      k = df / 2
                      CHIPDF = x ^ (k - 1) / (2 ^ k * Exp(Application.WorksheetFunction.GammaLn(k)) * Exp(x / 2))
                  End Function
                  
                  Private Function fChi_Stat(obs1 As Variant, exp1 As Variant) As Variant
                  ' return Pearson chi-sq stat corresponding to observation and expected matrices
                  ' assumes two matrices have the same shape and size
                      Dim m As Long
                      Dim n As Long
                      Dim i As Long
                      Dim j As Long
                      Dim tot As Double
                      tot = 0#
                      m = UBound(obs1, 1)
                      n = UBound(obs1, 2)
                      For i = 1 To m
                          For j = 1 To n
                              tot = tot + (obs1(i, j) - exp1(i, j)) ^ 2 / exp1(i, j)
                          Next
                      Next
                      fChi_Stat = tot
                  End Function
                  
                  Private Function fChi_Max(obs1 As Variant, exp1 As Variant) As Variant
                  ' return max likelihood chi-sq stat corresponding to observation and expected matrices
                  ' assumes two matrices have the same shape and size
                      Dim m As Long
                      Dim n As Long
                      Dim i As Long
                      Dim j As Long
                      Dim tot As Double
                      tot = 0#
                      m = UBound(obs1, 1)
                      n = UBound(obs1, 2)
                      For i = 1 To m
                          For j = 1 To n
                              If obs1(i, j) > 0 Then tot = tot + obs1(i, j) * Log(obs1(i, j) / exp1(i, j))
                          Next
                      Next
                      fChi_Max = 2 * tot
                  End Function
                  
                  Private Sub sChi_Exp(obs1 As Variant, exp1 As Variant)
                  ' calculates the values of the expectation matrix exp1 which corresponds to observation matrix obs1
                      Dim m As Long
                      Dim n As Long
                      Dim i As Long
                      Dim j As Long
                      
                      m = UBound(obs1, 1)
                      n = UBound(obs1, 2)
                      Dim tot_row() As Variant
                      ReDim tot_row(1 To m)
                      Dim tot_col() As Variant
                      ReDim tot_col(1 To n)
                      Dim tot As Double
                      Dim gtot As Double
                  
                      For i = 1 To m
                          tot = 0#
                          For j = 1 To n
                              tot = tot + obs1(i, j)
                          Next
                          tot_row(i) = tot
                      Next
                      
                      gtot = 0#
                      For j = 1 To n
                          tot = 0#
                          For i = 1 To m
                              tot = tot + obs1(i, j)
                          Next
                          tot_col(j) = tot
                          gtot = gtot + tot
                      Next
                      
                      For i = 1 To m
                          For j = 1 To n
                              exp1(i, j) = tot_row(i) * tot_col(j) / gtot
                          Next
                      Next
                  
                  End Sub
                  
                  ' Public
                  
                  Function CHI_STAT2(array1 As Variant, array2 As Variant) As Double
                  Attribute CHI_STAT2.VB_Description = "returns Pearson's chi-square statistic for independence test"
                  Attribute CHI_STAT2.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return Pearson chi-square stat that corresponds to the obs range array1 and exp range array2
                  ' assumes that array1 and array2 are the same size and shape
                      Dim obs1 As Variant
                      Dim exp1 As Variant
                      obs1 = array1
                      exp1 = array2
                      CHI_STAT2 = fChi_Stat(obs1, exp1)
                  End Function
                  
                  Function CHI_MAX2(array1 As Variant, array2 As Variant) As Variant
                  Attribute CHI_MAX2.VB_Description = "returns maximum likelihood chi-square statistic for independence test"
                  Attribute CHI_MAX2.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return max likelihood chi-square stat that corresponds to the obs range array1 and exp range array2
                  ' assumes that array1 and array2 are the same size and shape
                      Dim obs1 As Variant
                      Dim exp1 As Variant
                      obs1 = array1
                      exp1 = array2
                      CHI_MAX2 = fChi_Max(obs1, exp1)
                  End Function
                  
                  Function CHI_STAT(array1 As Variant) As Double
                  Attribute CHI_STAT.VB_Description = "returns Pearson's chi-square statistic for independence test"
                  Attribute CHI_STAT.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return Pearson chi-square stat that corresponds to the range of observation values array1
                      Dim obs1 As Variant
                      Dim exp1() As Variant
                      obs1 = array1
                      ReDim exp1(1 To UBound(obs1, 1), 1 To UBound(obs1, 2))
                      Call sChi_Exp(obs1, exp1)
                      CHI_STAT = fChi_Stat(obs1, exp1)
                  End Function
                  
                  Function CHI_TEST(array1 As Variant) As Double
                  Attribute CHI_TEST.VB_Description = "returns p-value for Pearson's chi-square test of independence"
                  Attribute CHI_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return p-value of Pearson's chi-square stat that corresponds to the range of observation values array1
                      Dim obs1 As Variant
                      Dim exp1() As Variant
                      Dim stat As Double
                      Dim m As Long
                      Dim n As Long
                      obs1 = array1
                      m = UBound(obs1, 1)
                      n = UBound(obs1, 2)
                      ReDim exp1(1 To m, 1 To n)
                      Call sChi_Exp(obs1, exp1)
                      stat = fChi_Stat(obs1, exp1)
                      CHI_TEST = CHISQ_DIST_RT(stat, (m - 1) * (n - 1))
                  End Function
                  
                  Function CHI_MAX(array1 As Variant) As Double
                  Attribute CHI_MAX.VB_Description = "returns maximum likelihood chi-square statistic for independence test"
                  Attribute CHI_MAX.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return maximum likelihood chi-square stat that corresponds to the range of observation values array1
                      Dim obs1 As Variant
                      Dim exp1() As Variant
                      obs1 = array1
                      ReDim exp1(1 To UBound(obs1, 1), 1 To UBound(obs1, 2))
                      Call sChi_Exp(obs1, exp1)
                      CHI_MAX = fChi_Max(obs1, exp1)
                  End Function
                  
                  Function CHI_MAX_TEST(array1 As Variant) As Double
                  Attribute CHI_MAX_TEST.VB_Description = "returns p-value of the maximum likelihood chi-square test of independence"
                  Attribute CHI_MAX_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return p-value of maximum likelihood chi-square stat that corresponds to the range of observation values array1
                      Dim obs1 As Variant
                      Dim exp1() As Variant
                      Dim stat As Double
                      Dim m As Long
                      Dim n As Long
                      obs1 = array1
                      m = UBound(obs1, 1)
                      n = UBound(obs1, 2)
                      ReDim exp1(1 To m, 1 To n)
                      Call sChi_Exp(obs1, exp1)
                      stat = fChi_Max(obs1, exp1)
                      CHI_MAX_TEST = CHISQ_DIST_RT(stat, (m - 1) * (n - 1))
                  End Function
                  
                  Function CHISQ_STAT(array1 As Variant, array2 As Variant, Optional chi As Boolean = True) As Double
                  Attribute CHISQ_STAT.VB_Description = "returns the chi-square statistics for contingency table represented by array1 and array2"
                  Attribute CHISQ_STAT.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns the chi-square statistic for raw data in two columns
                  ' if chi = TRUE, return chi-square statistic; otherwise return maximum log-likelihood statistic
                  
                      Dim arr1 As Variant
                      arr1 = array1
                      Dim arr2 As Variant
                      arr2 = array2
                      Dim mm As Long
                      mm = UBound(arr1, 1)
                      Dim m As Long       ' # of unique values in array1
                      Dim n As Long       ' # of unique values in array2
                      m = COUNTAU(array1)
                      n = COUNTAU(array2)
                      Dim grp1 As Variant
                      ReDim grp1(1 To m, 1 To n)
                      Dim grp2 As Variant
                      ReDim grp2(1 To n, 1 To 1)
                      grp1 = SortsUnique(arr1)
                      grp2 = SortsUnique(arr2)
                      
                      ReDim arr(m, n) As Long
                      Dim i As Long
                      Dim j As Long
                      For i = 1 To m
                          For j = 1 To n
                              arr(i, j) = 0
                          Next
                      Next
                      
                      Dim k As Long
                      For k = 1 To mm
                          ok = False
                          For i = 1 To m
                              If arr1(k, 1) = grp1(i, 1) Then
                                  For j = 1 To n
                                      If arr2(k, 1) = grp2(j, 1) Then
                                          arr(i, j) = arr(i, j) + 1
                                          Exit For
                                      End If
                                  Next
                                  Exit For
                              End If
                          Next
                      Next
                      
                      If chi Then
                          CHISQ_STAT = CHI_STAT(arr)
                      Else
                          CHISQ_STAT = CHI_MAX(arr)
                      End If
                  
                  End Function
                  
                  Function CHISQ_TEST(array1 As Variant, array2 As Variant, Optional chi As Boolean = True) As Double
                  Attribute CHISQ_TEST.VB_Description = "returns the p-value of the chi-square test based on the contingency table represented by array1 and array2"
                  Attribute CHISQ_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns the p-value for the chi-square statistic for raw data in two columns
                  ' if chi = TRUE, return chi-square statistic; otherwise return maximum log-likelihood statistic
                  
                      Dim arr1 As Variant
                      arr1 = array1
                      Dim arr2 As Variant
                      arr2 = array2
                      Dim mm As Long
                      mm = UBound(arr1, 1)
                      Dim m As Long       ' # of unique values in array1
                      Dim n As Long       ' # of unique values in array2
                      m = COUNTAU(array1)
                      n = COUNTAU(array2)
                      Dim grp1 As Variant
                      ReDim grp1(1 To m, 1 To n)
                      Dim grp2 As Variant
                      ReDim grp2(1 To n, 1 To 1)
                      grp1 = SortsUnique(arr1)
                      grp2 = SortsUnique(arr2)
                      
                      ReDim arr(m, n) As Long
                      Dim i As Long
                      Dim j As Long
                      For i = 1 To m
                          For j = 1 To n
                              arr(i, j) = 0
                          Next
                      Next
                      
                      Dim k As Long
                      For k = 1 To mm
                          ok = False
                          For i = 1 To m
                              If arr1(k, 1) = grp1(i, 1) Then
                                  For j = 1 To n
                                      If arr2(k, 1) = grp2(j, 1) Then
                                          arr(i, j) = arr(i, j) + 1
                                          Exit For
                                      End If
                                  Next
                                  Exit For
                              End If
                          Next
                      Next
                      
                      If chi Then
                          CHISQ_TEST = CHI_TEST(arr)
                      Else
                          CHISQ_TEST = CHI_MAX_TEST(arr)
                      End If
                      
                  End Function
                  
                  Function CHISQ_SIM(array1 As Variant, Optional lab As Boolean = False,     Optional iter As Long = 10000, Optional chi As Boolean = True, Optional alpha As Double = 0.01) As Variant
                  Attribute CHISQ_SIM.VB_Description = "returns a column array containing p-value, standard error and lower/upper ends of a 1alpha confidence interval for a simulated quasi-exact chi-square test of independence"
                  Attribute CHISQ_SIM.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns the p-value, se, confidence interval chi-square test for data in array1 based on simulation
                  ' if chi = TRUE, return chi-square statistic; otherwise return maximum log-likelihood statistic
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1) - 1
                      Dim n As Long
                      n = UBound(arr, 2) - 1
                      
                      Dim arr0 As Variant ' arr w/o headings
                      ReDim arr0(1 To m, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      For i = 1 To m
                          For j = 1 To n
                              arr0(i, j) = arr(i + 1, j + 1)
                          Next
                      Next
                      
                      Dim stat As Double  ' chi-square stat for original contingency table
                      If chi Then
                          stat = CHI_STAT(arr0)
                      Else
                          stat = CHI_MAX(arr0)
                      End If
                      
                      Dim nn As Long      ' total count
                      nn = Application.WorksheetFunction.Sum(arr0)
                      ReDim vect1(1 To nn) As Variant
                      ReDim vect2(1 To nn) As Variant
                      ReDim marg(1 To m) As Long  ' marginal row totals
                      
                      Dim clab As Variant ' column headings
                      ReDim clab(1 To n)
                      For j = 1 To n
                          clab(j) = arr(1, j + 1)
                      Next
                      
                      ' convert original table into two-column standard format (vect1 and vect2)
                      Dim k As Long
                      Dim kk As Long
                      Dim k1 As Long  ' used to fill marg
                      Dim k2 As Long  ' temp value
                      Dim lab1 As Variant
                      Dim lab2 As Variant
                      k = 1
                      k1 = 1
                      For i = 1 To m
                          For j = 1 To n
                              k2 = k + arr0(i, j) - 1
                              lab1 = arr(i + 1, 1)
                              lab2 = clab(j)
                              For kk = k To k2
                                  vect1(kk) = lab1
                                  vect2(kk) = lab2
                              Next
                              k = k2 + 1
                          Next
                          marg(i) = k - k1
                          k1 = k
                      Next
                      
                      ' simulation
                      Dim hit As Long     ' # of simulations larger than stat
                      hit = 0
                      Dim temp As Variant
                      Dim p As Long
                      For p = 1 To iter
                          ' shuffle vect2
                          For i = nn To 2 Step -1
                              j = Application.WorksheetFunction.RandBetween(1, i)   ' random number between 1 and i
                              temp = vect2(i)
                              vect2(i) = vect2(j)
                              vect2(j) = temp
                          Next
                          ' initialize arr0
                          For i = 1 To m
                              For j = 1 To n
                                  arr0(i, j) = 0
                              Next
                          Next
                          ' fill arr0 with new values
                          k = 1
                          For i = 1 To m
                              For kk = 1 To marg(i)
                                  For j = 1 To n
                                      If vect2(k) = clab(j) Then
                                          arr0(i, j) = arr0(i, j) + 1
                                          k = k + 1
                                          Exit For
                                      End If
                                  Next
                              Next
                          Next
                          ' determine whether chi-square statistic exceeds stat
                          If chi Then
                              If CHI_STAT(arr0) >= stat Then hit = hit + 1
                          Else
                              If CHI_MAX(arr0) >= stat Then hit = hit + 1
                          End If
                      Next
                  
                      Dim outp As Variant ' output
                      Dim h As Long
                      If lab Then
                          ReDim outp(1 To 4, 1 To 2)
                          h = 2
                          outp(1, 1) = "p-value"
                          outp(2, 1) = "s.e."
                          outp(3, 1) = "lower"
                          outp(4, 1) = "upper"
                      Else
                          ReDim outp(1 To 4, 1 To 1)
                          h = 1
                      End If
                      
                      Dim zcrit As Double
                      outp(1, h) = hit / iter
                      outp(2, h) = Sqr(outp(1, h) * (1 - outp(1, h)) / iter)
                      zcrit = Application.WorksheetFunction.Norm_S_Inv(1 - alpha / 2)
                      outp(3, h) = outp(1, h) - zcrit * outp(2, h)
                      outp(4, h) = outp(1, h) + zcrit * outp(2, h)
                      
                      CHISQ_SIM = outp
                     
                  End Function
                  
                  Function FIT_TEST(narray As Variant, earray As Variant, Optional par As Long = 0) As Double
                  Attribute FIT_TEST.VB_Description = "returns the p-value for the Pearson's goodness of fit chi-square test"
                  Attribute FIT_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return p-value of Pearson's goodness of fit chi-square test where narray contains a column vector of number of observations
                  ' earray contains a column vector of expected values, and par = # of parameters
                      Dim obs1 As Variant
                      Dim exp1 As Variant
                      obs1 = narray
                      exp1 = earray
                      Dim m As Long
                      m = UBound(obs1, 1)
                      Dim n As Long
                      n = UBound(obs1, 2)
                      stat = fChi_Stat(obs1, exp1)
                      FIT_TEST = CHISQ_DIST_RT(stat, m * n - par - 1)
                  End Function
                  
                  Function WKAPPA(array1 As Variant, Optional arg2 As Variant = 0, Optional lab As Boolean = False, Optional alpha As Double = 0.05) As Variant
                  Attribute WKAPPA.VB_Description = "returns a column array with weighted kappa, std error, lower and upper limits of the 1-alpha confidence interval"
                  Attribute WKAPPA.VB_ProcData.VB_Invoke_Func = " \n25"
                  ' return the weighted kappa value for the range of observations in array1 based on the weights in arg2
                  ' assumes that array1 and arg2 have the same dimensions
                  ' if arg2 is omitted it defaults to the matrix with 0's on the main diagonal and 1's everywhere else
                  ' if arg2 = 1 then use linear weights and if arg2 = 2 then use quadratic weights
                  
                      Dim obs As Variant      ' observations (i.e. array1 as a matrix)
                      obs = array1
                      m = UBound(obs, 1)      ' # of rows in array1 (assumed to be equal to the # of columns in array1)
                      Dim unweighted As Boolean   ' True if arg2 = 0
                      unweighted = False
                      
                      Dim w As Variant        ' weights matrix
                      ReDim w(1 To m, 1 To m)
                      Dim i As Integer        ' row index
                      Dim j As Integer        ' column index
                      
                      Dim exp1 As Variant     ' expectation matrix
                      ReDim exp1(1 To m, 1 To m)
                      Call sChi_Exp(obs, exp1)
                      
                      If IsNumeric(arg2) Then
                          If arg2 = 0 Then
                              unweighted = True
                              For i = 1 To m
                                  For j = 1 To m
                                      w(i, j) = 1
                                  Next
                                  w(i, i) = 0
                              Next
                          Else
                              For i = 1 To m
                                  For j = 1 To m
                                      w(i, j) = (Abs(j - i)) ^ arg2
                                  Next
                              Next
                          End If
                      Else
                          w = arg2
                      End If
                      
                      Dim h As Long
                      h = 1
                      If lab Then h = 2
                      
                      Dim mat As Variant      ' output
                      ReDim mat(1 To 4, 1 To h)
                      Dim kap As Double       ' kappa
                      Dim se As Double        ' s.e.
                      Dim conf As Double      ' margin of error
                      
                      If lab Then
                          mat(1, 1) = "kappa"
                          mat(2, 1) = "std err"
                          mat(3, 1) = "lower"
                          mat(4, 1) = "upper"
                      End If
                  
                      kap = 1 - Application.WorksheetFunction.SumProduct(obs, w) / Application.WorksheetFunction.SumProduct(exp1, w)
                  '    If unweighted Then
                  '        Call sWKappaSE0(obs, kap, se)
                  '    Else
                          Call sWKappaSE(obs, w, kap, se)
                  '    End If
                      conf = Application.WorksheetFunction.Norm_S_Inv(1 - alpha / 2) * se
                      mat(1, h) = kap
                      mat(2, h) = se
                      mat(3, h) = kap - conf
                      mat(4, h) = kap + conf
                      
                      WKAPPA = mat
                  
                  End Function
                  
                  Private Sub sWKappaSE0(obs As Variant, kap As Double, ByRef se As Double)
                      ' find standard error se of unweighted kappa with data in obs and kappa as kap
                      
                      Dim k As Double     ' # rows/columns in mat or w
                      k = UBound(obs, 2)
                      Dim p As Variant    ' marginal row expected probabilities
                      Dim q As Variant    ' marginal column expected probabilities
                      ReDim p(1 To k)
                      ReDim q(1 To k)
                      Dim pe As Double    ' pe
                      Dim n As Long       ' sample size
                      n = Application.WorksheetFunction.Sum(obs)
                      Dim i As Long
                      Dim j As Long
                      Dim totrow As Long
                      Dim totcol As Long
                      
                      pe = 0#
                      For i = 1 To k
                          totrow = 0
                          totcol = 0
                          For j = 1 To k
                              totrow = totrow + obs(i, j)
                              totcol = totcol + obs(j, i)
                          Next
                          p(i) = totrow / n
                          q(i) = totcol / n
                          pe = pe + p(i) * q(i)
                      Next
                      
                      Dim a As Double
                      Dim b As Double
                      Dim c As Double
                      a = 0#
                      b = 0#
                      For i = 1 To k
                          a = a + obs(i, i) / n * (1 - (p(i) + q(i)) * (1 - kap)) ^ 2
                          For j = 1 To k
                              If i <> j Then
                                  b = b + obs(i, j) / n * (p(i) + q(j)) ^ 2
                              End If
                          Next
                      Next
                      b = b * (1 - kap) ^ 2
                      c = (kap - pe * (1 - kap)) ^ 2
                      se = Sqr((a + b - c) / n) / (1 - pe)
                      
                  End Sub
                  
                  Private Sub sWKappaSE(obs As Variant, w As Variant, kap As Double, ByRef se As Double)
                      ' find standard error se of weighted kappa with data in obs and weights in w
                      
                      Dim k As Double     ' # rows/columns in mat or w
                      k = UBound(obs, 2)
                      Dim wmax As Long    ' largest value in w
                      wmax = Application.WorksheetFunction.Max(w)
                      Dim i As Long
                      Dim j As Long
                      
                      Dim v As Variant    ' revised weight matrix
                      ReDim v(1 To k, 1 To k)
                      For i = 1 To k
                          For j = 1 To k
                              v(i, j) = 1 - w(i, j) / wmax
                          Next
                      Next
                      
                      Dim n As Long       ' sample size
                      n = Application.WorksheetFunction.Sum(obs)
                      Dim p As Variant    ' marginal row expected probabilities
                      Dim q As Variant    ' marginal column expected probabilities
                      ReDim p(1 To k)
                      ReDim q(1 To k)
                      Dim totrow As Long
                      Dim totcol As Long
                      
                      For i = 1 To k
                          totrow = 0
                          totcol = 0
                          For j = 1 To k
                              totrow = totrow + obs(i, j)
                              totcol = totcol + obs(j, i)
                          Next
                          p(i) = totrow / n
                          q(i) = totcol / n
                      Next
                      
                      Dim pe As Double    ' pe
                      pe = 0
                      Dim temp As Double
                      Dim tot As Double   ' u(i,j)
                      Dim h As Long       ' index
                      For i = 1 To k
                          For j = 1 To k
                              tot = 0#
                              For h = 1 To k
                                  tot = tot + q(h) * v(i, h) + p(h) * v(h, j)
                              Next
                              temp = temp + obs(i, j) / n * (v(i, j) - tot * (1 - kap)) ^ 2
                              pe = pe + v(i, j) * p(i) * q(j)
                          Next
                      Next
                      
                      se = Sqr((temp - (kap - pe * (1 - kap)) ^ 2) / n) / (1 - pe)
                      
                  End Sub
                  
                  Function BKAPPA_SD(kappa As Double, p1 As Double, q1 As Double) As Double
                  Attribute BKAPPA_SD.VB_Description = "returns the standard deviation for Cohen's kappa with two categories"
                  Attribute BKAPPA_SD.VB_ProcData.VB_Invoke_Func = " \n25"
                  ' returns standard deviation of Cohen's kappa for the stated values of kappa, p1 and q1 in the case of two categories
                  
                      Dim pa As Double
                      Dim pe As Double
                      Dim p2 As Double
                      Dim q2 As Double
                      Dim p11 As Double
                      Dim p12 As Double
                      Dim p21 As Double
                      Dim p22 As Double
                      Dim a As Double
                      Dim b As Double
                      Dim c As Double
                      
                      p2 = 1 - p1
                      q2 = 1 - q1
                      pe = p1 * q1 + p2 * q2
                      pa = pe + kappa * (1 - pe)
                      p22 = (pa - p1 + q2) / 2
                      p11 = pa - p22
                      p12 = p1 - p11
                      p21 = q1 - p11
                      
                    

                  General
                  Stream Path:VBA/Cluster
                  VBA File Name:Cluster
                  Stream Size:75889
                  Data ASCII:. . . . . . . . : . . . . . . . . : . . A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . X 8 . . +
                  Data Raw:01 16 03 00 06 f0 00 00 00 9a 3a 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff dd 3a 00 00 41 e4 00 00 18 00 00 00 01 00 00 00 d4 1f 0c f8 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Cluster"
                  ' Cluster Analysis
                  
                  Function CLUSTERS(darray As Variant, tarray As Variant, Optional p As Double = 2#,     Optional warray As Variant) As Variant
                  Attribute CLUSTERS.VB_Description = "returns an m x 1 array representing the clusters closest to each data point in darray"
                  Attribute CLUSTERS.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' using data in m x n matrix darray and n x k centroid matrix in tarray, output clusters closest to each point in darray as an m x 1 vector
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim tarr
                      tarr = tarray
                      Dim k As Long       ' # of clusters
                      k = UBound(tarr, 2)
                      Dim carr As Variant ' output (cluster vector)
                      ReDim carr(1 To m, 1 To 1)
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                      
                      Call sClusters(darr, tarr, m, n, k, carr, p, warr)
                      
                      CLUSTERS = carr
                  
                  End Function
                  
                  Private Sub sClusters(darr As Variant, tarr As Variant, m As Long, n As Long, k As Long,     carr As Variant, p As Double, warr As Variant)
                  ' using data in m x n matrix darr and n x k centroid matrix tarr, output clusters closest to each point in darr as a m x 1 vector
                  
                      Dim d As Double     ' squared distance from data point to centroid
                      Dim dd As Double    ' min squared distance from data point to centroid
                      Dim hh As Long      ' # of closest centroid
                      
                      Dim i As Long       ' index 1 to m
                      Dim h As Long       ' index 1 to k
                      Dim j As Long       ' index 1 to n
                      
                      For i = 1 To m
                          dd = 0#
                          For j = 1 To n
                              dd = dd + warr(j, 1) * (Abs(darr(i, j) - tarr(j, 1))) ^ p
                          Next
                          hh = 1
                          For h = 2 To k
                              d = 0#
                              For j = 1 To n
                                  d = d + warr(j, 1) * (Abs(darr(i, j) - tarr(j, h))) ^ p
                              Next
                              If d < dd Then
                                  dd = d
                                  hh = h
                              End If
                          Next
                          carr(i, 1) = hh
                      Next
                  
                  End Sub
                  
                  Private Sub sCentroids(darr As Variant, carr As Variant, m As Long, n As Long, k As Long, tarr As Variant)
                  ' using data in m x n matrix darr, m x 1 clusters vector carr and k = # of clusters, output tarr an n x k centroids matrix c
                          
                      Dim i As Long
                      Dim h As Long
                      Dim j As Long
                      Dim nn As Long
                      Dim temp As Double
                      Dim huge As Double
                      huge = 1E+300
                      
                      For h = 1 To k
                          For j = 1 To n
                              temp = 0#
                              nn = 0
                              For i = 1 To m
                                  If carr(i, 1) = h Then
                                      temp = temp + darr(i, j)
                                      nn = nn + 1
                                  End If
                              Next
                              If nn > 0 Then
                                  tarr(j, h) = temp / nn
                              Else
                                  tarr(j, h) = huge
                              End If
                          Next
                      Next
                  
                  End Sub
                  
                  Private Sub sClusterErr(darr As Variant, carr As Variant, m As Long, n As Long, k As Long,     p As Double, warr As Variant, ByRef e As Double)
                  ' using data in m x n matrix darr, m x 1 clusters vector b and k = # of clusters
                  ' output sum of errors (SSE when p = 2) value e
                  
                      Dim tarr As Variant    ' centroid matrix
                      ReDim tarr(1 To n, 1 To k)
                      Call sCentroids(darr, carr, m, n, k, tarr)
                      Call sCentroidErr(darr, tarr, m, n, k, p, warr, e)
                  
                  End Sub
                  
                  Private Sub sCentroidErr(darr As Variant, tarr As Variant, m As Long, n As Long,     k As Long, p As Double, warr As Variant, ByRef e As Double)
                  ' using data in m x n matrix darr, n x k centroid matrix tarr and k = # of clusters
                  ' output sum of errors (SSE when p = 2) value e
                  
                      Dim d As Double         ' squared distance from data point to centroid
                      Dim dd As Double        ' min squared distance from data point to centroid
                      
                      Dim i As Long           ' index 1 to m
                      Dim h As Long           ' index 1 to k
                      Dim j As Long           ' index 1 to n
                  
                      e = 0#
                      For i = 1 To m
                          dd = 0#
                          For j = 1 To n
                              dd = dd + warr(j, 1) * (Abs(darr(i, j) - tarr(j, 1))) ^ p
                          Next
                          For h = 2 To k
                              d = 0#
                              For j = 1 To n
                                  d = d + warr(j, 1) * (Abs(darr(i, j) - tarr(j, h))) ^ p
                              Next
                              If d < dd Then dd = d
                          Next
                          e = e + dd
                      Next
                  
                  End Sub
                  
                  Function CENTROIDS(darray As Variant, carray As Variant) As Variant
                  Attribute CENTROIDS.VB_Description = "returns an n x k centroid matrix where k = # of clusters"
                  Attribute CENTROIDS.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' using data in m x n data matrix darray, m x 1 clusters vector in carray and k = # of clusters, output centroids matrix as a n x k range
                  
                      Dim k As Long       ' # of clusters
                      If IsNumeric(carray) Then
                          k = carray
                          CENTROIDS = INIT_CENTROIDS(darray, k)
                          Exit Function
                      End If
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      
                      k = Application.WorksheetFunction.Max(carray)
                      If k > 100 Then
                          CENTROIDS = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      Dim carr As Variant
                      carr = carray
                      Dim tarr As Variant    ' output array (centroid matrix)
                      ReDim tarr(1 To n, 1 To k)
                      Call sCentroids(darr, carr, m, n, k, tarr)
                     
                      CENTROIDS = tarr
                  
                  End Function
                  
                  Private Function EqVect(c1 As Variant, c2 As Variant, m As Long) As Boolean
                  ' return True if vectors c1 = c2
                  
                      Dim i As Long
                      For i = 1 To m
                          If c1(i, 1) <> c2(i, 1) Then
                              EqVect = False
                              Exit Function
                          End If
                      Next
                      EqVect = True
                      
                  End Function
                  
                  Function CLUST_Converge(darray As Variant, carray As Variant, Optional p As Double = 2#,     Optional warray As Variant) As Boolean
                  Attribute CLUST_Converge.VB_Description = "returns TRUE if the algorithm converges (i.e. further iterations do not change cluster assignments"
                  Attribute CLUST_Converge.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' return True if the the cluster algorithm has converged for the data in darray and thre resulting cluster carray
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long           ' # of subjects
                      Dim n As Long           ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim carr1 As Variant
                      carr1 = carray
                      Dim k As Long
                      k = WorksheetFunction.Max(carr1)
                      Dim tarr As Variant     ' matrix of centroids
                      ReDim tarr(1 To n, 1 To k)
                      Dim carr2 As Variant
                      ReDim carr2(1 To m, 1 To 1)
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                      
                      Call sCentroids(darr, carr1, m, n, k, tarr)
                      Call sClusters(darr, tarr, m, n, k, carr2, p, warr)
                      CLUST_Converge = EqVect(carr1, carr2, m)
                          
                  End Function
                  
                  Function CLUSTAnal(darray As Variant, k As Long, Optional NREP As Long = 40, Optional p As Double = 2#,     Optional warray As Variant, Optional iter As Long = 200) As Variant
                  Attribute CLUSTAnal.VB_Description = "returns an m x 1 array with cluster values resulting from the kmeans++ cluster analysis"
                  Attribute CLUSTAnal.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' output from cluster analysis, an m x 1 vector of cluster numbers, on the data in m x n matrix darray
                  ' where k = # of clusters using kmeans++ algorithm
                  
                      If NREP = 0 Then
                          CLUSTAnal = INIT_CLUSTERS(darray, k, p, warray)
                          Exit Function
                      End If
                      
                      Dim darr
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                  
                      Dim carr As Variant ' cluster vector
                      ReDim carr(1 To m, 1 To 1)
                      Dim barr As Variant   ' best cluster vector
                      ReDim barr(1 To m, 1 To 1)
                      Dim e As Double     ' sum of errors
                      Dim ee As Double    ' best sum of errors (i.e. lowest)
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                  
                      barr = CLUST(darr, k, , p, warray, iter)
                      Call sClusterErr(darr, barr, m, n, k, p, warr, ee)
                      
                      Dim h As Long
                      For h = 2 To NREP
                          carr = CLUST(darr, k, , p, warray, iter)
                          Call sClusterErr(darr, carr, m, n, k, p, warr, e)
                          If e < ee Then
                              ee = e
                              barr = carr
                          End If
                      Next
                      
                      CLUSTAnal = barr
                      
                  End Function
                  
                  Function CLUST(darray As Variant, Optional k As Long = 0, Optional carray As Variant,     Optional p As Double = 2#, Optional warray As Variant, Optional iter As Long = 200) As Variant
                  Attribute CLUST.VB_Description = "returns an m x 1 array with cluster values resulting from the cluster analysis"
                  Attribute CLUST.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' output from cluster analysis, an m x 1 vector of cluster numbers, on the data in m x n matrix darray
                  ' where k = # of clusters using kmeans++ algorithm unless carray is present (in which use carray as initial cluster values)
                  ' iter = the # of iterations
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long           ' # of subjects
                      Dim n As Long           ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim j As Long
                      Dim carr1 As Variant    ' vector of cluster numbers (1 to k)
                      
                      If IsMissing(carray) Then
                          ReDim carr1(1 To m, 1 To 1)
                      Else
                          carr1 = carray
                          If k = 0 Then k = WorksheetFunction.Max(carr1)
                      End If
                      
                      Dim tarr As Variant     ' matrix of centroids obtained from kmeans++ algorthm
                      ReDim tarr(1 To n, 1 To k)
                      Dim carr2 As Variant    ' vector of cluster numbers (1 to k)
                      ReDim carr2(1 To m, 1 To 1)
                      
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                      
                      If IsMissing(carray) Then
                          Call sInitCentroids(darr, m, n, k, p, warr, tarr)
                      Else
                          Call sCentroids(darr, carr1, m, n, k, tarr)
                      End If
                      Call sClusters(darr, tarr, m, n, k, carr1, p, warr)
                      
                      For j = 2 To iter
                          Call sCentroids(darr, carr1, m, n, k, tarr)
                          Call sClusters(darr, tarr, m, n, k, carr2, p, warr)
                          If EqVect(carr1, carr2, m) Then Exit For
                          carr1 = carr2
                      Next
                      
                      CLUST = carr2
                  
                  End Function
                  
                  Function CLUSTErr(darray As Variant, carray As Variant, Optional k As Long = 0,     Optional p As Double = 2#, Optional warray As Variant) As Double
                  Attribute CLUSTErr.VB_Description = "returns error statistic for cluster analysis (SSE when p = 2)"
                  Attribute CLUSTErr.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' output sum of errors (SSE when p = 2) for data in m x n darray and m x 1 cluster vector carray
                      
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim carr As Variant
                      carr = carray
                      If k = 0 Then k = WorksheetFunction.Max(carr)
                      Dim e As Double     ' output
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                      
                      Call sClusterErr(darr, carr, m, n, k, p, warr, e)
                      CLUSTErr = e
                      
                  End Function
                  
                  Function CENTROIDErr(darray As Variant, tarray As Variant, Optional p As Double = 2#,     Optional warray As Variant) As Double
                  Attribute CENTROIDErr.VB_Description = "returns error statistic for cluster analysis (SSE when p = 2)"
                  Attribute CENTROIDErr.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' output sum of errors (SSE when p = 2) for data in m x n matrix darray and n x k centroid matrix tarray
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      Dim k As Long       ' # of clusters
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim tarr As Variant
                      tarr = tarray
                      k = UBound(tarr, 2)
                      Dim e As Double
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                  
                      Call sCentroidErr(darr, tarr, m, n, k, p, warr, e)
                      CENTROIDErr = e
                  
                  End Function
                  
                  Private Function INIT_CENTROIDS(darray As Variant, k As Long, Optional p As Double = 2#,     Optional warray As Variant) As Variant
                  ' initialize cluster analysis, where darray is the data range, k = # of clusters
                  ' output is a n x k centroid matrix; use k-means++ approach
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long       ' # of subjects
                      Dim n As Long       ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      
                      Dim tarr As Variant     ' matrix of cluster centers
                      ReDim tarr(1 To n, 1 To k)
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                      
                      Call sInitCentroids(darr, m, n, k, p, warr, tarr)
                  
                      INIT_CENTROIDS = tarr
                  
                  End Function
                  
                  Private Function INIT_CLUSTERS(darray As Variant, k As Long, Optional p As Double = 2#,     Optional warray As Variant) As Variant
                  ' initialize cluster analysis, where darray is the data matrix, k = # of clusters
                  ' output is an m x 1 cluster vector; use k-means++ approach
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long           ' # of subjects
                      Dim n As Long           ' # of dimensions
                      m = UBound(darr, 1)
                      n = UBound(darr, 2)
                      Dim carr As Variant    ' output (cluster column vector)
                      ReDim carr(1 To m, 1 To 1)
                      Dim tarr As Variant    ' centroid matrix
                      ReDim tarr(1 To n, 1 To k)
                      
                      Dim j As Long
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          ReDim warr(1 To n, 1 To 1)
                          For j = 1 To n
                              warr(j, 1) = 1#
                          Next
                      Else
                          warr = warray
                      End If
                  
                      tarr = INIT_CENTROIDS(darr, k, p, warr)
                      Call sClusters(darr, tarr, m, n, k, carr, p, warr)
                  
                      INIT_CLUSTERS = carr
                      
                  End Function
                  
                  Private Sub sInitCentroids(darr As Variant, m As Long, n As Long, k As Long,     p As Double, warr As Variant, tarr As Variant)
                  ' initialize n x k centroids (cluster centers) tarr using K-means++ algorithm
                  ' darr is m x n data matrix
                      
                      Dim i As Long
                      Dim h As Long
                      Dim j As Long
                      Dim r As Double
                      Dim temp As Double
                      
                      Dim big As Double   ' large positive number
                      big = 100000000000#
                      
                      Dim indx() As Long      ' index to point i corresponding to darr(i, -)
                      ReDim indx(1 To k)
                      
                      ' pick first point at random from original data
                      i = Application.WorksheetFunction.RandBetween(1, m)
                      indx(1) = i
                      For j = 1 To n
                          tarr(j, 1) = darr(i, j)
                      Next
                      
                      Dim d() As Double       ' distance of each data point to closest cluster center point already chosen
                      ReDim d(1 To m)
                      Dim dd As Double        ' total of all the values in d()
                      
                      For i = 1 To m
                          d(i) = big
                      Next
                      
                      For h = 1 To k - 1
                          dd = 0#
                          For i = 1 To m
                              temp = 0#
                              For j = 1 To n
                                  temp = temp + warr(j, 1) * (Abs(darr(i, j) - tarr(j, h))) ^ p
                              Next
                              If temp < d(i) Then d(i) = temp
                              dd = dd + d(i)
                          Next
                          r = Rnd()
                          temp = 0#
                          For i = 1 To m
                              temp = temp + d(i)
                              If r < temp Then
                                  indx(2) = i
                                  For j = 1 To n
                                      tarr(j, h + 1) = darr(i, j)
                                  Next
                                  Exit For
                              End If
                          Next
                      Next
                      
                  End Sub
                  
                  Sub RunCluster(rg As Range, ce As Range, rgc As Range, rgw As Range, k As Long, iter As Long,     NREP As Long, p As Double, head As Boolean)
                  ' perform cluster analysis using k-means++ algorithm
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim i As Long       ' loop index
                      Dim rg0 As Range    ' rg w/o column heading
                      Dim rg1 As Range    ' used for formating
                      Dim rg2 As Range    ' used for formatting
                      Dim ce1 As Range    ' cell which contains k value
                      
                      Dim m As Long       ' # of data rows in rg
                      m = rg.Rows.Count
                      Dim n As Long       ' # of columns in rg
                      n = rg.Columns.Count
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                      
                      ' set rg based on whether b = True
                      If head Then
                          m = m - 1
                          Set rg0 = rg.Cells(2, 1).Resize(m, n)
                      Else
                          Set rg0 = rg
                      End If
                      
                      ' numbering of data points
                      ce.Offset(1, 0).Value = 1
                      ce.Offset(2, 0).Formula = "=" & ce.Offset(1, 0).Address(False, False) & "+1"
                      If m > 2 Then
                          Set rg1 = ce.Offset(2, 0).Resize(m - 1, 1)
                          rg1.FillDown
                      End If
                      
                      ' cell labels and set cells containing k, p, nrep values
                      ce.Offset(0, 1).HorizontalAlignment = xlCenter
                      ce.Offset(0, 1).Value = "Cluster"
                      ce.Offset(0, 3).Value = "Centroid"
                      
                      ' k = # of clusters
                      Set ce1 = ce.Offset(n + 2, 4)
                      ce1.Offset(0, -1).Value = "# of clusters"
                      ce1.Value = k
                      ce1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' p
                      ce1.Offset(2, -1).Value = "Minkowski p"
                      ce1.Offset(2, 0).Value = p
                      ce1.Offset(2, 0).BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' nrep = # of runs
                      ce1.Offset(4, -1).Value = "# of runs"
                      ce.Offset(4, 0).HorizontalAlignment = xlRight
                      If rgc Is Nothing Then
                          ce1.Offset(4, 0).Value = NREP
                      Else
                          ce1.Offset(4, 0).HorizontalAlignment = xlCenter
                          ce1.Offset(4, 0).Value = "N/A"
                      End If
                      ce1.Offset(4, 0).BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' final cluster values
                      Set rg1 = ce.Offset(1, 1).Resize(m, 1)
                      If rgc Is Nothing Then
                          If rgw Is Nothing Then
                              rg1.FormulaArray = "=CLUSTAnal(" & s & rg0.Address(False, False) & "," & ce1.Address(False, False) & "," &                 ce1.Offset(4, 0).Address(False, False) & "," & ce1.Offset(2, 0).Address(False, False) & ",," &                 ce1.Offset(6, 0).Address(False, False) & ")"
                          Else
                              rg1.FormulaArray = "=CLUSTAnal(" & s & rg0.Address(False, False) & "," & ce1.Address(False, False) & "," &                 ce1.Offset(4, 0).Address(False, False) & "," & ce1.Offset(2, 0).Address(False, False) & "," &                 s & rgw.Address(False, False) & "," & ce1.Offset(6, 0).Address(False, False) & ")"
                          End If
                      Else
                          If rgw Is Nothing Then
                              rg1.FormulaArray = "=CLUST(" & s & rg0.Address(False, False) & "," & ce1.Address(False, False) & "," &                 s & rgc.Address(False, False) & "," & ce1.Offset(2, 0).Address(False, False) & ",," &                 ce1.Offset(6, 0).Address(False, False) & ")"
                          Else
                              rg1.FormulaArray = "=CLUST(" & s & rg0.Address(False, False) & "," & ce1.Address(False, False) & "," &                 s & rgc.Address(False, False) & "," & ce1.Offset(2, 0).Address(False, False) & "," &                 s & rgw.Address(False, False) & "," & ce1.Offset(6, 0).Address(False, False) & ")"
                          End If
                      End If
                      rg1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' row headings for ce

                  General
                  Stream Path:VBA/Color
                  VBA File Name:Color
                  Stream Size:37220
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . U q . . . . . . . . . . . ' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . @ . . . +
                  Data Raw:01 16 03 00 06 f0 00 00 00 82 1b 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff c5 1b 00 00 55 71 00 00 12 00 00 00 01 00 00 00 d4 1f 27 fd 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Color"
                  ' Color
                  
                  Function FillRGB(rg As Range) As Long
                  Attribute FillRGB.VB_Description = "returns the RGB value for the fill color of rg"
                  Attribute FillRGB.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the RGB value for the fill color of range rg
                      FillRGB = rg.Interior.Color
                  End Function
                  
                  Function FontRGB(rg As Range) As Long
                  Attribute FontRGB.VB_Description = "returns the RGB value for the font color of rg"
                  Attribute FontRGB.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the RGB value for the font color of range rg
                      FontRGB = rg.Font.Color
                  End Function
                  
                  Function BlueRGB(rgb1 As Long) As Long
                  Attribute BlueRGB.VB_Description = "returns the Blue RGB value (0-255) for the RGB code n"
                  Attribute BlueRGB.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the Red RGB value for the RGB code rgb1
                      Dim n As Long
                      n = rgb1 \ 256
                      BlueRGB = n \ 256
                  End Function
                  
                  Function GreenRGB(rgb1 As Long) As Long
                  Attribute GreenRGB.VB_Description = "returns the Green RGB value (0-255) for the RGB code n"
                  Attribute GreenRGB.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the Green RGB value for the RGB code rgb1
                      Dim n As Long
                      n = rgb1 \ 256
                      GreenRGB = n Mod 256
                  End Function
                  
                  Function RedRGB(rgb1 As Long) As Long
                  Attribute RedRGB.VB_Description = "returns the Red RGB value (0-255) for the RGB code n"
                  Attribute RedRGB.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the Red RGB value for the RGB code rgb1
                      RedRGB = rgb1 Mod 256
                  End Function
                  
                  Function Convert2Grey(rgb1 As Long) As Long
                  Attribute Convert2Grey.VB_Description = "returns the equivalent greyscale code (0-255)"
                  Attribute Convert2Grey.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' return greyscale version the RGB code rgb1
                  
                      Dim n As Long
                      Dim red As Long
                      Dim green As Long
                      Dim blue As Long
                      red = rgb1 Mod 256
                      n = rgb1 \ 256
                      green = n Mod 256
                      blue = n \ 256
                      Convert2Grey = 0.299 * red + 0.587 * green + 0.114 * blue
                  
                  End Function
                  
                  Function IsBold(rg As Range) As Boolean
                  Attribute IsBold.VB_Description = "TRUE if all the cells in rg are bold; FALSE otherwise"
                  Attribute IsBold.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns TRUE if rg is bold
                      IsBold = rg.Font.Bold
                  End Function
                  
                  Function RGBCode(s As String) As Long
                  Attribute RGBCode.VB_Description = "returns the RGB code for the specified color"
                  Attribute RGBCode.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' returns the RGB code of named colors
                  
                      Dim i As Long
                      Dim c(1 To 66) As String    ' contains color names
                      Dim d(1 To 66) As Long      ' contains RGB color codes
                      
                      c(1) = "white"
                      c(2) = "black"
                      c(3) = "red"
                      c(4) = "green"
                      c(5) = "blue"
                      c(6) = "yellow"
                      c(7) = "purple"
                      c(8) = "orange"
                      c(9) = "grey"
                      c(10) = "cyan"
                      c(11) = "navy"
                      c(12) = "olive"
                      c(13) = "pink"
                      c(14) = "silver"
                      c(15) = "brown"
                      c(16) = "lime"
                      c(17) = "magenta"
                      c(18) = "maroon"
                      c(19) = "salmon"
                      c(20) = "turquoise"
                      c(21) = "teal"
                      c(22) = "tan"
                      c(23) = "gold"
                      c(24) = "beige"
                      c(25) = "crimson"
                      c(26) = "tomato"
                      c(27) = "khaki"
                      c(28) = "lavender"
                      c(29) = "violet"
                      c(30) = "indigo"
                      c(31) = "sky"
                      c(32) = "chocolate"
                      c(33) = "saddle"
                      c(34) = "amber"
                      c(35) = "amethyst"
                      c(36) = "aquamarine"
                      c(37) = "asparagus"
                      c(38) = "azure"
                      c(39) = "bone"
                      c(40) = "brass"
                      c(41) = "bronze"
                      c(42) = "camel"
                      c(43) = "charcoal"
                      c(44) = "chartreuse"
                      c(45) = "cherry"
                      c(46) = "coffee"
                      c(47) = "coral"
                      c(48) = "corn"
                      c(49) = "emerald"
                      c(50) = "forest"
                      c(51) = "jade"
                      c(52) = "mahogany"
                      c(53) = "mauve"
                      c(54) = "mint"
                      c(55) = "mustard"
                      c(56) = "pear"
                      c(57) = "pumpkin"
                      c(58) = "rose"
                      c(59) = "rust"
                      c(60) = "sand"
                      c(61) = "sepia"
                      c(62) = "sienna"
                      c(63) = "tangerine"
                      c(64) = "taupe"
                      c(65) = "topaz"
                      c(66) = "vermilion"
                      
                      d(1) = 16777215
                      d(2) = 0
                      d(3) = 255
                      d(4) = 32768
                      d(5) = 16711680
                      d(6) = 65535
                      d(7) = 8388736
                      d(8) = 42495
                      d(9) = 8421504
                      d(10) = 16776960
                      d(11) = 8388608
                      d(12) = 32896
                      d(13) = 13353215
                      d(14) = 12632256
                      d(15) = 1262987
                      d(16) = 65280
                      d(17) = 16711935
                      d(18) = 128
                      d(19) = 7504122
                      d(20) = 13688896
                      d(21) = 8421376
                      d(22) = 9221330
                      d(23) = 55295
                      d(24) = 14480885
                      d(25) = 3937500
                      d(26) = 4678655
                      d(27) = 9234160
                      d(28) = 16443110
                      d(29) = 15631086
                      d(30) = 8519755
                      d(31) = 15453831
                      d(32) = 1993170
                      d(33) = 1262987
                      d(34) = 49151
                      d(35) = 13395609
                      d(36) = 13959039
                      d(37) = 7055751
                      d(38) = 16744192
                      d(39) = 13228771
                      d(40) = 4368053
                      d(41) = 3309517
                      d(42) = 7051969
                      d(43) = 5195062
                      d(44) = 65407
                      d(45) = 6500830
                      d(46) = 3624559
                      d(47) = 5275647
                      d(48) = 6155515
                      d(49) = 7915600
                      d(50) = 2263842
                      d(51) = 7055360
                      d(52) = 16576
                      d(53) = 16756960
                      d(54) = 9024574
                      d(55) = 5823487
                      d(56) = 3269329
                      d(57) = 1603071
                      d(58) = 8323327
                      d(59) = 934327
                      d(60) = 8434370
                      d(61) = 1327728
                      d(62) = 1518984
                      d(63) = 34290
                      d(64) = 3292232
                      d(65) = 8177919
                      d(66) = 3424995
                  
                      For i = 1 To 66
                          If c(i) = s Then
                              RGBCode = d(i)
                              Exit Function
                          End If
                      Next
                      
                      If s = "gray" Then
                          RGBCode = d(9)
                      ElseIf left(s, 4) = "grey" Then
                          i = Mid(s, 5)
                          RGBCode = i * (256 ^ 2 + 256 + 1)
                      Else
                          RGBCode = -1
                      End If
                      
                  End Function
                  
                  Private Function GetColor(n As Long, approx As Long) As String
                  ' returns the name of the color with RGB code of n
                  ' if approx <> 0, then an exact match is not necessary
                  
                      Dim i As Long
                      Dim c(1 To 66) As String    ' contains color names
                      Dim d(1 To 66) As Long      ' contains RGB color codes
                      
                      c(1) = "white"
                      c(2) = "black"
                      c(3) = "red"
                      c(4) = "green"
                      c(5) = "blue"
                      c(6) = "yellow"
                      c(7) = "purple"
                      c(8) = "orange"
                      c(9) = "grey"
                      c(10) = "cyan"
                      c(11) = "navy"
                      c(12) = "olive"
                      c(13) = "pink"
                      c(14) = "silver"
                      c(15) = "brown"
                      c(16) = "lime"
                      c(17) = "magenta"
                      c(18) = "maroon"
                      c(19) = "salmon"
                      c(20) = "turquoise"
                      c(21) = "teal"
                      c(22) = "tan"
                      c(23) = "gold"
                      c(24) = "beige"
                      c(25) = "crimson"
                      c(26) = "tomato"
                      c(27) = "khaki"
                      c(28) = "lavender"
                      c(29) = "violet"
                      c(30) = "indigo"
                      c(31) = "sky"
                      c(32) = "chocolate"
                      c(33) = "saddle"
                      c(34) = "amber"
                      c(35) = "amethyst"
                      c(36) = "aquamarine"
                      c(37) = "asparagus"
                      c(38) = "azure"
                      c(39) = "bone"
                      c(40) = "brass"
                      c(41) = "bronze"
                      c(42) = "camel"
                      c(43) = "charcoal"
                      c(44) = "chartreuse"
                      c(45) = "cherry"
                      c(46) = "coffee"
                      c(47) = "coral"
                      c(48) = "corn"
                      c(49) = "emerald"
                      c(50) = "forest"
                      c(51) = "jade"
                      c(52) = "mahogany"
                      c(53) = "mauve"
                      c(54) = "mint"
                      c(55) = "mustard"
                      c(56) = "pear"
                      c(57) = "pumpkin"
                      c(58) = "rose"
                      c(59) = "rust"
                      c(60) = "sand"
                      c(61) = "sepia"
                      c(62) = "sienna"
                      c(63) = "tangerine"
                      c(64) = "taupe"
                      c(65) = "topaz"
                      c(66) = "vermilion"
                      
                      d(1) = 16777215
                      d(2) = 0
                      d(3) = 255
                      d(4) = 32768
                      d(5) = 16711680
                      d(6) = 65535
                      d(7) = 8388736
                      d(8) = 42495
                      d(9) = 8421504
                      d(10) = 16776960
                      d(11) = 8388608
                      d(12) = 32896
                      d(13) = 13353215
                      d(14) = 12632256
                      d(15) = 1262987
                      d(16) = 65280
                      d(17) = 16711935
                      d(18) = 128
                      d(19) = 7504122
                      d(20) = 13688896
                      d(21) = 8421376
                      d(22) = 9221330
                      d(23) = 55295
                      d(24) = 14480885
                      d(25) = 3937500
                      d(26) = 4678655
                      d(27) = 9234160
                      d(28) = 16443110
                      d(29) = 15631086
                      d(30) = 8519755
                      d(31) = 15453831
                      d(32) = 1993170
                      d(33) = 1262987
                      d(34) = 49151
                      d(35) = 13395609
                      d(36) = 13959039
                      d(37) = 7055751
                      d(38) = 16744192
                      d(39) = 13228771
                      d(40) = 4368053
                      d(41) = 3309517
                      d(42) = 7051969
                      d(43) = 5195062
                      d(44) = 65407
                      d(45) = 6500830
                      d(46) = 3624559
                      d(47) = 5275647
                      d(48) = 6155515
                      d(49) = 7915600
                      d(50) = 2263842
                      d(51) = 7055360
                      d(52) = 16576
                      d(53) = 16756960
                      d(54) = 9024574
                      d(55) = 5823487
                      d(56) = 3269329
                      d(57) = 1603071
                      d(58) = 8323327
                      d(59) = 934327
                      d(60) = 8434370
                      d(61) = 1327728
                      d(62) = 1518984
                      d(63) = 34290
                      d(64) = 3292232
                      d(65) = 8177919
                      d(66) = 3424995
                         
                      ' the following are only used if approx <> 0                                                                                           <
                      Dim ibest As Long   ' i value of the best fit
                      Dim dmin As Long    ' closest RGB distance
                      Dim dist As Long    ' distance between n and d(i)
                      Dim r As Long       ' red component of n
                      Dim g As Long       ' green component of n
                      Dim b As Long       ' blue component of n
                      Dim rr As Long      ' red component of d(i)
                      Dim gg As Long      ' green component of d(i)
                      Dim bb As Long      ' blue component of d(i)
                      Dim rgb1 As Long    ' d(i)
                      
                      If approx <> 0 Then
                          r = n Mod 256
                          n = n \ 256
                          g = n Mod 256
                          b = n \ 256
                          dmin = 20000000  ' high value, bigger than white
                          For i = 1 To 66
                              rgb1 = d(i)
                              rr = rgb1 Mod 256
                              rgb1 = rgb1 \ 256
                              gg = rgb1 Mod 256
                              bb = rgb1 \ 256
                              If r + rr < 256 Then
                                  dist = 2 * (r - rr) ^ 2 + 4 * (g - gg) ^ 2 + 3 * (b - bb) ^ 2
                              Else
                                  dist = 3 * (r - rr) ^ 2 + 4 * (g - gg) ^ 2 + 2 * (b - bb) ^ 2
                              End If
                              If dist < dmin Then
                                  If dist > 0 Or approx < 0 Then
                                      dmin = dist
                                      ibest = i
                                  End If
                              End If
                          Next
                          GetColor = c(ibest)
                      Else
                          For i = 1 To 66
                              If d(i) = n Then
                                  GetColor = c(i)
                                  Exit Function
                              End If
                          Next
                          i = 256 ^ 2 + 256 + 1
                          If n Mod i = 0 Then
                              i = n \ i
                              GetColor = "grey" & i
                          Else
                              GetColor = "unknown"
                          End If
                      End If
                      
                  End Function
                  
                  Function FillColor(rg As Range, Optional approx As Long = 0) As String
                  Attribute FillColor.VB_Description = "returns the name of the fill color in range rg; if not one of the named colors then unknown is returned"
                  Attribute FillColor.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' return name of the fill color of range rg
                      FillColor = GetColor(FillRGB(rg), approx)
                  End Function
                  
                  Function FontColor(rg As Range, Optional approx As Long = 0) As String
                  Attribute FontColor.VB_Description = "returns the name of the font color in range rg; if not one of the named colors then 'unknown' is returned"
                  Attribute FontColor.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' return name of the font color of range rg
                      FontColor = GetColor(FontRGB(rg), approx)
                  End Function
                  
                  Function ColorDistSq(s1 As String, s2 As String, Optional ttype As Long = 0) As Double
                  Attribute ColorDistSq.VB_Description = "returns the squared distance between the two named colors"
                  Attribute ColorDistSq.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' return the distance between two named colors
                      ColorDistSq = RGBDistSq(RGBCode(s1), RGBCode(s2), ttype)
                  End Function
                  
                  Function RGBDistSq(rgb1 As Long, rgb2 As Long, Optional ttype As Long = 0) As Double
                  Attribute RGBDistSq.VB_Description = "returns the squared distance between the two RGB color values"
                  Attribute RGBDistSq.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' return the distance between two named colors
                  
                      Dim r1 As Long
                      Dim r2 As Long
                      Dim g1 As Long
                      Dim g2 As Long
                      Dim b1 As Long
                      Dim b2 As Long
                      Dim n As Long
                      
                      n = rgb1
                      r1 = n Mod 256
                      n = n \ 256
                      g1 = n Mod 256
                      b1 = n \ 256
                      
                      n = rgb2
                      r2 = n Mod 256
                      n = n \ 256
                      g2 = n Mod 256
                      b2 = n \ 256
                      
                      If ttype = 1 Then
                          RGBDistSq = (r1 - r2) ^ 2 + (g1 - g2) ^ 2 + (b1 - b2) ^ 2
                      ElseIf ttype = -1 Then
                          RGBDist = ((r1 - r2) * 0.299) ^ 2 + ((g1 - g2) * 0.587) ^ 2 + ((b1 - b2) * 0.114) ^ 2
                      Else
                          If r1 + r2 < 256 Then
                              RGBDistSq = 3 * (r1 - r2) ^ 2 + 4 * (g1 - g2) ^ 2 + 2 * (b1 - b2) ^ 2
                          Else
                              RGBDistSq = 2 * (r1 - r2) ^ 2 + 4 * (g1 - g2) ^ 2 + 3 * (b1 - b2) ^ 2
                          End If
                      End If
                  
                  End Function
                  
                  Sub RunColor(rg As Range, ce As Range)
                  ' fill in a range starting at location ce (or the same dimensions as rg)
                  ' with the colors corresponding to the range rg containing RGB codes
                  
                      On Error GoTo errorHandler
                      
                      Dim m As Long           ' # of rows in input range rg
                      m = rg.Rows.Count
                      Dim n As Long           ' # of columns in input range rg
                      n = rg.Columns.Count
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To m
                          For j = 1 To n
                              ce.Cells(i, j).Interior.Color = rg.Cells(i, j).Value
                          Next
                      Next
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  End Sub
                  
                  Sub RunPaint(rg As Range, rg1 As Range, p As Long, Compact As Boolean, greyscale As Boolean)
                  ' creates a greyscale image in rg1 based on the data in rg
                  ' if compact = TRUE then compact format is used in rg
                  
                      On Error GoTo errorHandler
                  
                      Dim m As Long
                      Dim n As Long
                      Dim r As Long
                      If greyscale Then
                          r = 256 ^ 2 + 256 + 1
                      Else
                          r = 1
                      End If
                      Dim arr As Variant
                      
                      Dim ce As Range
                      Set ce = rg1.Cells(1, 1)
                      
                      Dim mm As Long
                      Dim nn As Long
                      mm = rg1.Rows.Count
                      nn = rg1.Columns.Count
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim kk As Long
                      Dim h As Double
                      
                      If p >= 18 Then
                          rg1.ColumnWidth = (p - 7) / 11
                      Else
                          rg1.ColumnWidth = p / 18
                      End If
                      h = p / 2
                      
                      If Not rg Is Nothing Then
                          If Not Compact Then
                              m = rg.Rows.Count
                              n = rg.Columns.Count
                              For k = 1 To m
                                  kk = 1
                                  arr = rg.Rows(k)
                                  rg1.RowHeight = h
                                  For i = 1 To mm
                                      For j = 1 To nn
                                          ce.Cells(i, j).Interior.Color = r * arr(1, kk)
                                          kk = kk + 1
                                      Next
                                  Next
                                  Set ce = ce.Offset(mm + 1)
                                  Set rg1 = ce.Resize(mm, nn)
                              Next
                          Else
                              arr = rg
                              For i = 1 To mm
                                  ce.Cells(i, 1).RowHeight = h
                                  For j = 1 To nn
                                      ce.Cells(i, j).Interior.Color = r * arr(i, j)
                                      kk = kk + 1
                                  Next
                              Next
                          End If
                      Else
                          For i = 1 To mm
                              ce.Cells(i, 1).RowHeight = h
                              For j = 1 To nn
                                  ce.Cells(i, j).Interior.Color = 0
                              Next
                          Next
                      End If
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  End Sub
                  
                  Sub RunScan(rg As Range, ce As Range, height As Long, width As Long, onerow As Boolean, greyscale As Boolean)
                  ' stores the RGB codes for the image in rg starting in cell ce
                  ' if onerow = TRUE then output a row array; otherwise output a height x width array
                  ' compress the image if necessary
                  
                      On Error GoTo errorHandler
                      
                      ' handle case where output is on a different worksheet from input
                  '    Dim s As String
                  '   s = ""
                  '    If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                      
                      Dim rg1 As Range
                      If onerow Then
                          Set rg1 = ce.Resize(1, height * width)
                      Else
                          Set rg1 = ce.Resize(height, width)
                      End If
                      
                      rg1 = CodeImage(rg, height, width, onerow, greyscale)
                      
                  '    rg1.FormulaArray = "=CodeImage(" & s & rg.Address(False, False) & "," & height & "," & width & "," &         onerow & "," & greyscale & ")"
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  End Sub
                  
                  Function CodeImage(rg As Range, height As Long, width As Long, Optional onerow As Boolean = False,     Optional greyscale As Boolean = False) As Variant
                  Attribute CodeImage.VB_Description = "returns coding of fill colors of the cells in rg; compressed to height x width if necessary"
                  Attribute CodeImage.VB_ProcData.VB_Invoke_Func = " \n32"
                  ' compress the background colors in rg to a height x width array or 1 x height*width array (if onerow = TRUE)
                  ' if greyscale = True then rg contains greyscale codes
                  
                      Dim i As Long
                      Dim j As Long
                      Dim ii As Long
                      Dim jj As Long
                      Dim k As Long
                      Dim m As Long
                      Dim n As Long
                      Dim mm As Long
                      Dim nn As Long
                      m = rg.Rows.Count
                      n = rg.Columns.Count
                      Dim mn As Long
                      Dim temp As Long
                      
                      Dim r As Long
                      If greyscale Then
                          r = 256 ^ 2 + 256 + 1
                      Else
                          r = 1
                      End If
                      Dim ce As Range
                      Set ce = rg.Cells(1, 1)
                      
                      mm = m \ height
                      nn = n \ width
                      mn = mm * nn
                      
                      If onerow Then
                      
                          ReDim arr(1 To 1, 1 To height * width) As Long
                          k = 1
                          For i = 1 To height
                              For j = 1 To width
                                  temp = 0
                                  For ii = 1 To mm
                                      For jj = 1 To nn
                                          temp = temp + ce.Cells((i - 1) * mm + ii, (j - 1) * nn + jj).Interior.Color
                                      Next
                                  Next
                                  arr(1, k) = Round(((temp / mn) / r), 0)
                                  k = k + 1
                              Next
                          Next
                      
                      Else
                      
                          ReDim arr(1 To height, 1 To width) As Long
                          For i = 1 To height
                              For j = 1 To width
                                  temp = 0
                                  For ii = 1 To mm
                                      For jj = 1 To nn
                                          temp = temp + ce.Cells((i - 1) * mm + ii, (j - 1) * nn + jj).Interior.Color
                                      Next
                                  Next
                                  arr(i, j) = Round(((temp / mn) / r), 0)
                              Next
                          Next
                          
                      End If
                      
                      CodeImage = arr
                      
                  End Function
                  
                  Sub RunConvert2Grey(rg As Range)
                  ' overwrite image in rg to greyscale
                  
                      On Error GoTo errorHandler
                      
                      Dim ce As Range
                      Set ce = rg.Cells(1, 1)
                      
                      Dim m As Long
                      Dim n As Long
                      m = rg.Rows.Count
                      n = rg.Columns.Count
                      Dim i As Long
                      Dim j As Long
                      Dim nn As Long
                      Dim red As Long
                      Dim blue As Long
                      Dim green As Long
                      
                      Dim r As Long
                      r = 256 ^ 2 + 256 + 1
                      
                      For i = 1 To m
                          For j = 1 To n
                              nn = ce.Cells(i, j).Interior.Color
                              red = nn Mod 256
                              nn = nn \ 256
                              green = nn Mod 256
                              blue = nn \ 256
                              nn = 0.299 * red + 0.587 * green + 0.114 * blue
                              ce.Cells(i, j).Interior.Color = nn * r
                          Next
                      Next
                  
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  End Sub
                  

                  General
                  Stream Path:VBA/Complex
                  VBA File Name:Complex
                  Stream Size:99463
                  Data ASCII:. . . . . . . . z e . . . . . . . . e . . 8 . . ? . . . . . . . . ; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . 8 . . . . 8 c . . +
                  Data Raw:01 16 03 00 06 f0 00 00 00 7a 65 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff a8 65 00 00 a4 38 01 00 3f 00 00 00 01 00 00 00 d4 1f 3b 0e 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Complex"
                  ' complex numbers and arrays
                  
                  ' a complex number is represented as a 1 x 2 array
                  ' an m x n complex matrix is represented by a m x 2n array
                  
                  Private Function dDim(v As Variant) As Long
                  ' return number of dimensions of array1: 0, 1 or 2
                  ' assumes that v is not a range
                      On Error GoTo ErrTrap
                      Dim n As Long
                      dDim = 0
                      n = UBound(v, 1)
                      dDim = 1
                      n = UBound(v, 2)
                      dDim = 2
                  ErrTrap:
                  End Function
                  
                  Function CReal(z As Variant) As Double
                  Attribute CReal.VB_Description = "Real part of z"
                  Attribute CReal.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' real part of a complex number
                  
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      If d = 2 Then
                          CReal = y(1, 1)
                      ElseIf d = 1 Then
                          CReal = y(1)
                      Else
                          CReal = y
                      End If
                      
                  End Function
                  
                  Function CImag(z As Variant) As Double
                  Attribute CImag.VB_Description = "Imaginary part of z"
                  Attribute CImag.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' imaginary part of a complex number
                  
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      If d = 2 Then
                          CImag = y(1, 2)
                      ElseIf d = 1 Then
                          CImag = y(2)
                      Else
                          CImag = 0
                      End If
                      
                  End Function
                  
                  Private Sub sCAdd(z As Variant, z1 As Variant)
                  ' add z1 to z
                  
                      Dim zz(1 To 2) As Variant
                      Dim d As Long
                      Dim y As Variant
                      
                      y = z1
                      d = dDim(y)
                      If d = 2 Then
                          zz(1) = y(1, 1)
                          zz(2) = y(1, 2)
                      ElseIf d = 1 Then
                          zz(1) = y(1)
                          zz(2) = y(2)
                      Else
                          zz(1) = y
                          zz(2) = 0
                      End If
                      z(1, 1) = z(1, 1) + zz(1)
                      z(1, 2) = z(1, 2) + zz(2)
                  
                  End Sub
                  
                  Function CAdd(z1 As Variant, z2 As Variant, Optional z3 As Variant, Optional z4 As Variant, Optional z5 As Variant) As Variant
                  Attribute CAdd.VB_Description = "1 x 2 numeric array representing the sum z1 + z2 (+ z3 + z4 + z5)"
                  Attribute CAdd.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' sum of up to 5 complex numbers
                  
                      Dim z As Variant
                      ReDim z(1 To 1, 1 To 2)
                      z(1, 1) = 0
                      z(1, 2) = 0
                      
                      Call sCAdd(z, z1)
                      Call sCAdd(z, z2)
                      If Not IsMissing(z3) Then
                          Call sCAdd(z, z3)
                          If Not IsMissing(z4) Then
                              Call sCAdd(z, z4)
                              If Not IsMissing(z5) Then Call sCAdd(z, z5)
                          End If
                      End If
                          
                      CAdd = z
                      
                  End Function
                  
                  Function CSub(z1 As Variant, z2 As Variant) As Variant
                  Attribute CSub.VB_Description = "1 x 2 numeric array representing the difference z1 - z2"
                  Attribute CSub.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' difference between two complex numbers
                  
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim d As Long
                      Dim z As Variant
                      ReDim z(1 To 1, 1 To 2)
                      
                      Dim zz1(1 To 2) As Variant
                      d = dDim(y1)
                      If d = 2 Then
                          zz1(1) = y1(1, 1)
                          zz1(2) = y1(1, 2)
                      ElseIf d = 1 Then
                          zz1(1) = y1(1)
                          zz1(2) = y1(2)
                      Else
                          zz1(1) = y1
                          zz1(2) = 0
                      End If
                      
                      Dim zz2(1 To 2) As Variant
                      d = dDim(y2)
                      If d = 2 Then
                          zz2(1) = y2(1, 1)
                          zz2(2) = y2(1, 2)
                      ElseIf d = 1 Then
                          zz2(1) = y2(1)
                          zz2(2) = y2(2)
                      Else
                          zz2(1) = y2
                          zz2(2) = 0
                      End If
                      
                      z(1, 1) = zz1(1) - zz2(1)
                      z(1, 2) = zz1(2) - zz2(2)
                      
                      CSub = z
                      
                  End Function
                  
                  Function CMult(z1 As Variant, z2 As Variant) As Variant
                  Attribute CMult.VB_Description = "1 x 2 numeric array representing the product z1 x z2"
                  Attribute CMult.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' product of two complex numbers
                  
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim d As Long
                      Dim z As Variant
                      ReDim z(1 To 1, 1 To 2)
                      
                      Dim zz1(1 To 2) As Variant
                      d = dDim(y1)
                      If d = 2 Then
                          zz1(1) = y1(1, 1)
                          zz1(2) = y1(1, 2)
                      ElseIf d = 1 Then
                          zz1(1) = y1(1)
                          zz1(2) = y1(2)
                      Else
                          zz1(1) = y1
                          zz1(2) = 0
                      End If
                      
                      Dim zz2(1 To 2) As Variant
                      d = dDim(y2)
                      If d = 2 Then
                          zz2(1) = y2(1, 1)
                          zz2(2) = y2(1, 2)
                      ElseIf d = 1 Then
                          zz2(1) = y2(1)
                          zz2(2) = y2(2)
                      Else
                          zz2(1) = y2
                          zz2(2) = 0
                      End If
                      
                      z(1, 1) = zz1(1) * zz2(1) - zz1(2) * zz2(2)
                      z(1, 2) = zz1(1) * zz2(2) + zz1(2) * zz2(1)
                      
                      CMult = z
                      
                  End Function
                  
                  Function CDiv(z1 As Variant, z2 As Variant) As Variant
                  Attribute CDiv.VB_Description = "1 x 2 numeric array representing the quotient z1 / z2"
                  Attribute CDiv.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' quotient of two complex numbers
                      
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim d As Long
                      Dim z As Variant
                      ReDim z(1 To 1, 1 To 2)
                      
                      Dim zz1(1 To 2) As Variant
                      d = dDim(y1)
                      If d = 2 Then
                          zz1(1) = y1(1, 1)
                          zz1(2) = y1(1, 2)
                      ElseIf d = 1 Then
                          zz1(1) = y1(1)
                          zz1(2) = y1(2)
                      Else
                          zz1(1) = y1
                          zz1(2) = 0
                      End If
                      
                      Dim zz2(1 To 2) As Variant
                      d = dDim(y2)
                      If d = 2 Then
                          zz2(1) = y2(1, 1)
                          zz2(2) = y2(1, 2)
                      ElseIf d = 1 Then
                          zz2(1) = y2(1)
                          zz2(2) = y2(2)
                      Else
                          zz2(1) = y2
                          zz2(2) = 0
                      End If
                      
                      Dim ratio As Double
                      Dim denom As Double
                  
                      If Abs(zz2(2)) < Abs(zz2(1)) Then
                          ratio = zz2(2) / zz2(1)
                          denom = zz2(1) + zz2(2) * ratio
                          z(1, 1) = (zz1(1) + zz1(2) * ratio) / denom
                          z(1, 2) = (zz1(2) - zz1(1) * ratio) / denom
                      Else
                          ratio = zz2(1) / zz2(2)
                          denom = zz2(2) + zz2(1) * ratio
                          z(1, 1) = (zz1(2) + zz1(1) * ratio) / denom
                          z(1, 2) = (-zz1(1) + zz1(2) * ratio) / denom
                      End If
                      
                      CDiv = z
                  
                  End Function
                  
                  Function CPower(z As Variant, c As Double) As Variant
                  Attribute CPower.VB_Description = "1 x 2 numeric array representing z raised to the c power"
                  Attribute CPower.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' raising a complex number to a real power
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      CPower = CMap(Application.WorksheetFunction.ImPower(CText(z), c))
                  End Function
                  
                  Function cExp(z As Variant) As Variant
                  Attribute cExp.VB_Description = "1 x 2 numeric array representing the exponential of z, Exp(z)"
                  Attribute cExp.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' exponential of a complex number
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      cExp = CMap(Application.WorksheetFunction.ImExp(CText(z)))
                  End Function
                  
                  Function CLn(z As Variant) As Variant
                  Attribute CLn.VB_Description = "1 x 2 numeric array representing the natural log of z"
                  Attribute CLn.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' natural log of a complex number
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      CLn = CMap(Application.WorksheetFunction.ImLn(CText(z)))
                  End Function
                  
                  Function CConj(z As Variant) As Variant
                  Attribute CConj.VB_Description = "1 x 2 numeric array representing the conjugate of z"
                  Attribute CConj.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' conjugate of a complex number
                  
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      
                      If d = 2 Then
                          zz(1, 1) = y(1, 1)
                          zz(1, 2) = -y(1, 2)
                      ElseIf d = 1 Then
                          zz(1, 1) = y(1)
                          zz(1, 2) = -y(2)
                      Else
                          zz(1, 1) = y
                          zz(1, 2) = 0
                      End If
                      
                      CConj = zz
                      
                  End Function
                  
                  Function CAbs(z As Variant) As Double
                  Attribute CAbs.VB_Description = "1 x 2 numeric array representing the absolute value of z"
                  Attribute CAbs.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' absolute value of a complex number
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      If d = 2 Then
                          CAbs = Sqr(y(1, 1) ^ 2 + y(1, 2) ^ 2)
                      ElseIf d = 1 Then
                          CAbs = Sqr(y(1) ^ 2 + y(2) ^ 2)
                      Else
                          CAbs = Abs(y)
                      End If
                  End Function
                  
                  Function CSet(xreal As Double, Optional ximag As Double = 0#) As Variant
                  Attribute CSet.VB_Description = "1 x 2 numeric array representing the complex number with real part xreal and imaginary part ximag"
                  Attribute CSet.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' set initial value of a complex number
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      zz(1, 1) = xreal + 0#
                      zz(1, 2) = ximag + 0#
                      CSet = zz
                  End Function
                  
                  Function CMap(s As String) As Variant
                  Attribute CMap.VB_Description = "1 x 2 numeric array representing the complex number in s"
                  Attribute CMap.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' map an Excel complex number into a Real Statistics complex number
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      CMap = CSet(Application.WorksheetFunction.ImReal(s), Application.WorksheetFunction.Imaginary(s))
                  End Function
                  
                  Function CText(z As Variant) As String
                  Attribute CText.VB_Description = "text representation of the complex number z (i.e. z in Excel complex number format)"
                  Attribute CText.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' map an Real Statistics complex number into an Excel complex number
                      CText = Application.WorksheetFunction.Complex(CReal(z) + 0#, CImag(z) + 0#)
                  End Function
                  
                  Function CPolar(z As Variant) As Variant
                  Attribute CPolar.VB_Description = "1 x 2 numeric array representing the complex number z in polar form (radius, angle)"
                  Attribute CPolar.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' returns polar coordinates of z
                  
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      
                      If d = 2 Then
                          zz(1, 1) = Sqr(y(1, 1) ^ 2 + y(1, 2) ^ 2)
                          zz(1, 2) = Application.WorksheetFunction.Atan2(y(1, 1), y(1, 2))
                      ElseIf d = 1 Then
                          zz(1, 1) = Sqr(y(1) ^ 2 + y(2) ^ 2)
                          zz(1, 2) = Application.WorksheetFunction.Atan2(y(1), y(2))
                      Else
                          zz(1, 1) = Abs(y)
                          zz(1, 2) = Application.WorksheetFunction.Atan2(y, 0)
                      End If
                      
                      CPolar = zz
                      
                  End Function
                  
                  Function CRect(z As Variant) As Variant
                  Attribute CRect.VB_Description = "1 x 2 numeric array representing the complex number z in rectangular form"
                  Attribute CRect.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' returns rectangular coordinates of z, when z is in polar coordinates
                  
                      Dim y As Variant
                      y = z
                      Dim d As Long
                      d = dDim(y)
                      Dim zz As Variant
                      ReDim zz(1 To 1, 1 To 2)
                      
                      If d = 2 Then
                          zz(1, 1) = y(1, 1) * Cos(y(1, 2))
                          zz(1, 2) = y(1, 1) * Sin(y(1, 2))
                      ElseIf d = 1 Then
                          zz(1, 1) = y(1) * Cos(y(2))
                          zz(1, 2) = y(1) * Sin(y(2))
                      Else
                          zz(1, 1) = y * Cos(0)
                          zz(1, 2) = y * Sin(0)
                      End If
                      
                      CRect = zz
                  
                  End Function
                  
                  Function CRoots(z As Variant, n As Long) As Variant
                  Attribute CRoots.VB_Description = "n x 2 numeric array, each row of which contains one of the nth roots of z"
                  Attribute CRoots.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' returns nth roots of complex number z
                  
                      Dim zz As Variant       ' output
                      Dim zp As Variant       ' polar version of nth root of z
                      ReDim zz(1 To n, 1 To 2)
                      ReDim zp(1 To 1, 1 To 2)
                      zp = CPolar(z)
                      zp(1, 1) = zp(1, 1) ^ (1 / n)
                      zp(1, 2) = zp(1, 2) / n
                      zz(1, 1) = zp(1, 1) * Cos(zp(1, 2))
                      zz(1, 2) = zp(1, 1) * Sin(zp(1, 2))
                      For i = 2 To n
                          zp(1, 2) = zp(1, 2) + 8 * Atn(1) / n    ' Pi = 4*Atn(1)
                          zz(i, 1) = zp(1, 1) * Cos(zp(1, 2))
                          zz(i, 2) = zp(1, 1) * Sin(zp(1, 2))
                      Next
                      CRoots = zz
                      
                  End Function
                  
                  Function IMROUND(s As String, Optional n As Long = 0) As String
                  Attribute IMROUND.VB_Description = "returns the complex number s with both the real and imaginary parts rounded off to n decimal places"
                  Attribute IMROUND.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' round a complex number
                      With Application.WorksheetFunction
                          IMROUND = .Complex(Round(.ImReal(s), n), Round(.Imaginary(s), n))
                      End With
                  End Function
                  
                  Function IMROOTS(s As String, n As Long) As Variant
                  Attribute IMROOTS.VB_Description = "returns a column array with the n roots (in Excel format) of the complex number s"
                  Attribute IMROOTS.VB_ProcData.VB_Invoke_Func = " \n33"
                      Dim z As Variant
                      ReDim z(1 To 1, 1 To 2)
                      z = CMap(s)
                      Dim zz As Variant
                      ReDim zz(1 To n, 1 To 2)
                      zz = CRoots(z, n)
                      Dim outp As Variant
                      ReDim outp(1 To n, 1 To 1)
                      Dim i As Long
                      With Application.WorksheetFunction
                          For i = 1 To n
                              outp(i, 1) = .Complex(zz(i, 1), zz(i, 2))
                          Next
                      End With
                      IMROOTS = outp
                  End Function
                  
                  ' complex matrix functions
                  ' (assumes range is m x 2n where left half are real parts and right half are imaginary parts)
                  
                  Function ZTranspose(z As Variant) As Variant
                  Attribute ZTranspose.VB_Description = "n x 2m array representing the transpose of the complex matrix z"
                  Attribute ZTranspose.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' transpose of a complex matrix
                  
                      On Error GoTo ErrTrap
                  
                      Dim zz As Variant
                      Dim y As Variant
                      y = z
                      Dim m As Long
                      Dim n As Long
                      Dim mm As Long
                      Dim nn As Long
                      m = UBound(y, 1)
                      n = UBound(y, 2)
                      mm = m * 2
                      nn = n \ 2
                      ReDim zz(1 To nn, 1 To mm)
                      
                      Dim i As Long
                      Dim j As Long
                      For i = 1 To nn
                          For j = 1 To m
                              zz(i, j) = y(j, i)
                              zz(i, j + m) = y(j, i + nn)
                          Next
                      Next
                      ZTranspose = zz
                      Exit Function
                      
                  ErrTrap:
                      ZTranspose = ZTranspose1(y, m)
                      
                  End Function
                  
                  Private Function ZTranspose1(z As Variant, n As Long) As Variant
                  ' transpose of a complex matrix with one row
                  
                      Dim zz As Variant
                      Dim mm As Long
                      Dim nn As Long
                      mm = 2
                      nn = n \ 2
                      ReDim zz(1 To nn, 1 To mm)
                      
                      Dim i As Long
                      For i = 1 To nn
                          zz(i, 1) = z(i)
                          zz(i, 2) = z(i + nn)
                      Next
                      ZTranspose1 = zz
                      
                  End Function
                  
                  Function ZIdentity(Optional k As Long = 0)
                  Attribute ZIdentity.VB_Description = "k x 2k array representing the complex number identity matrix, where left half contains real parts and right half contains imaginary parts"
                  Attribute ZIdentity.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' return the complex identity matrix
                      Dim z As Variant
                      Dim m As Long
                      Dim n As Long
                      If k > 0 Then
                          m = k
                          n = 2 * k
                      Else
                          m = Application.Caller.Rows.Count
                          n = Application.Caller.Columns.Count
                          If n <> 2 * m Then
                              ZIdentity = CVErr(xlErrNA)
                              Exit Function
                          End If
                      End If
                      ReDim z(1 To m, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      For i = 1 To m
                          For j = 1 To n
                              z(i, j) = 0#
                          Next
                          z(i, i) = 1#
                      Next
                      ZIdentity = z
                  End Function
                  
                  Private Sub sMake2D(z As Variant, y As Variant)
                  ' creates a two dimensional version z of one dimensional y
                      Dim j As Long
                      Dim n As Long
                      n = UBound(y)
                      ReDim z(1 To 1, 1 To n)
                      For j = 1 To n
                          z(1, j) = y(j)
                      Next
                  End Sub
                  
                  Function ZAdd(z1 As Variant, z2 As Variant) As Variant
                  Attribute ZAdd.VB_Description = "m x 2n array representing the complex matrix which is the sum z1 + z2"
                  Attribute ZAdd.VB_ProcData.VB_Invoke_Func = " \n33"
                      
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim m As Long
                      Dim n As Long
                      Dim d As Long
                      Dim yy1 As Variant
                      Dim yy2 As Variant
                      
                      d = dDim(y1)
                      If d = 2 Then
                          yy1 = y1
                      ElseIf d = 1 Then
                          Call sMake2D(yy1, y1)
                      Else
                          ZAdd = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      m = UBound(yy1, 1)
                      n = UBound(yy1, 2)
                      If n Mod 2 <> 0 Then
                          ZAdd = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      d = dDim(y2)
                      If d = 2 Then
                          yy2 = y2
                      ElseIf d = 1 Then
                          Call sMake2D(yy2, y2)
                      Else
                          ZAdd = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      If m <> UBound(yy2, 1) Or n <> UBound(yy2, 2) Then
                          ZAdd = CVErr(xlErrNA)
                          Exit Function
                      End If
                  
                      Dim z As Variant
                      ReDim z(1 To m, 1 To n)
                      Call sAdd(z, yy1, yy2)
                      ZAdd = z
                  
                  End Function
                  
                  Function ZSub(z1 As Variant, z2 As Variant) As Variant
                  Attribute ZSub.VB_Description = "m x 2n array representing the complex matrix which is the difference z1 - z2"
                  Attribute ZSub.VB_ProcData.VB_Invoke_Func = " \n33"
                      
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim m As Long
                      Dim n As Long
                      Dim d As Long
                      Dim yy1 As Variant
                      Dim yy2 As Variant
                      
                      d = dDim(y1)
                      If d = 2 Then
                          yy1 = y1
                      ElseIf d = 1 Then
                          Call sMake2D(yy1, y1)
                      Else
                          ZSub = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      m = UBound(yy1, 1)
                      n = UBound(yy1, 2)
                      If n Mod 2 <> 0 Then
                          ZSub = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      d = dDim(y2)
                      If d = 2 Then
                          yy2 = y2
                      ElseIf d = 1 Then
                          Call sMake2D(yy2, y2)
                      Else
                          ZSub = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      If m <> UBound(yy2, 1) Or n <> UBound(yy2, 2) Then
                          ZSub = CVErr(xlErrNA)
                          Exit Function
                      End If
                  
                      Dim z As Variant
                      ReDim z(1 To m, 1 To n)
                      Call sSubtract(z, yy1, yy2)
                      ZSub = z
                  
                  End Function
                  
                  Function ZMult(z1 As Variant, z2 As Variant) As Variant
                  Attribute ZMult.VB_Description = "m x 2k array representing the complex matrix which is the product z1 x z2"
                  Attribute ZMult.VB_ProcData.VB_Invoke_Func = " \n33"
                      
                      Dim y1 As Variant
                      Dim y2 As Variant
                      y1 = z1
                      y2 = z2
                      Dim m As Long
                      Dim n As Long
                      Dim h As Long
                      m = UBound(y1, 1)
                      h = UBound(y1, 2) \ 2
                      n = UBound(y2, 2) \ 2
                      
                      If h <> UBound(y2, 1) Or UBound(y1, 2) Mod 2 <> 0 Or UBound(y2, 2) Mod 2 <> 0 Then
                          ZMult = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      Dim z As Variant
                      ReDim z(1 To m, 1 To 2 * n)
                      
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim tot1 As Double
                      Dim tot2 As Double
                      For i = 1 To m
                          For j = 1 To n
                              tot1 = 0#
                              tot2 = 0#
                              For k = 1 To h
                                  tot1 = tot1 + y1(i, k) * y2(k, j) - y1(i, k + h) * y2(k, j + n)
                                  tot2 = tot2 + y1(i, k + h) * y2(k, j) + y1(i, k) * y2(k, j + n)
                              Next
                              z(i, j) = tot1
                              z(i, n + j) = tot2
                          Next
                      Next
                      
                      ZMult = z
                      
                  End Function
                  
                  Function ZMultScalar(z As Variant, c As Variant) As Variant
                  Attribute ZMultScalar.VB_Description = "m x 2n array representing the complex matrix which is the product of c and z"
                  Attribute ZMultScalar.VB_ProcData.VB_Invoke_Func = " \n33"
                  
                      On Error GoTo ErrTrap
                      
                      Dim y As Variant
                      y = z
                      Dim cc As Variant
                      cc = c
                      
                      Dim m As Long
                      Dim n As Long
                      Dim nn As Long
                      m = UBound(y, 1)
                      n = UBound(y, 2)
                      If n Mod 2 <> 0 Then
                          ZMultiScalar = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      nn = n \ 2
                      Dim i As Long
                      Dim j As Long
                      Dim zz As Variant
                      ReDim zz(1 To m, 1 To n)
                      
                      Dim d As Long
                      d = dDim(cc)
                      
                      If d = 1 Then
                          For i = 1 To m
                              For j = 1 To nn
                                  zz(i, j) = y(i, j) * cc(1) - y(i, j + nn) * cc(2)
                                  zz(i, j + nn) = y(i, j + nn) * cc(1) + y(i, j) * cc(2)
                              Next
                          Next
                      ElseIf d = 2 Then
                          For i = 1 To m
                              For j = 1 To nn
                                  zz(i, j) = y(i, j) * cc(1, 1) - y(i, j + nn) * cc(1, 2)
                                  zz(i, j + nn) = y(i, j + nn) * cc(1, 1) + y(i, j) * cc(1, 2)
                              Next
                          Next
                      Else
                          For i = 1 To m
                              For j = 1 To nn
                                  zz(i, j) = y(i, j) * cc
                                  zz(i, j + nn) = y(i, j + nn) * cc
                              Next
                          Next
                      End If
                      
                      ZMultScalar = zz
                      Exit Function
                      
                  ErrTrap:
                      ZMultScalar = ZMultScalar1(y, cc, m)
                      
                  End Function
                  
                  Private Function ZMultScalar1(z As Variant, c As Variant, n As Long) As Variant
                  
                      If n Mod 2 <> 0 Then
                          ZMultScalar1 = CVErr(xlErrNA)
                          Exit Fun

                  General
                  Stream Path:VBA/Correlation
                  VBA File Name:Correlation
                  Stream Size:403226
                  Data ASCII:. . . . . . . . ! . . . . . . . . ! . . . . . . . . . . . . K . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . T . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . ? . . . . h . . . + . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 aa 21 01 00 d4 00 00 00 b0 01 00 00 ff ff ff ff ed 21 01 00 bd c0 04 00 84 00 00 00 01 00 00 00 d4 1f 4b 89 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Correlation"
                  ' Improved square root
                  
                  Private Function XSqrt(x As Double) As Double
                  ' returns square root or zero if z is negative (esp. for negative values near zero)
                      If x >= 0 Then
                          XSqrt = Sqr(x)
                      Else
                          XSqrt = 0#
                      End If
                  End Function
                  
                  ' Covariance and correlation
                  
                  Sub sCov(b As Variant, a As Variant)
                  ' set matrix b to the sample covariance matrix corresponding to the data in matrix a
                  ' assumes that b is a square metrix with the same number of columns as a
                  
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim m As Long           ' # of rows in matrix a
                      Dim n As Long           ' # of columns in matrix a
                      m = UBound(a, 1)
                      n = UBound(a, 2)
                      
                      Dim vector As Variant   ' vector of column averages
                      ReDim vector(1 To 1, 1 To n)
                      Dim temp As Double
                      For j = 1 To n
                          temp = 0#
                          For i = 1 To m
                              temp = temp + a(i, j)
                          Next
                          vector(1, j) = temp / m
                      Next
                      
                      Dim t As Variant        ' matrix of the same shape as a transpose
                      ReDim t(1 To n, 1 To m)
                      
                      Call sSubtractVector(a, a, vector)
                      t = Application.WorksheetFunction.Transpose(a)
                      b = Application.WorksheetFunction.MMult(t, a)
                      Call sMultScalar(b, b, 1 / (m - 1))
                      
                  End Sub
                  
                  Private Sub sCovp(b As Variant, a As Variant)
                  ' set matrix b to the population covariance matrix corresponding to the data in matrix a
                  ' assumes that b is a square metrix with the same number of columns as a
                  
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim m As Long           ' # of rows in matrix a
                      Dim n As Long           ' # of columns in matrix a
                      m = UBound(a, 1)
                      n = UBound(a, 2)
                      
                      Dim vector As Variant   ' vector of column averages
                      ReDim vector(1 To 1, 1 To n)
                      Dim temp As Double
                      For j = 1 To n
                          temp = 0#
                          For i = 1 To m
                              temp = temp + a(i, j)
                          Next
                          vector(1, j) = temp / m
                      Next
                      
                      Dim t As Variant        ' matrix of the same shape as a transpose
                      ReDim t(1 To n, 1 To m)
                      
                      Call sSubtractVector(a, a, vector)
                      t = Application.WorksheetFunction.Transpose(a)
                      b = Application.WorksheetFunction.MMult(t, a)
                      Call sMultScalar(b, b, 1 / m)
                      
                  End Sub
                  
                  Sub sCorr(b As Variant, a As Variant)
                  ' set matrix b to the correlation matrix corresponding to the data in matrix a
                  ' assumes that b is a square metrix with the same number of columns as a
                  
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim m As Long           ' # of rows in matrix a
                      Dim n As Long           ' # of columns in matrix a
                      m = UBound(a, 1)
                      n = UBound(a, 2)
                      
                      Dim vector As Variant   ' vector of column averages
                      ReDim vector(1 To 1, 1 To n)
                      Dim vector1 As Variant  ' vector of column standard deviations
                      ReDim vector1(1 To 1, 1 To n)
                      Dim temp As Double
                      Dim temp2 As Double
                      
                      For j = 1 To n
                          temp = 0#
                          temp2 = 0#
                          For i = 1 To m
                              temp = temp + a(i, j)
                              temp2 = temp2 + a(i, j) ^ 2
                          Next
                          vector(1, j) = temp / m
                          vector1(1, j) = 1 / Sqr((temp2 - (temp ^ 2) / m) / m)
                      Next
                      
                      Dim t As Variant        ' matrix of the same shape as a transpose
                      ReDim t(1 To n, 1 To m)
                      
                      Call sSubtractVector(a, a, vector)
                      Call sMultRowVector(a, a, vector1)
                      t = Application.WorksheetFunction.Transpose(a)
                      b = Application.WorksheetFunction.MMult(t, a)
                      Call sMultScalar(b, b, 1 / m)
                      
                  End Sub
                  
                  Function COV(array1 As Variant, Optional listwise As Boolean = True) As Variant
                  Attribute COV.VB_Description = "returns the sample covariance matrix for the data in range rg"
                  Attribute COV.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return sample covariance matrix for data in array1
                  ' if listwise = True then non-numeric cells are ignored listwise; otherwise they are ignored pairwise
                  
                      Dim arr As Variant
                      arr = array1
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim jj As Long          ' index
                      Dim m As Long           ' number of rows in array1
                      Dim n As Long           ' number of columns in array1
                      n = UBound(arr, 2)
                      Dim vect1 As Variant    ' one column in array1
                      Dim vect2 As Variant    ' one column in array1
                      Dim k As Long           ' # of rows in array1 w/o a non-numeric cell
                      Dim mat As Variant      ' matrix with data from rg w/o listwise missing data
                      Dim mat1 As Variant     ' covariance matrix
                      ReDim mat1(1 To n, 1 To n)
                      
                      If listwise Then
                          k = CountFullRows(array1, False)
                          ReDim mat(1 To k, 1 To n)
                          Call sDELROWNonNum(mat, arr)
                          Call sCov(mat1, mat)
                      Else
                          m = UBound(arr, 1)
                          ReDim vect1(1 To m, 1 To 1)
                          ReDim vect2(1 To m, 1 To 1)
                          For j = 1 To n
                              For i = 1 To m
                                  If arr(i, j) <> "" Then
                                      vect1(i, 1) = arr(i, j)
                                  Else
                                      vect1(i, 1) = ""
                                  End If
                              Next
                              mat1(j, j) = Application.WorksheetFunction.Var_S(vect1)
                              For jj = j + 1 To n
                                  For i = 1 To m
                                      If arr(i, jj) <> "" Then
                                          vect2(i, 1) = arr(i, jj)
                                      Else
                                          vect2(i, 1) = ""
                                      End If
                                  Next
                                  mat1(j, jj) = Application.WorksheetFunction.Covariance_S(vect1, vect2)
                                  mat1(jj, j) = mat1(j, jj)
                              Next
                          Next
                      End If
                      
                      COV = mat1
                      
                  End Function
                  
                  Function COVP(array1 As Variant, Optional listwise As Boolean = True) As Variant
                  Attribute COVP.VB_Description = "returns the population covariance matrix for the data in range rg"
                  Attribute COVP.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return population covariance matrix for data in array1
                  ' if listwise = True then non-numeric cells are ignored listwise; otherwise they are ignored pairwise
                  
                      Dim arr As Variant
                      arr = array1
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim jj As Long          ' index
                      Dim m As Long           ' number of rows in array1
                      Dim n As Long           ' number of columns in array1
                      n = UBound(arr, 2)
                      Dim vect1 As Variant    ' one column in array1
                      Dim vect2 As Variant    ' one column in array1
                      Dim k As Long           ' # of rows in array1 w/o a non-numeric cell
                      Dim mat As Variant      ' matrix with data from rg w/o listwise missing data
                      Dim mat1 As Variant     ' covariance matrix
                      ReDim mat1(1 To n, 1 To n)
                      
                      If listwise Then
                          k = CountFullRows(array1, False)
                          ReDim mat(1 To k, 1 To n)
                          Call sDELROWNonNum(mat, arr)
                          Call sCovp(mat1, mat)
                      Else
                          m = UBound(arr, 1)
                          ReDim vect1(1 To m, 1 To 1)
                          ReDim vect2(1 To m, 1 To 1)
                          For j = 1 To n
                              For i = 1 To m
                                  If arr(i, j) <> "" Then
                                      vect1(i, 1) = arr(i, j)
                                  Else
                                      vect1(i, 1) = ""
                                  End If
                              Next
                              mat1(j, j) = Application.WorksheetFunction.Var_P(vect1)
                              For jj = j + 1 To n
                                  For i = 1 To m
                                      If arr(i, jj) <> "" Then
                                          vect2(i, 1) = arr(i, jj)
                                      Else
                                          vect2(i, 1) = ""
                                      End If
                                  Next
                                  mat1(j, jj) = Application.WorksheetFunction.Covariance_P(vect1, vect2)
                                  mat1(jj, j) = mat1(j, jj)
                              Next
                          Next
                      End If
                      
                      COVP = mat1
                      
                  End Function
                  
                  Function CORR(array1 As Variant, Optional listwise As Boolean = True) As Variant
                  Attribute CORR.VB_Description = "returns the correlation matrix for the data in range rg"
                  Attribute CORR.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return correlation matrix for data in array1
                  ' if listwise = True then non-numeric cells are ignored listwise; otherwise they are ignored pairwise
                  
                      Dim arr As Variant
                      arr = array1
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim jj As Long          ' index
                      Dim m As Long           ' number of rows in array1
                      Dim n As Long           ' number of columns in array1
                      n = UBound(arr, 2)
                      Dim vect1 As Variant    ' one column in array1
                      Dim vect2 As Variant    ' one column in array1
                      Dim k As Long           ' # of rows in array1 w/o a non-numeric cell
                      Dim mat As Variant      ' matrix with data from rg w/o listwise missing data
                      Dim mat1 As Variant     ' correlation matrix
                      ReDim mat1(1 To n, 1 To n)
                      
                      If listwise Then
                          k = CountFullRows(array1, False)
                          ReDim mat(1 To k, 1 To n)
                          Call sDELROWNonNum(mat, arr)
                          Call sCorr(mat1, mat)
                      Else
                          m = UBound(arr, 1)
                          ReDim vect1(1 To m, 1 To 1)
                          ReDim vect2(1 To m, 1 To 1)
                          For j = 1 To n
                              For i = 1 To m
                                  If arr(i, j) <> "" Then
                                      vect1(i, 1) = arr(i, j)
                                  Else
                                      vect1(i, 1) = ""
                                  End If
                              Next
                              mat1(j, j) = 1
                              For jj = j + 1 To n
                                  For i = 1 To m
                                      If arr(i, jj) <> "" Then
                                          vect2(i, 1) = arr(i, jj)
                                      Else
                                          vect2(i, 1) = ""
                                      End If
                                  Next
                                  mat1(j, jj) = Application.WorksheetFunction.Correl(vect1, vect2)
                                  mat1(jj, j) = mat1(j, jj)
                              Next
                          Next
                      End If
                      
                      CORR = mat1
                      
                  End Function
                  
                  Function COVARP(array1 As Variant, array2 As Variant) As Double
                  Attribute COVARP.VB_Description = "returns the population covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries"
                  Attribute COVARP.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return population covariance of arrays array1 and array2
                      COVARP = Application.WorksheetFunction.Covariance_P(array1, array2)
                  End Function
                  
                  Function COVARS(array1 As Variant, array2 As Variant) As Double
                  Attribute COVARS.VB_Description = "returns the sample covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries"
                  Attribute COVARS.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return sample covariance of arrays array1 and array2
                      COVARS = Application.WorksheetFunction.Covariance_S(array1, array2)
                  End Function
                  
                  Function RSQ_ADJ(arg1 As Variant, arg2 As Variant) As Double
                  Attribute RSQ_ADJ.VB_Description = "returns the adjusted R-square value"
                  Attribute RSQ_ADJ.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return adjusted correlation squared for ranges arg1 and arg2
                  ' if arg1 is a number then return the adjusted correlation squared where arg1 = r and arg2 = n
                      Dim r As Double
                      Dim n As Long
                      If IsNumeric(arg1) Then
                          r = CDbl(arg1)
                          n = CLng(arg2)
                      Else
                          r = Application.WorksheetFunction.Correl(arg1, arg2)
                          n = CountPairs(arg1, arg2)
                      End If
                      RSQ_ADJ = 1 - (1 - r ^ 2) * (n - 1) / (n - 2)
                  End Function
                  
                  Function CORREL_ADJ(arg1 As Variant, arg2 As Variant) As Double
                  Attribute CORREL_ADJ.VB_Description = "returns the adjusted population correlation coefficient"
                  Attribute CORREL_ADJ.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return fairly unbiased estimate for the population correlation coefficient for ranges arg1 and arg2
                  ' if arg1 is a number then return the estimated correlation where arg1 = r and arg2 = n
                      Dim r As Double
                      Dim n As Long
                      If IsNumeric(arg1) Then
                          r = CDbl(arg1)
                          n = CLng(arg2)
                      Else
                          r = Application.WorksheetFunction.Correl(arg1, arg2)
                          n = CountPairs(arg1, arg2)
                      End If
                      CORREL_ADJ = r * (1 + (1 - r ^ 2) / (2 * (n - 3)))
                  End Function
                  
                  Function MCORREL(zarray As Variant, xarray As Variant, yarray As Variant) As Double
                  Attribute MCORREL.VB_Description = "returns the multiple correlation coefficient of zarray with xarray and yarray"
                  Attribute MCORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the multiple correlation of dependent variable z with x and y
                  ' where the samples for z, x and y are in arrays zarray, xarray and yarray respectively
                      Dim rxy As Double
                      Dim rzx As Double
                      Dim rzy As Double
                      rxy = Application.WorksheetFunction.Correl(xarray, yarray)
                      rzx = Application.WorksheetFunction.Correl(zarray, xarray)
                      rzy = Application.WorksheetFunction.Correl(zarray, yarray)
                      MCORREL = ((rzx ^ 2 + rzy ^ 2 - 2 * rzx * rzy * rxy) / (1 - rxy ^ 2)) ^ 0.5
                  End Function
                  
                  Function PART_CORREL(zarray As Variant, xarray As Variant, yarray As Variant) As Double
                  Attribute PART_CORREL.VB_Description = "returns the partial correlation r_zx,y of z and x holding y constant based on Pearson's correlation"
                  Attribute PART_CORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the partial correlation of variables z and x holding y constant
                  ' where the samples for z, x and y are in arrays zarray, xarray and ryarray respectively
                      Dim rxy As Double
                      Dim rzx As Double
                      Dim rzy As Double
                      rxy = Application.WorksheetFunction.Correl(xarray, yarray)
                      rzx = Application.WorksheetFunction.Correl(zarray, xarray)
                      rzy = Application.WorksheetFunction.Correl(zarray, yarray)
                      PART_CORREL = (rzx - rzy * rxy) / (Sqr(1 - rzy ^ 2) * Sqr(1 - rxy ^ 2))
                  End Function
                  
                  Function SEMIPART_CORREL(zarray As Variant, xarray As Variant, yarray As Variant) As Double
                  Attribute SEMIPART_CORREL.VB_Description = "returns the semi-partial correlation r_z(x,y) based on Pearson's correlation"
                  Attribute SEMIPART_CORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the semi-partial correlation of variables z and x holding y constant
                  ' where the samples for z, x and y are in arrays zarray, xarray and yarray respectively
                      Dim rxy As Double
                      Dim rzx As Double
                      Dim rzy As Double
                      rxy = Application.WorksheetFunction.Correl(xarray, yarray)
                      rzx = Application.WorksheetFunction.Correl(zarray, xarray)
                      rzy = Application.WorksheetFunction.Correl(zarray, yarray)
                      SEMIPART_CORREL = (rzx - rzy * rxy) / Sqr(1 - rxy ^ 2)
                  End Function
                  
                  Function PART_KCORREL(zarray As Variant, xarray As Variant, yarray As Variant) As Double
                  Attribute PART_KCORREL.VB_Description = "returns the partial correlation tau_zx,y of z and x holding y constant based on Kendall's correlation"
                  Attribute PART_KCORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the partial Kendall's correlation of variables z and x holding y constant
                  ' where the samples for z, x and y are in arrays zarray, xarray and yarray respectively
                      Dim rxy As Double
                      Dim rzx As Double
                      Dim rzy As Double
                      rxy = KCORREL(xarray, yarray)
                      rzx = KCORREL(zarray, xarray)
                      rzy = KCORREL(zarray, yarray)
                      PART_KCORREL = (rzx - rzy * rxy) / (Sqr(1 - rzy ^ 2) * Sqr(1 - rxy ^ 2))
                  End Function
                  
                  Function SEMIPART_KCORREL(zarray As Variant, xarray As Variant, yarray As Variant) As Double
                  Attribute SEMIPART_KCORREL.VB_Description = "returns the semi-partial correlation tau_z(x,y) based on Kendall's correlation"
                  Attribute SEMIPART_KCORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the semi-partial Kendall's correlation of variables z and x holding y constant
                  ' where the samples for z, x and y are in arrays zarray, xarray and yarray respectively
                      Dim rxy As Double
                      Dim rzx As Double
                      Dim rzy As Double
                      rxy = KCORREL(xarray, yarray)
                      rzx = KCORREL(zarray, xarray)
                      rzy = KCORREL(zarray, yarray)
                      SEMIPART_KCORREL = (rzx - rzy * rxy) / Sqr(1 - rxy ^ 2)
                  End Function
                  
                  Sub DisplayCorr(ce As Range, rg As Range, Optional s As String = "Correlation Matrix")
                  ' display correlation matrix starting at cell ce for range rg using heading s
                      Dim rg1 As Range
                      Dim n As Long
                      n = rg.Columns.Count
                      ce.Value = s
                      Call SetRange2(rg1, ce.Offset(2, 0), n, n)
                      Call SetFormulaArray(rg1, "CORR", rg)
                      rg.Borders(xlEdgeBottom).LineStyle = xlContinuous
                  End Sub
                  
                  Sub DisplayCov(ce As Range, rg As Range, Optional s As String = "Covariance Matrix")
                  ' display covariance matrix starting at cell ce for range rg using heading s
                      Dim rg1 As Range
                      Dim n As Long
                      n = rg.Columns.Count
                      ce.Value = s
                      Call SetRange2(rg1, ce.Offset(2, 0), n, n)
                      Call SetFormulaArray(rg1, "COV", rg)
                      rg.Borders(xlEdgeBottom).LineStyle = xlContinuous
                  End Sub
                  
                  Function BCORREL(xarray As Variant, yarray As Variant, Optional lab As Boolean = False, Optional alpha As Double = 0.05) As Variant
                  Attribute BCORREL.VB_Description = "returns the biserial correlation coefficient for the data in xarray and yarray, plus z-stat, p-value and ends of 1-alpha confidence interval"
                  Attribute BCORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the biserial correlation coefficient for the data in column arrays xarray and yarray,
                  ' where xarray contains the dichotomous data
                      
                      On Error GoTo wrapup
                      
                      Dim vectx As Variant    ' xarray as a vector
                      Dim vecty As Variant    ' yarray as a vector
                      vectx = xarray
                      vecty = yarray
                      Dim mx As Long          ' length of xarray
                      Dim my As Long          ' length of yarray
                      Dim m As Long           ' min of mx and my
                      mx = UBound(vectx, 1)
                      my = UBound(vecty, 1)
                      m = mx
                      If my < m Then m = my
                      
                      Dim vect0 As Variant    ' y values corresponding to x = 0
                      ReDim vect0(1 To 1, 1 To m)
                      Dim vect1 As Variant    ' y values corresponding to x = 1
                      ReDim vect1(1 To 1, 1 To m)
                      Dim m0 As Long          ' length of vect0
                      Dim m1 As Long          ' length of vect1
                      Dim i As Long           ' index
                      
                      For i = 1 To m
                          If vectx(i, 1) <> "" And IsNumeric(vecty(i, 1)) And vecty(i, 1) <> "" Then
                              If vectx(i, 1) = 0 Then
                                  m0 = m0 + 1
                                  vect0(1, m0) = vecty(i, 1)
                              ElseIf vectx(i, 1) = 1 Then
                                  m1 = m1 + 1
                                  vect1(1, m1) = vecty(i, 1)
                              End If
                          End If
                      Next
                      
                      ReDim Preserve vect0(1 To 1, 1 To m0)
                      ReDim Preserve vect1(1 To 1, 1 To m1)
                      
                      Dim h As Long           ' # of columns in output
                      Dim outp As Variant     ' output
                      If lab Then
                          h = 2
                          ReDim outp(1 To 5, 1 To 2)
                          outp(1, 1) = "biserial"
                          outp(2, 1) = "z-stat"
                          outp(3, 1) = "p-value"
                          outp(4, 1) = "lower"
                          outp(5, 1) = "upper"
                      Else
                          h = 1
                          ReDim outp(1 To 5, 1 To 1)
                      End If
                      
                      outp(1, h) = "N/A"
                      outp(2, h) = "N/A"
                      outp(3, h) = "N/A"
                      outp(4, h) = "N/A"
                      outp(5, h) = "N/A"
                      
                      Dim y As Double         ' y
                      Dim p As Double         ' p0
                      Dim r As Double         ' biserial correlation
                      Dim u As Double         ' Fisher(u)
                      Dim z As Double         ' z-stat
                      Dim se As Double        ' standard error of u
                      Dim k As Double         ' used for CI
                      
                      With Application.WorksheetFunction
                          p = m0 / (m0 + m1)
                          y = p * (1 - p) / .Norm_S_Dist(.Norm_S_Inv(p), False)
                          r = (.Average(vect1) - .Average(vect0)) * y / .StDev_P(vect0, vect1)
                          outp(1, h) = r
                          u = .Fisher(2 * r / Sqr(5))
                          se = Sqr(5 / (m0 + m1)) / 2
                          z = u / se
                          outp(2, h) = z
                          outp(3, h) = 2 * .Norm_S_Dist(-Abs(z), True)
                          k = se * .Norm_S_Inv(1 - alpha / 2)
                          outp(4, h) = .FisherInv(u - k) * Sqr(5) / 2
                          outp(5, h) = .FisherInv(u + k) * Sqr(5) / 2
                      End With
                      
                  wrapup:
                      BCORREL = outp
                  
                  End Function
                  
                  ' Partial correlation
                  
                  Function PCORREL(array1 As Variant, i As Long, j As Long) As Variant
                  Attribute PCORREL.VB_Description = "returns the partial correlation coefficient for variable corresponding to the ith and jth columns in array1"
                  Attribute PCORREL.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return the partial correlation coefficient for variable corresponding to the ith and jth columns in array1
                      Dim arr As Variant
                      arr = array1
                      Dim k As Long       ' # of col

                  General
                  Stream Path:VBA/Desc
                  VBA File Name:Desc
                  Stream Size:175423
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . . ` . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . h . . . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 aa 9e 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff ed 9e 00 00 a5 18 02 00 60 00 00 00 01 00 00 00 d4 1f 87 71 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Desc"
                  ' Private helping functions
                  
                  Sub sCol(v As Variant, a As Variant, k As Long)
                  ' put the kth column of array a into column vector v
                  ' assumes that a and v are arrays and that a and b have the same # of rows and that number is not 1
                      Dim i As Long
                      Dim m As Long
                      m = UBound(a, 1)
                      For i = 1 To m
                          v(i, 1) = a(i, k)
                      Next
                  End Sub
                  
                  Sub sRow(v As Variant, a As Variant, k As Long)
                  ' put the kth row of array a into row vector v
                  ' assumes that a and v are arrays and that a and b have the same # of columns and that number is not 1
                      Dim i As Long
                      Dim n As Long
                      n = UBound(a, 2)
                      For i = 1 To n
                          v(1, i) = a(k, i)
                      Next
                  End Sub
                  
                  Private Function fDim(array1 As Variant) As Long
                  ' return number of dimensions of array1: 0, 1 or -1 (i.e. >= 2)
                  ' assumes that array1 is not a range
                      On Error GoTo ErrTrap
                      Dim n As Long
                      Dim errcode As Long
                      errcode = 0
                      n = UBound(array1, 1)
                      errcode = 1
                      n = UBound(array1, 2)
                      fDim = -1
                      Exit Function
                  ErrTrap:
                      fDim = errcode
                  End Function
                  
                  ' Basic descriptive functions
                  
                  Function MEAN(darray As Variant, Optional warray As Variant) As Double
                  Attribute MEAN.VB_Description = "returns the mean of the elements in darray; if warray is present then the weighted mean is returned"
                  Attribute MEAN.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return weighted mean
                      With WorksheetFunction
                      If IsMissing(warray) Then
                          MEAN = .Average(darray)
                      Else
                          MEAN = .SumProduct(darray, warray) / .Sum(warray)
                      End If
                      End With
                  End Function
                  
                  Function MED(darray As Variant, Optional warray As Variant, Optional p As Variant) As Double
                  Attribute MED.VB_Description = "returns the median/percentile of the elements in darray; if warray is present then the weighted median/percentile is returned"
                  Attribute MED.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return weighted median/percentile
                  
                      If IsMissing(p) Then
                          If IsMissing(warray) Then
                              MED = WorksheetFunction.Median(darray)
                              Exit Function
                          Else
                              p = 0.5
                          End If
                      End If
                      
                      If p >= 1 Then
                          MED = WorksheetFunction.Max(darray)
                          Exit Function
                      End If
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim n As Long
                      n = UBound(darr, 2)
                      Dim mn As Long
                      mn = m * n
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      
                      Dim warr As Variant
                      If IsMissing(warray) Then
                          For i = 1 To m
                              For j = 1 To n
                                  warr(i, j) = 1
                              Next
                          Next
                      Else
                          warr = warray
                      End If
                      Dim w As Double
                      w = WorksheetFunction.Sum(warray) * p
                      
                      Dim carr As Variant
                      ReDim carr(1 To mn, 1 To 2)
                      Dim sarr As Variant
                      ReDim sarr(1 To mn, 1 To 2)
                      Dim tot As Double
                      
                      k = 0
                      For j = 1 To n
                          For i = 1 To m
                              k = k + 1
                              carr(k, 1) = darr(i, j)
                              carr(k, 2) = warr(i, j)
                          Next
                      Next
                      sarr = QSORTRows(carr)
                      
                      tot = 0#
                      For k = 1 To mn
                          tot = tot + sarr(k, 2)
                          If tot > w Then
                              MED = sarr(k, 1)
                              Exit Function
                          ElseIf tot = w Then
                              MED = (sarr(k, 1) + sarr(k + 1, 1)) / 2
                              Exit Function
                          End If
                      Next
                      
                      ' should never reach this point
                  
                  End Function
                  
                  Function WVAR(darray As Variant, Optional warray As Variant, Optional rel As Boolean = True) As Double
                  Attribute WVAR.VB_Description = "returns the weighted variance"
                  Attribute WVAR.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return weighted variance
                  
                      Dim avg As Double
                      Dim s As Double
                      Dim w As Double
                      Dim wsq As Double
                      Dim i As Long
                      Dim n As Long
                      Dim darr As Variant
                      Dim warr As Variant
                      Dim temp As Double
                      
                      With WorksheetFunction
                          If IsMissing(warray) Then
                              WVAR = .Var_S(darray)
                          Else
                              darr = darray
                              warr = warray
                              n = UBound(warr, 1)
                              w = .Sum(warray)
                              avg = MEAN(darray, warray)
                              temp = 0#
                              For i = 1 To n
                                 temp = temp + warr(i, 1) * (darr(i, 1) - avg) ^ 2
                              Next
                              If rel Then
                                  wsq = .SumSq(warray)
                                  WVAR = temp / (w - wsq / w)
                              Else
                                  WVAR = temp / (w - 1)
                              End If
                          End If
                      End With
                  End Function
                  
                  Function WSTDEV(darray As Variant, Optional warray As Variant, Optional rel As Boolean = True) As Double
                  Attribute WSTDEV.VB_Description = "returns the weighted standard deviation"
                  Attribute WSTDEV.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return weighted standard deviation
                      WSTDEV = Sqr(WVAR(darray, warray, rel))
                  End Function
                  
                  Function WCOV(darray As Variant, Optional warray As Variant, Optional rel As Boolean = True) As Variant
                  Attribute WCOV.VB_Description = "returns the weighted covariance matrix"
                  Attribute WCOV.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return weighted covariance matrix
                  
                      Dim avg As Double
                      Dim s As Double
                      Dim w As Double
                      Dim v As Double
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim n As Long
                      Dim darr As Variant
                      Dim warr As Variant
                      Dim varr As Variant
                      Dim marr As Variant
                      Dim temp As Double
                      
                      With WorksheetFunction
                          If IsMissing(warray) Then
                              WCOV = COV(darray)
                          Else
                          
                              darr = darray
                              warr = warray
                              n = UBound(darr, 1)
                              k = UBound(darr, 2)
                              w = .Sum(warray)
                              
                              For i = 1 To n
                                  warr(i, 1) = warr(i, 1) / w
                              Next
                              
                              ReDim d(1 To k, 1 To n)
                              ReDim carr(1 To k, 1 To k)
                              
                              For j = 1 To k
                                  temp = 0#
                                  For i = 1 To n
                                      temp = temp + darr(i, j) * warr(i, 1)
                                  Next
                                  For i = 1 To n
                                      d(j, i) = warr(i, 1) * (darr(i, j) - temp)
                                  Next
                              Next
                              
                              carr = .MMult(d, darr)
                              
                              If rel Then
                                  v = 1 / (1 - .SumSq(warr))
                              Else
                                  v = 1 / (w - 1)
                              End If
                              
                              For i = 1 To k
                                  For j = 1 To k
                                      carr(i, j) = v * carr(i, j)
                                  Next
                              Next
                              
                          End If
                      End With
                      
                      WCOV = carr
                      
                  End Function
                  
                  Function IQR(array1 As Variant, Optional bexc As Boolean = False) As Double
                  Attribute IQR.VB_Description = "returns the interquartile range of array1"
                  Attribute IQR.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return interquartile range; use QUARTILE_EXC for case with bexc = True
                      With Application.WorksheetFunction
                          If bexc Then
                              IQR = .QUARTILE_EXC(array1, 3) - .QUARTILE_EXC(array1, 1)
                          Else
                              IQR = .Quartile_Inc(array1, 3) - .Quartile_Inc(array1, 1)
                          End If
                      End With
                  End Function
                  
                  Function RNG(array1 As Variant) As Double
                  Attribute RNG.VB_Description = "returns the range of array1"
                  Attribute RNG.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return range
                      With Application.WorksheetFunction
                          RNG = .Max(array1) - .Min(array1)
                      End With
                  End Function
                  
                  Function MAD(array1 As Variant, Optional harrell As Boolean = False) As Double
                  Attribute MAD.VB_Description = "returns the median absolute deviation (from the median) of the elements in array1"
                  Attribute MAD.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return the median of absolute deviations of the values in array1 from the mean
                      Dim matrix As Variant
                      If TypeOf array1 Is Range Then
                          matrix = array1
                          MAD = fMAD(matrix, harrell)
                      Else
                          If fDim(array1) <= 0 Then
                              MAD = fMAD(array1, harrell)
                          Else
                              MAD = fMAD(Application.WorksheetFunction.Transpose(array1), harrell)
                          End If
                      End If
                  End Function
                  
                  Private Function fMAD(ByVal matrix As Variant, harrell As Boolean) As Double
                  ' return the median of absolute deviations of the values in matrix from the mean
                  
                      Dim i As Long
                      Dim j As Long
                      Dim m As Long
                      Dim n As Long
                      Dim p As Long
                      
                      If fDim(matrix) = 0 Then
                          fMAD = 0
                          Exit Function
                      End If
                      
                      m = UBound(matrix, 1)
                      n = UBound(matrix, 2)
                      Dim middle As Double
                      If harrell Then
                          middle = HD_QUANTILE(matrix, 0.5)
                      Else
                          middle = Application.WorksheetFunction.Median(matrix)
                      End If
                      Dim vector As Variant
                      ReDim vector(1 To 1, 1 To m * n)
                      
                      p = 0
                      For i = 1 To m
                          For j = 1 To n
                              p = p + 1
                              If IsNumeric(matrix(i, j)) And matrix(i, j) <> "" Then
                                  vector(1, p) = Abs(matrix(i, j) - middle)
                              Else
                                  vector(1, p) = ""
                              End If
                          Next
                      Next
                      If harrell Then
                          fMAD = HD_QUANTILE(vector, 0.5)
                      Else
                          fMAD = Application.WorksheetFunction.Median(vector)
                      End If
                      
                  End Function
                  
                  Function DoubleMAD(array1 As Variant, lower As Boolean, Optional harrell As Boolean = False) As Double
                  Attribute DoubleMAD.VB_Description = "returns the Double MAD for the data in array1"
                  Attribute DoubleMAD.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return the double median of absolute deviations of the values in array1 from the median
                  
                      Dim arr As Variant
                      Dim m As Long
                      Dim n As Long
                      Dim k As Long   ' # of qualifying elements
                      Dim i As Long
                      Dim j As Long
                      Dim middle As Double
                      
                      With WorksheetFunction
                          If fDim(array1) <= 0 Then
                              arr = array1
                          Else
                              arr = .Transpose(array1)
                          End If
                          If harrell Then
                              middle = HD_QUANTILE(arr, 0.5)
                          Else
                              middle = .Median(array1)
                          End If
                      End With
                      
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      
                      k = 0
                      If lower Then
                          For i = 1 To m
                              For j = 1 To n
                                  If arr(i, j) <> "" And arr(i, j) <= middle Then k = k + 1
                              Next
                          Next
                      Else
                          For i = 1 To m
                              For j = 1 To n
                                  If arr(i, j) <> "" And arr(i, j) >= middle Then k = k + 1
                              Next
                          Next
                      End If
                      
                      ReDim mat(1 To k, 1 To 1) As Double
                      
                      k = 0
                      If lower Then
                          For i = 1 To m
                              For j = 1 To n
                                  If arr(i, j) <> "" And arr(i, j) <= middle Then
                                      k = k + 1
                                      mat(k, 1) = middle - arr(i, j)
                                  End If
                              Next
                          Next
                      Else
                          For i = 1 To m
                              For j = 1 To n
                                  If arr(i, j) <> "" And arr(i, j) >= middle Then
                                      k = k + 1
                                      mat(k, 1) = arr(i, j) - middle
                                  End If
                              Next
                          Next
                      End If
                      
                      If harrell Then
                          DoubleMAD = HD_QUANTILE(mat, 0.5)
                      Else
                          DoubleMAD = WorksheetFunction.Median(mat)
                      End If
                      
                  End Function
                  
                  Function RANK_AVG(x As Variant, array1 As Variant, Optional order As Double = 0, Optional num_digits As Long = 8) As Variant
                  Attribute RANK_AVG.VB_Description = "returns the rank of x in array1; if more than one value has the same rank then these are averaged"
                  Attribute RANK_AVG.VB_ProcData.VB_Invoke_Func = " \n35"
                      ' return the rank of x (or all elements in x if x is an array or range) among all the elements in array1 (as in RANK.AVG)
                      Dim mat As Variant
                      If TypeOf x Is Range Then
                          mat = x
                          RANK_AVG = RRANK_AVG(mat, array1, order, num_digits)
                      Else
                          RANK_AVG = RRANK_AVG(x, array1, order, num_digits)
                      End If
                      
                  End Function
                  
                  Private Function RRANK_AVG(x As Variant, array1 As Variant, order As Double, num_digits As Long) As Variant
                      ' return the rank of x (or all elements in x if x is an array or range) among all the elements in array1 (as in RANK.AVG)
                      
                      Dim m As Long           ' # of rows in x (if array or range)
                      Dim n As Long           ' # of cols in x (if array or range)
                      Dim i As Long
                      Dim j As Long
                      Dim mat As Variant      ' output
                      
                      If fDim(x) = 0 Then          ' scalar
                          mat = gRANK_AVG(x, array1, order, num_digits)
                      ElseIf fDim(mat) = 1 Then    ' row array
                          m = UBound(x, 1)
                          ReDim mat(1 To 1, 1 To m)
                          For j = 1 To m
                              mat(1, j) = gRANK_AVG(x(j), array1, order, num_digits)
                          Next
                      Else
                          m = UBound(x, 1)
                          n = UBound(x, 2)
                          ReDim mat(1 To m, 1 To n)
                          For j = 1 To n
                              For i = 1 To m
                                  mat(i, j) = gRANK_AVG(x(i, j), array1, order, num_digits)
                              Next
                          Next
                      End If
                      
                      RRANK_AVG = mat
                      
                  End Function
                  
                  Private Function gRANK_AVG(x As Variant, array1 As Variant, order As Double, num_digits As Long) As Variant
                      ' return the rank of x among all the elements in array1 (as in RANK.AVG)
                      
                      Dim mat As Variant
                      
                      If TypeOf array1 Is Range Then
                          If num_digits < 0 Then
                              gRANK_AVG = Application.WorksheetFunction.Rank_Eq(x, array1, order) + (Application.WorksheetFunction.CountIf(array1, x) - 1) / 2
                          Else
                              mat = array1
                              If fDim(mat) < 0 Then        ' two-dimensional array (includes column array)
                                  gRANK_AVG = fRANK_AVG(x, mat, order, num_digits)
                              ElseIf fDim(mat) = 1 Then    ' row array
                                  gRANK_AVG = fRANK_AVG(x, Application.WorksheetFunction.Transpose(mat), order, num_digits)
                              Else                         ' scalar
                                  If x = CDbl(mat) Then
                                      gRANK_AVG = 1
                                  Else
                                      gRANK_AVG = CVErr(xlErrNA)
                                  End If
                              End If
                          End If
                      Else
                          If fDim(array1) < 0 Then        ' two-dimensional array (includes column array)
                              gRANK_AVG = fRANK_AVG(x, array1, order, num_digits)
                          ElseIf fDim(array1) = 1 Then    ' row array
                              gRANK_AVG = fRANK_AVG(x, Application.WorksheetFunction.Transpose(array1), order, num_digits)
                          Else                            ' scalar
                              If x = CDbl(array1) Then
                                  gRANK_AVG = 1
                              Else
                                  gRANK_AVG = CVErr(xlErrNA)
                              End If
                          End If
                      End If
                      
                  End Function
                  
                  Private Function fRANK_AVG(x As Variant, array1 As Variant, order As Double, num_digits As Long) As Variant
                  ' return the rank of x among all the elements in array1 (as in RANK.AVG)
                  
                      Dim i As Long
                      Dim j As Long
                      Dim m As Long
                      Dim n As Long
                      m = UBound(array1, 1)
                      n = UBound(array1, 2)
                      
                      Dim tot As Long         ' number of numeric elements in array1
                      Dim higher As Long      ' number of elements in array1 > x
                      Dim ties As Long        ' number of elements in array1 = x
                      Dim xx As Double        ' x rounded
                      Dim temp As Double      ' array1(i,j) rounded
                      tot = 0
                      higher = 0
                      ties = 0
                      
                      If num_digits < 0 Then
                          For i = 1 To m
                              For j = 1 To n
                                  If IsNumeric(array1(i, j)) And array1(i, j) <> "" Then
                                      tot = tot + 1
                                      If array1(i, j) > x Then
                                          higher = higher + 1
                                      ElseIf array1(i, j) = x Then
                                          ties = ties + 1
                                      End If
                                  End If
                              Next
                          Next
                      Else
                          xx = Round(x, num_digits)
                          For i = 1 To m
                              For j = 1 To n
                                  If IsNumeric(array1(i, j)) And array1(i, j) <> "" Then
                                      temp = Round(array1(i, j), num_digits)
                                      tot = tot + 1
                                      If temp > xx Then
                                          higher = higher + 1
                                      ElseIf temp = xx Then
                                          ties = ties + 1
                                      End If
                                  End If
                              Next
                          Next
                      End If
                      
                      If ties <= 0 Then
                          fRANK_AVG = CVErr(xlErrNA)
                      ElseIf order = 0 Then
                          fRANK_AVG = higher + (ties + 1) * 0.5
                      Else
                          fRANK_AVG = tot - higher - (ties - 1) * 0.5
                      End If
                      
                  End Function
                  
                  Function RANKS(array1 As Variant, Optional order As Double = 0, Optional num_digits As Long = -1) As Variant
                  Attribute RANKS.VB_Description = "returns a column array with the ranks of all the numeric elements in array1"
                  Attribute RANKS.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return a column array with the ranks of all the elements in array1 (as in RANK_AVG)
                  
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim nn As Long          ' # of numeric values in array1
                      nn = Application.WorksheetFunction.Count(array1)
                      Dim m As Long           ' # of rows in array1
                      Dim n As Long           ' # of columns in array1
                      Dim arr As Variant      ' array1 as an array
                      arr = array1
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      Dim arr1 As Variant     ' array1 as a column array with only numeric values, rounded off if necessary
                      ReDim arr1(1 To nn)
                  
                      ' fill arr1
                      k = 0
                      If num_digits < 0 Then
                          For j = 1 To n
                              For i = 1 To m
                                  If IsNumeric(arr(i, j)) And arr(i, j) <> "" Then
                                      k = k + 1
                                      arr1(k) = arr(i, j)
                                  End If
                              Next
                          Next
                      Else
                          For j = 1 To n
                              For i = 1 To m
                                  If IsNumeric(arr(i, j)) And arr(i, j) <> "" Then
                                      k = k + 1
                                      arr1(k) = Round(arr(i, j), num_digits)
                                  End If
                              Next
                          Next
                      End If
                              
                      ' fill output
                      Dim outp As Variant     ' output array
                      ReDim outp(1 To nn, 1 To 1)
                      
                      ' calculate the rank assuming order = 0
                      Dim r As Long           ' twice # of elements in array1 > x + # of elements in array1 = x
                      Dim temp As Double
                      For k = 1 To nn
                          r = 1
                          temp = arr1(k)
                          For j = 1 To nn
                              If temp < arr1(j) Then
                                  r = r + 2
                              ElseIf temp = arr1(j) Then
                                  r = r + 1
                              End If
                          Next
                          outp(k, 1) = r / 2
                      Next
                      
                      ' change rank based on order if necessary
                      If order <> 0 Then
                          For k = 1 To nn
                              outp(k, 1) = nn - outp(k, 1) + 1
                          Next
                      End If
                      
                      RANKS = outp
                      
                  End Function
                  
                  Function RANKCOL(array1 As Variant, Optional order As Double = 0, Optional num_digits As Long = -1) As Variant
                  Attribute RANKCOL.VB_Description = "returns an array of the same size and shape as array1 with the ranks of all the elements in each column of array1"
                  Attribute RANKCOL.VB_ProcData.VB_Invoke_Func = " \n35"
                  ' return an array of the same size and shape as array1 with the ranks of all the elements in each column of array1 (as in RANK_AVG)
                  
                      Dim i As Long
                      Dim j As Long
                      Dim m As Long           ' # of rows in array1
                      Dim n As Long           ' # of columns in array1
                      Dim arr As Variant      ' array1 as an array
                      arr = array1
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      Dim arr0 As Variant     ' one column of array1
                      ReDim arr0(1 To m, 1 To 1)
                      Dim arr1 As Variant     ' one column of the output
                      ReDim arr1(1 To m, 1 To 1)
                      Dim outp As Variant     ' output
                      ReDim outp(1 To m, 1 To n)
                      
                      For j = 1 To n
                          For i = 1 To m
                              If arr(i, 1) <> "" Then
                                  arr0(i, 1) = arr(i, j)
                              Else
                                  arr0(i, 1) = ""
                              End If
                          Next
                          arr1 = RANK_AVG(arr0, arr0, order, num_digits)
                          For i = 1 To m
                              If arr1(i, 1) <> "" Then
                                  outp(i, j) = arr1(i, 1)
                              Else
                                  outp(i, j) = ""
                              End If
                          Next
                      Next
                      RANKCOL = outp
                  
                  End Function
                  
                  Function SMALLExact(array1 As Variant, k As Double) As Double
                  Attribute SMALLE

                  General
                  Stream Path:VBA/DescriptorAnova
                  VBA File Name:DescriptorAnova
                  Stream Size:48845
                  Data ASCII:. . . . . . . . _ . . . . . . . . / ` . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . ] . . . . R . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 c2 5f 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 2f 60 00 00 d3 aa 00 00 05 00 00 00 01 00 00 00 d4 1f df a3 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorAnova"
                  Sub ANOVA_Descriptors()
                      Call SSW_Descriptor
                      Call dfW_Descriptor
                      Call MSW_Descriptor
                      Call SSBet_Descriptor
                      Call dfBet_Descriptor
                      Call MSBet_Descriptor
                      Call SSWF_Descriptor
                      Call dfWF_Descriptor
                      Call MSWF_Descriptor
                      Call SSRow_Descriptor
                      Call dfRow_Descriptor
                      Call MSRow_Descriptor
                      Call SSCol_Descriptor
                      Call dfCol_Descriptor
                      Call MSCol_Descriptor
                      Call SSInt_Descriptor
                      Call dfInt_Descriptor
                      Call MSInt_Descriptor
                      Call SSTot_Descriptor
                      Call dfTot_Descriptor
                      Call MSTot_Descriptor
                      Call ANOVA1_Descriptor
                      Call ANOVARow_Descriptor
                      Call ANOVACol_Descriptor
                      Call ANOVAInt_Descriptor
                      Call ATEST_Descriptor
                      Call ATESTRow_Descriptor
                      Call ATESTCol_Descriptor
                      Call ATESTInt_Descriptor
                      Call SSWStd_Descriptor
                      Call SSBetStd_Descriptor
                      Call SSTotStd_Descriptor
                      Call SSWFStd_Descriptor
                      Call SSRowStd_Descriptor
                      Call SSColStd_Descriptor
                      Call SSIntStd_Descriptor
                      Call QCRIT_Descriptor
                      Call QPROB_Descriptor
                      Call DCRIT_Descriptor
                      Call DPROB_Descriptor
                      Call DCRIT1_Descriptor
                  End Sub
                  
                  Sub SSW_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="SSW", Description:="returns SSW for one-way ANOVA",         category:="Anova", StatusBar:="returns SSW for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfW_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="dfW", Description:="returns dfW for one-way ANOVA",         category:="Anova", StatusBar:="returns dfW for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSW_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="MSW", Description:="returns MSW for one-way ANOVA",         category:="Anova", StatusBar:="returns MSW for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSBet_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="SSBet", Description:="returns SSBet for one-way ANOVA",         category:="Anova", StatusBar:="returns SSBet for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfBet_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="dfBet", Description:="returns dfBet for one-way ANOVA",         category:="Anova", StatusBar:="returns dfBet for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSBet_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="MSBet", Description:="returns MSBet for one-way ANOVA",         category:="Anova", StatusBar:="returns MSBet for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSWF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="SSWF", Description:="returns SSW for two-way ANOVA",         category:="Anova", StatusBar:="returns SSW for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfWF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="dfWF", Description:="returns dfW for two-way ANOVA",         category:="Anova", StatusBar:="returns dfW for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSWF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="MSWF", Description:="returns MSW for two-way ANOVA",         category:="Anova", StatusBar:="returns MSW for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSRow_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="SSRow", Description:="returns SSRow for two-way ANOVA",         category:="Anova", StatusBar:="returns SSRow for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfRow_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="dfRow", Description:="returns dfRow for two-way ANOVA",         category:="Anova", StatusBar:="returns dfRow for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSRow_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="MSRow", Description:="returns MSRow for two-way ANOVA",         category:="Anova", StatusBar:="returns MSRow for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSCol_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      Application.MacroOptions Macro:="SSCol", Description:="returns SSCol for two-way ANOVA",         category:="Anova", StatusBar:="returns SSCol for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfCol_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      Application.MacroOptions Macro:="dfCol", Description:="returns dfCol for two-way ANOVA",         category:="Anova", StatusBar:="returns dfCol for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSCol_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      Application.MacroOptions Macro:="MSCol", Description:="returns MSCol for two-way ANOVA",         category:="Anova", StatusBar:="returns MSCol for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSInt_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="SSInt", Description:="returns SSInt for two-way ANOVA",         category:="Anova", StatusBar:="returns SSInt for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfInt_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="dfInt", Description:="returns dfInt for two-way ANOVA",         category:="Anova", StatusBar:="returns dfInt for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSInt_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="MSInt", Description:="returns MSInt for two-way ANOVA",         category:="Anova", StatusBar:="returns MSInt for two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSTot_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="SSTot", Description:="returns SSTot for one-way or two-way ANOVA",         category:="Anova", StatusBar:="returns SSTot for one-way or two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfTot_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="dfTot", Description:="returns dfTot for one-way or two-way ANOVA",         category:="Anova", StatusBar:="returns dfTot for one-way or two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSTot_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range"
                      Application.MacroOptions Macro:="MSTot", Description:="returns MSTot for one-way or two-way ANOVA",         category:="Anova", StatusBar:="returns MSTot for one-way or two-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVA1_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="ANOVA1", Description:="returns F statistic for one-way ANOVA",         category:="Anova", StatusBar:="returns F statistic for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ATEST_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format"
                      argDescription(1) = "if TRUE (default) then ANOVA is grouped by columns; otherwise by rows"
                      Application.MacroOptions Macro:="ATEST", Description:="returns p-value for one-way ANOVA",         category:="Anova", StatusBar:="returns p-value for one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVARow_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ANOVARow", Description:="returns F statistic for two-way ANOVA for row factor",         category:="Anova", StatusBar:="returns F statistic for two-way ANOVA for row factor",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ATESTRow_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ATESTRow", Description:="returns p-value for two-way ANOVA for row factor",         category:="Anova", StatusBar:="returns p-value for two-way ANOVA for row factor",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVACol_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ANOVACol", Description:="returns F statistic for two-way ANOVA for column factor",         category:="Anova", StatusBar:="returns F statistic for two-way ANOVA for column factor",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ATESTCol_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ATESTCol", Description:="returns p-value for two-way ANOVA for column factor",         category:="Anova", StatusBar:="returns p-value for two-way ANOVA for column factor",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVAInt_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ANOVAInt", Description:="returns F statistic for two-way ANOVA for the interaction between the row and column factors",         category:="Anova", StatusBar:="returns F statistic for two-way ANOVA for the interaction between the row and column factors",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ATESTInt_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data in two-way ANOVA Excel format"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="ATESTInt", Description:="returns p-value for two-way ANOVA for the interaction between the row and column factors",         category:="Anova", StatusBar:="returns p-value for two-way ANOVA for the interaction between the row and column factors",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSWStd_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range for ANOVA data in stacked format"
                      argDescription(1) = "number of a column in array1 (default 2)"
                      Application.MacroOptions Macro:="SSWStd", Description:="returns SSW for one-way ANOVA for the factor corresponding to column col in array1",         category:="Anova", StatusBar:="returns SSW for one-way ANOVA for the factor corresponding to column col in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSBetStd_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range for ANOVA data in stacked format"
                      argDescription(1) = "number of a column in array1 (default 2)"
                      Application.MacroOptions Macro:="SSBetStd", Description:="returns SSBet for one-way ANOVA for the factor corresponding to column col in array1",         category:="Anova", StatusBar:="returns SSBet for one-way ANOVA for the factor corresponding to column col in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSTotStd_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range for ANOVA data in stacked format"
                      argDescription(1) = "number of a column in array1 (default 2)"
                      Application.MacroOptions Macro:="SSTotStd", Description:="returns SSTot for one-way ANOVA for the factor corresponding to column col in array1; can be used for two-way ANOVA when col = 3",         category:="Anova", StatusBar:="returns SSTot for one-way ANOVA for the factor corresponding to column col in array1; can be used for two-way ANOVA when col = 3",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSWFStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range for two-way ANOVA data in stacked format"
                      Application.MacroOptions Macro:="SSWFStd", Description:="returns SSW for two-way ANOVA for the data in array1",         category:="Anova", StatusBar:="returns SSW for two-way ANOVA for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSRowStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range for two-way ANOVA data in stacked format"
                      Application.MacroOptions Macro:="SSRowStd", Description:="returns SSRow for two-way ANOVA for the data in array1",         category:="Anova", StatusBar:="returns SSRow for two-way ANOVA for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSColStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range for two-way ANOVA data in stacked format"
                      Application.MacroOptions Macro:="SSColStd", Description:="returns SSCol for two-way ANOVA for the data in array1",         category:="Anova", StatusBar:="returns SSCol for two-way ANOVA for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSIntStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range for two-way ANOVA data in stacked format"
                      Application.MacroOptions Macro:="SSIntStd", Description:="returns SSInt for two-way ANOVA for the data in array1",         category:="Anova", StatusBar:="returns SSInt for two-way ANOVA for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QCRIT_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "positive integer (# of groups)"
                      argDescription(1) = "positive integer (degrees of freedom)"
                      argDescription(2) = "significance level (default .05)"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "if TRUE (default) use recommended interpolation; otherwise use linear interpolation"
                      Application.MacroOptions Macro:="QCRIT", Description:="returns critical value in Studentized Q Table for given values of k, df, alpha and tails",         category:="Anova", StatusBar:="returns critical value in Studentized Q for given values of k, df, alpha and tails",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QPROB_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "positive integer (# of groups)"
                      argDescription(2) = "positive integer (degrees of freedom)"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "# of iterations (default 40)"
                      argDescription(5) = "if TRUE (default) use recommended interpolation; otherwise use linear interpolation"
                      Application.MacroOptions Macro:="QPROB", Description:="returns estimated p-value for Studentized Q distribution at x based on iterating in Studentized Q Table of critical values",         category:="Anova", StatusBar:="returns estimated p-value for Studentized Q distribution at x based on iterating in Studentized Q Table of critical values",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DCRIT_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "positive integer (# of groups)"
                      argDescription(1) = "positive integer (degrees of freedom)"
                      argDescription(2) = "significance level (default .05)"
                      argDescription(3) = "if TRUE (default) use recommended interpolation; otherwise use linear interpolation"
                      Application.MacroOptions Macro:="DCRIT", Description:="returns critical value in Dunnett's Test Table for given values of k, df and alpha for a two-tailed test",         category:="Anova", StatusBar:="returns critical value in Dunnett's Test Table for given values of k, df and alpha for a two-tailed test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DPROB_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "positive integer (# of groups)"
                      argDescription(2) = "positive integer (degrees of freedom)"
                      argDescription(3) = "# of iterations (default 40)"
                      argDescription(4) = "if TRUE (default) use recommended interpolation; otherwise use linear interpolation"
                      Application.MacroOptions Macro:="DPROB", Description:="returns estimated p-value for Dunnett's test at x based on iterating in Dunnett's Test Table of critical values",         category:="Anova", StatusBar:="returns estimated p-value for Dunnett's te

                  General
                  Stream Path:VBA/DescriptorCorrelation
                  VBA File Name:DescriptorCorrelation
                  Stream Size:65769
                  Data ASCII:. . . . . . . . h . . . . . . . . g i . . O . . . . . . . . . . . > w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . f . . . . N . X . . . . . . `
                  Data Raw:01 16 03 00 06 f0 00 00 00 fa 68 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 67 69 00 00 4f dd 00 00 00 00 00 00 01 00 00 00 d4 1f 3e 77 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorCorrelation"
                  Sub Correlation_Descriptors()
                      Call COV_Descriptor
                      Call COVP_Descriptor
                      Call CORR_Descriptor
                      Call PCORR_Descriptor
                      Call COVARS_Descriptor
                      Call COVARP_Descriptor
                      Call RSQ_ADJ_Descriptor
                      Call CORREL_ADJ_Descriptor
                      Call BCORREL_Descriptor
                      Call PCORREL_Descriptor
                      Call TCORREL_Descriptor
                      Call KCORREL_Descriptor
                      Call SCORREL_Descriptor
                      Call CorrTTest_Descriptor
                      Call CorrTest_Descriptor
                      Call CorrETest_Descriptor
                      Call CorrTLower_Descriptor
                      Call CorrTUpper_Descriptor
                      Call CorrLower_Descriptor
                      Call CorrUpper_Descriptor
                      Call CorrelTest_Descriptor
                      Call CorrelTTest_Descriptor
                      Call Correl2Test_Descriptor
                      Call Correl2OverlapTest_Descriptor
                      Call Correl2OverlapTTest_Descriptor
                      Call Corr2OverlapTest_Descriptor
                      Call Corr2OverlapTTest_Descriptor
                      Call Correl2NonOverlapTest_Descriptor
                      Call Corr2NonOverlapTest_Descriptor
                      Call MCORREL_Descriptor
                      Call PCRIT_Descriptor
                      Call TauCRIT_Descriptor
                      Call RhoCRIT_Descriptor
                      Call BOXCOX_Descriptor
                      Call BOXCOXLL_Descriptor
                      Call BOXCOXLambda_Descriptor
                      Call PART_CORREL_Descriptor
                      Call PART_KCORREL_Descriptor
                      Call SEMIPART_CORREL_Descriptor
                      Call SEMIPART_KCORREL_Descriptor
                      Call PolyChorLL_Descriptor
                  End Sub
                  
                  Sub COV_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if TRUE then non-numeric cells are ignored listwise; otherwise they are ignored pairwise"
                      Application.MacroOptions Macro:="COV", Description:="returns the sample covariance matrix for the data in range rg",         category:="Correlation", StatusBar:="returns the sample covariance matrix for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COVP_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if TRUE then non-numeric cells are ignored listwise; otherwise they are ignored pairwise"
                      Application.MacroOptions Macro:="COVP", Description:="returns the population covariance matrix for the data in range rg",         category:="Correlation", StatusBar:="returns the population covariance matrix for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORR_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if TRUE then non-numeric cells are ignored listwise; otherwise they are ignored pairwise"
                      Application.MacroOptions Macro:="CORR", Description:="returns the correlation matrix for the data in range rg",         category:="Correlation", StatusBar:="returns the correlation matrix for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PCORR_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="PCORR", Description:="returns the partial correlation matrix for the data in range array1",         category:="Correlation", StatusBar:="returns the partial correlation matrix for the data in range array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COVARS_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "array or cell range with the same number of elements as array1"
                      Application.MacroOptions Macro:="COVARS", Description:="returns the sample covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries",         category:="Correlation", StatusBar:="returns the sample covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COVARP_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "array or cell range with same number of elements as array1"
                      Application.MacroOptions Macro:="COVARP", Description:="returns the population covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries",         category:="Correlation", StatusBar:="returns the population covariance for the data in arrays array1 and array2; ignores any pairs with non-numeric entries",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RSQ_ADJ_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "(0) array or cell range or (2) numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "(1) array or cell range with same number of elements as arg1 or (2) positive numeric value (sample size)"
                      Application.MacroOptions Macro:="RSQ_ADJ", Description:="returns the adjusted R-square value",         category:="Correlation", StatusBar:="returns the adjusted R-square value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORREL_ADJ_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "(0) array or cell range or (2) numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "(1) array or cell range with same number of elements as arg1 or (2) positive numeric value (sample size)"
                      Application.MacroOptions Macro:="CORREL_ADJ", Description:="returns the adjusted population correlation coefficient",         category:="Correlation", StatusBar:="returns the adjusted population correlation coefficient",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BCORREL_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric column array or cell range containing 0's and 1's"
                      argDescription(1) = "numeric column array or cell range; contains the same number of elements as xarray"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(3) = "numeric value between 0 and 1 (significance level, default .05)"
                      Application.MacroOptions Macro:="BCORREL", Description:="returns the biserial correlation coefficient for the data in xarray and yarray, plus z-stat, p-value and ends of 1-alpha confidence interval",         category:="Correlation", StatusBar:="returns the biserial correlation coefficient for the data in xarray and yarray, plus z-stat, p-value and ends of 1-alpha confidence interval",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PCORREL_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range; rows with any non-numeric cell are ignored"
                      argDescription(1) = "numeric value (column # in array1)"
                      argDescription(2) = "numeric value (column # in array1)"
                      Application.MacroOptions Macro:="PCORREL", Description:="returns the partial correlation coefficient for variable corresponding to the ith and jth columns in array1",         category:="Correlation", StatusBar:="returns the partial correlation coefficient for variable corresponding to the ith and jth columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrTTest_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value between -1 and 1 (observed correlation coefficient)"
                      argDescription(1) = "positive integer (sample size)"
                      argDescription(2) = "1 or 2 (# of tails, default 2)"
                      Application.MacroOptions Macro:="CorrTTest", Description:="returns the p-value for the t test that r is significantly different from zero",         category:="Correlation", StatusBar:="returns the p-value for the t test that r is significantly different from zero",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrTLower_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "positive integer (sample size)"
                      argDescription(2) = "numeric value between 0 and 1 (significance level, default .05)"
                      Application.MacroOptions Macro:="CorrTLower", Description:="returns the lower bound of the confidence interval around r for two-tailed correlation t test",         category:="Correlation", StatusBar:="returns the lower bound of the confidence interval around r for two-tailed correlation t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrTUpper_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "positive integer (sample size)"
                      argDescription(2) = "numeric value between 0 and 1 (significance level, default .05)"
                      Application.MacroOptions Macro:="CorrTUpper", Description:="returns the upper bound of the confidence interval around r for two-tailed correlation t test",         category:="Correlation", StatusBar:="returns the upper bound of the confidence interval around r for two-tailed correlation t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrTest_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value between -1 and 1 (hypothetical correlation coefficient)"
                      argDescription(1) = "numeric value between -1 and 1 (observed correlation coefficient)"
                      argDescription(2) = "positive integer (sample size)"
                      argDescription(3) = "1 or 2 (# of tails, default 2)"
                      Application.MacroOptions Macro:="CorrTest", Description:="returns the p-value for the Fisher test that rho is significantly different from obs1",         category:="Correlation", StatusBar:="returns the p-value for the Fisher test that rho is significantly different from obs1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrLower_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "positive integer (sample size)"
                      argDescription(2) = "numeric value between 0 and 1 (significance level, default .05)"
                      Application.MacroOptions Macro:="CorrLower", Description:="returns the lower bound of the confidence interval around r for two-tailed Fisher correlation test",         category:="Correlation", StatusBar:="returns the lower bound of the confidence interval around r for two-tailed Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrUpper_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient)"
                      argDescription(1) = "positive integer (sample size)"
                      argDescription(2) = "numeric value between 0 and 1 (significance level, default .05)"
                      Application.MacroOptions Macro:="CorrUpper", Description:="returns the upper bound of the confidence interval around r for two-tailed Fisher correlation test",         category:="Correlation", StatusBar:="returns the upper bound of the confidence interval around r for two-tailed Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrelTest_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "(0) array or cell range or (2) numeric value between -1 and 1 (observed correlation coefficient)"
                      argDescription(1) = "(1) array or cell range with same number of elements as arg1 or (2) positive numeric value (sample size)"
                      argDescription(2) = "numeric value between -1 and 1 (hypothetical correlation coefficient)"
                      argDescription(3) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(4) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(5) = "1 or 2 (# of tails, default 2)"
                      Application.MacroOptions Macro:="CorrelTest", Description:="returns array with z stat, p-value, lower and upper confidence limits for Fisher correlation test",         category:="Correlation", StatusBar:="returns array with z stat, p-value, lower and upper confidence limits for Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrelTTest_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "(0) array or cell range or (2) numeric value between -1 and 1 (observed correlation coefficient)"
                      argDescription(1) = "(1) array or cell range with same number of elements as arg1 or (2) positive numeric value (sample size)"
                      argDescription(2) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(4) = "1 or 2 (# of tails, default 2)"
                      Application.MacroOptions Macro:="CorrelTTest", Description:="returns array with t stat, p-value, lower and upper confidence limits for correlation t test",         category:="Correlation", StatusBar:="returns array with t stat, p-value, lower and upper confidence limits for correlation t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CorrETest_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "(0) array or cell range or (2) numeric value between -1 and 1 (observed correlation coefficient)"
                      argDescription(1) = "(1) array or cell range with same number of elements as arg1 or (2) positive numeric value (sample size)"
                      argDescription(2) = "numeric value between -1 and 1 (hypothetical correlation coefficient)"
                      argDescription(3) = "1 or 2 (# of tails, default 2)"
                      Application.MacroOptions Macro:="CorrETest", Description:="returns p-value for correlation exact test",         category:="Correlation", StatusBar:="returns p-value for correlation exact test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Correl2Test_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "(0) array or cell range for first sample pair or (2) numeric value between -1 and 1 (observed correlation coefficient for first sample)"
                      argDescription(1) = "(1) array or cell range for first sample with same number of elements as arg1 or (2) positive numeric value (size of first sample)"
                      argDescription(2) = "(2) array or cell range for second sample or (2) numeric value between -1 and 1 (observed correlation coefficient for second sample)"
                      argDescription(3) = "(3) array or cell range for second sample with same number of elements as arg3 or (2) positive numeric value (size of second sample)"
                      argDescription(4) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(5) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="Correl2Test", Description:="returns array with z stat, p-value (two-tailed), lower and upper confidence limits for two independent sample Fisher correlation test",         category:="Correlation", StatusBar:="returns array with z stat, p-value (two-tailed), lower and upper confidence limits for two independent sample Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TCORREL_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "2 x 2 array or cell range with numeric values"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "TRUE (default) if method 1 is used; otherwise method 2 is used"
                      argDescription(3) = "numeric value between 0 and .5 (significance level, default .05)"
                      Application.MacroOptions Macro:="TCORREL", Description:="returns an array containing the tetrachoric correlation for the data in array1, s.e., z stat, p-value, lower and upper ends of confidence interval",         category:="Correlation", StatusBar:="returns an array containing the tetrachoric correlation for the data in array1, s.e., z stat, p-value, lower and upper ends of confidence interval",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Correl2OverlapTest_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient with overlapping sample)"
                      argDescription(1) = "numeric value between -1 and 1 (correlation coefficient with overlapping sample)"
                      argDescription(2) = "numeric value between -1 and 1 (correlation coefficient between two samples that don't overlap)"
                      argDescription(3) = "positive integer (size of each of the three samples)"
                      argDescription(4) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(5) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="Correl2OverlapTest", Description:="returns array with r12 - r13 and lower and upper confidence limits for dependent overlapping samples Fisher correlation test",         category:="Correlation", StatusBar:="returns array with r12 - r13 and lower and upper confidence limits for dependent overlapping samples Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Corr2OverlapTest_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or cell range (overlapping sample)"
                      argDescription(1) = "numeric array or cell range (non-overlapping sample); same size as array0"
                      argDescription(2) = "numeric array or cell range (non-overlapping sample); same size as array0"
                      argDescription(3) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(4) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="Corr2OverlapTest", Description:="returns array with r01 - r02 and lower and upper confidence limits for dependent overlapping samples Fisher correlation test",         category:="Correlation", StatusBar:="returns array with r01 - r02 and lower and upper confidence limits for dependent overlapping samples Fisher correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Correl2OverlapTTest_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric value between -1 and 1 (correlation coefficient with overlapping sample)"
                      argDescription(1) = "numeric value between -1 and 1 (correlation coefficient with overlapping sample)"
                      argDescription(2) = "numeric value between -1 and 1 (correlation coefficient between two samples that don't overlap)"
                      argDescription(3) = "positive integer (size of each of the three samples)"
                      argDescription(4) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(5) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="Correl2OverlapTTest", Description:="returns array with r12 - r13, t-stat, p-value and lower and upper confidence limits for dependent overlapping samples correlation t test",         category:="Correlation", StatusBar:="returns array with r12 - r13, t-stat, p-value and lower and upper confidence limits for dependent overlapping samples correlation t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Corr2OverlapTTest_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or cell range (overlapping sample)"
                      argDescription(1) = "numeric array or cell range (non-overlapping sample); same size as array0"
                      argDescription(2) = "numeric array or cell range (non-overlapping sample); same size as array0"
                      argDescription(3) = "numeric value between 0 and 1 (significance level, default .05)"
                      argDescription(4) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="Corr2OverlapTTest", Description:="returns array with r01 - r02, t-stat, p-value and lower and upper confidence limits for dependent overlapping samples correlation t test",         category:="Correlation", StatusBar:="returns array with r01 - r02, t-stat, p-value and lower and upper confidence limits for dependent overlapping samples correlation t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Correl2NonOverlapTest_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "4 x 4 n

                  General
                  Stream Path:VBA/DescriptorDesc
                  VBA File Name:DescriptorDesc
                  Stream Size:87142
                  Data ASCII:. . . . . . . . b . . . . . . . . . . . & . . . . . . . . . . . $ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . J . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 62 9a 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff cf 9a 00 00 b3 26 01 00 00 00 00 00 01 00 00 00 d4 1f 24 0b 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorDesc"
                  Sub Desc_Descriptors()
                      Call MEANCOL_Descriptor
                      Call VARCOL_Descriptor
                      Call STDEVCOL_Descriptor
                      Call SUMCOL_Descriptor
                      Call COUNTCOL_Descriptor
                      Call RANKCOL_Descriptor
                      Call MEANROW_Descriptor
                      Call VARROW_Descriptor
                      Call STDEVROW_Descriptor
                      Call SUMROW_Descriptor
                      Call COUNTROW_Descriptor
                      Call MEAN_Descriptor
                      Call MED_Descriptor
                      Call MAD_Descriptor
                      Call RNG_Descriptor
                      Call IQR_Descriptor
                      Call SKEWP_Descriptor
                      Call KURTP_Descriptor
                      Call WINMEAN_Descriptor
                      Call WINSORIZE_Descriptor
                      Call TRIM_MEAN_Descriptor
                      Call TRIMDATA_Descriptor
                      Call RANK_AVG_Descriptor
                      Call RANKS_Descriptor
                      Call FREQ2RAW_Descriptor
                      Call FREQTABLE_Descriptor
                      Call PERCENTILE_EXC_Descriptor
                      Call QUARTILE_EXC_Descriptor
                      Call STANDARD_Descriptor
                      Call GRUBBS_Descriptor
                      Call OUTLIERS_Descriptor
                      Call ESD_Descriptor
                      Call STDERR_Descriptor
                      Call VAR_POOLED_Descriptor
                      Call STDEV_POOLED_Descriptor
                      Call STDERR_POOLED_Descriptor
                      Call STDCOL_Descriptor
                      Call AUC_LOWER_Descriptor
                      Call AUC_UPPER_Descriptor
                      Call RANK_COMBINED_Descriptor
                      Call RANK_SUM_Descriptor
                      Call HUBER_Descriptor
                      Call BIWEIGHT_Descriptor
                      Call LpEST_Descriptor
                      Call LpNORM_Descriptor
                      Call GRADEVAL_Descriptor
                      Call VALGRADE_Descriptor
                      Call MEDIAN_FREQ_Descriptor
                      Call IQR_FREQ_Descriptor
                      Call MAD_FREQ_Descriptor
                      Call PERCENTILE_FREQ_Descriptor
                      Call QUARTILE_FREQ_Descriptor
                      Call SMALL_FREQ_Descriptor
                      Call HD_QUANTILE_Descriptor
                      Call DoubleMAD_Descriptor
                      Call SMALLExact_Descriptor
                      Call XSTANDARDIZE_Descriptor
                      Call KL_DIVERGE_Descriptor
                      Call JS_DIVERGE_Descriptor
                      Call CS_DIVERGE_Descriptor
                      Call PairwiseRanks_Descriptor
                  End Sub
                  
                  Sub MEANCOL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="MEANCOL", Description:="returns a row array whose elements consist of the means of the columns in array1",         category:="Desc", StatusBar:="returns an row array whose elements consist of the means of the columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MEANROW_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="MEANROW", Description:="returns a column array whose elements consist of the means of the rows in array1",         category:="Desc", StatusBar:="returns a column array whose elements consist of the means of the rows in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VARCOL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="VARCOL", Description:="returns a row array whose elements consist of the variances of the columns in array1",         category:="Desc", StatusBar:="returns a row array whose elements consist of the variances of the columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VARROW_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="VARROW", Description:="returns a column array whose elements consist of the variances of the rows in array1",         category:="Desc", StatusBar:="returns a column array whose elements consist of the variances of the rows in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STDEVCOL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="STDEVCOL", Description:="returns a row array whose elements consist of the standard deviations of the columns in array1",         category:="Desc", StatusBar:="returns a row array whose elements consist of the standard deviations of the columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STDEVROW_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range"
                      Application.MacroOptions Macro:="STDEVROW", Description:="returns a column array whose elements consist of the standard deviations of the rows in rg",         category:="Desc", StatusBar:="returns a column array whose elements consist of the standard deviations of the rows in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SUMCOL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="SUMCOL", Description:="returns a row array whose elements consist of the sum of the elements in each column of array1",         category:="Desc", StatusBar:="returns a row array whose elements consist of the sum of the elements in each column of array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SUMROW_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range"
                      Application.MacroOptions Macro:="SUMROW", Description:="returns a column array whose elements consist of the sum of the elements in each row of rg",         category:="Desc", StatusBar:="returns a column array whose elements consist of the sum of the elements in each row of rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COUNTCOL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="COUNTCOL", Description:="returns a row array whose elements consist of the count of the elements in each column of array1",         category:="Desc", StatusBar:="returns a row array whose elements consist of the counts of the columns of array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COUNTROW_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range"
                      Application.MacroOptions Macro:="COUNTROW", Description:="returns a column array whose elements consist of the count of the elements in each row of rg",         category:="Desc", StatusBar:="returns a column array whose elements consist of the variances of the count of the elements in each row of rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MEAN_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric data array or range"
                      argDescription(1) = "optional array or range with non-negative values (weights); same size and shape as darray"
                      Application.MacroOptions Macro:="MEAN", Description:="returns the mean of the elements in darray; if warray is present then the weighted mean is returned",         category:="Desc", StatusBar:="returns the mean of the elements in darray; if warray is present then the weighted mean is returned",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MED_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric data array or range"
                      argDescription(1) = "optional array or range with non-negative values (weights); same size and shape as darray"
                      argDescription(2) = "optional numeric value between 0 and 1 (percentile); default .5 for median"
                      Application.MacroOptions Macro:="MED", Description:="returns the median/percentile of the elements in darray; if warray is present then the weighted median/percentile is returned",         category:="Desc", StatusBar:="returns the median/percentile of the elements in darray; if warray is present then the weighted median/percentile is returned",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MAD_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="MAD", Description:="returns the median absolute deviation (from the median) of the elements in array1",         category:="Desc", StatusBar:="returns the median absolute deviation (from the median) of the elements in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RNG_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="RNG", Description:="returns the range of array1",         category:="Desc", StatusBar:="returns the range of array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub IQR_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if TRUE use exclusive version; otherwise use inclusive version"
                      Application.MacroOptions Macro:="IQR", Description:="returns the interquartile range of array1",         category:="Desc", StatusBar:="returns the interquartile range of array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WINMEAN_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if p1 < 0 then percentage of the top and bottom data values to be Winsorized; otherwise percentage of bottom data values to be Winsorized"
                      argDescription(2) = "percentage of the top data values to be Winsorized; ignore if p1 < 0 or is omitted"
                      Application.MacroOptions Macro:="WINMEAN", Description:="returns the mean of the Winsorized array1 based on percentage p",         category:="Desc", StatusBar:="returns the mean of the Winsorized array1 based on percentage p",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WINSORIZE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if p1 < 0 then percentage of the top and bottom data values to be Winsorized; otherwise percentage of bottom data values to be Winsorized"
                      argDescription(2) = "percentage of the top data values to be Winsorized; ignore if p1 < 0 or is omitted"
                      Application.MacroOptions Macro:="WINSORIZE", Description:="returns the Winsorized version of array1 based on percentage p",         category:="Desc", StatusBar:="returns the Winsorized version of array1 based on percentage p",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TRIM_MEAN_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if p1 < 0 then percentage of the top and bottom data values to be eliminated; otherwise percentage of bottom data values to be eliminated"
                      argDescription(2) = "percentage of the top data values to be eliminated; ignore if p1 < 0 or is omitted"
                      Application.MacroOptions Macro:="TRIM_MEAN", Description:="returns the mean of the trimmeded array1 based on percentage p",         category:="Desc", StatusBar:="returns the mean of the trimmeded array1 based on percentage p",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TRIMDATA_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if p1 < 0 then percentage of the top and bottom data values to be eliminated; otherwise percentage of bottom data values to be eliminated"
                      argDescription(2) = "percentage of the top data values to be eliminated; ignore if p1 < 0 or is omitted"
                      Application.MacroOptions Macro:="TRIMDATA", Description:="returns the trimmed version of rg based on percentage p",         category:="Desc", StatusBar:="returns the trimmed version of rg based on percentage p",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SKEWP_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="SKEWP", Description:="returns the skewness of the distribution based on the population in array1",         category:="Desc", StatusBar:="returns the skewness of the distribution based on the population in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KURTP_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if TRUE (default) 3 is subtracted to make the kurtosis of a normal distribution zero; otherwise 3 is not subtracted"
                      Application.MacroOptions Macro:="KURTP", Description:="returns the kurtosis of the distribution based on the population in array1",         category:="Desc", StatusBar:="returns the kurtosis of the distribution based on the population in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RANK_AVG_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "numeric value; if 0 or omitted then ranking is in descending order; otherwise it is in ascending order"
                      argDescription(3) = "numeric value (default is 8); x and all values in array1 are rounded to these many decimal digits; if zero then no rounding is done"
                      Application.MacroOptions Macro:="RANK_AVG", Description:="returns the rank of x in array1; if more than one value has the same rank then these are averaged",         category:="Desc", StatusBar:="returns the rank of x in array1; if more than one value has the same rank then these are averaged",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FREQ2RAW_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range containing data values (if farray is missing then last column of darray functions as farray)"
                      argDescription(1) = "numeric column array or range with same number of rows as darray containing frequencies for the values in darray; darray can be omitted"
                      Application.MacroOptions Macro:="FREQ2RAW", Description:="returns an array with the raw values corresponding to the frequency table in darray and farray",         category:="Desc", StatusBar:="returns an array with the raw values corresponding to the frequency table in darray and farray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FREQTABLE_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric column array or range containing values or if array2 is missing then array1 is a two column array or range containing both values and frequencies"
                      argDescription(1) = "numeric column array or range containing frequencies for the values in array1; array2 can be omitted"
                      Application.MacroOptions Macro:="FREQTABLE", Description:="returns a column array with the raw values corresponding to the frequency table in array1 and array2",         category:="Desc", StatusBar:="returns a column array with the raw values corresponding to the frequency table in array1 and array2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PERCENTILE_EXC_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "numeric value between 0 and 1"
                      argDescription(2) = "integer from 1 to 9 selecting a Hyndman-Fan method; default 6 (equivalent to PERCENTILE.EXC)"
                      Application.MacroOptions Macro:="PERCENTILE_EXC", Description:="returns pth percentile in array1",         category:="Desc", StatusBar:="returns pth percentile in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QUARTILE_EXC_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "0, 1, 2, 3 or 4"
                      argDescription(2) = "integer from 1 to 9 selecting a Hyndman-Fan method; default 6 (equivalent to QUARTILE.EXC)"
                      Application.MacroOptions Macro:="QUARTILE_EXC", Description:="returns quartile quart in array1",         category:="Desc", StatusBar:="returns quartile quart in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STANDARD_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "0 or 1; if 0 (default) then return STANDARDIZE(x,AVERAGE(array1),STDEV.S(array1)); if 1 then return (x-Q3)/IQR or (Q1-x)/IQR"
                      argDescription(3) = "if TRUE use exclusive version; otherwise use inclusive version"
                      Application.MacroOptions Macro:="STANDARD", Description:="returns the standardized value of x as defined by ttype",         category:="Desc", StatusBar:="returns the standardized value of x as defined by ttype",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub OUTLIERS_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "significance level, number between 0 and 1 (default .05)"
                      argDescription(2) = "# of potential outliers; defaults to # of rows in highlighted range"
                      Application.MacroOptions Macro:="OUTLIERS", Description:="returns a column array with up to k potential outliers based on the ESD algorithm",         category:="Desc", StatusBar:="returns a column array with up to k potential outliers based on the ESD algorithm",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GRUBBS_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(2) = "significance level, number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="GRUBBS", Description:="returns a column array with values potential outlier, G-stat, G-crit, significance (yes or no) based on the Grubbs' algorithm",         category:="Desc", StatusBar:="returns a column array with values potential outlier, G-stat, G-crit, significance (yes or no) based on the Grubbs' algorithm",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ESD_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(2) = "significance level, number between 0 and 1 (default .05)"
                      argDescription(3) = "# of potential outliers; defaults to # of columns in highlighted range (plus 1 if lab = TRUE)"
                      Application.MacroOptions Macro:="ESD", Description:="returns a 4 x k array (4 x k+1 if lab = TRUE); each column contains potential outlier, G-stat, G-crit, significance (yes or no) based on the ESD algorithm",         category:="Desc", StatusBar:="returns an 4 x k array (4 x k+1 if lab = TRUE); each column contains potential outlier, G-stat, G-crit, significance (yes or no) based on the ESD algorithm",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STDERR_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or range with numeric values"
                      Application.MacroOptions Macro:="STDERR", Description:="returns standard error of the mean for the data in array1",         category:="Desc", StatusBar:="standard error of the mean for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VAR_POOLED_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or range with numeric values"
                      argDescription(1) = "array or range with numeric values"
                      Application.MacroOptions Macro:="VAR_POOLED", Description:="returns the pooled variance for the samples in array1 and array2",         category:="Desc", StatusBar:="returns the pooled variance for the samples in array1 and array2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STDEV_POOLED_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or range with numeric values"
                      argDescription(1) = "array or range with numeric values"
                      Application.MacroOptions Macro:="STDEV_POOLED", Description:="returns the pooled standard deviation for the samples in array1 and array2",         category:="Desc", StatusBar:="returns the pooled standard deviation for the samples in array1 and array2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub STDERR_POOLED_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range with numeric values"
                      argDescription(1) = "array or range with numeric values"
                      argDescription(2) = "if TRUE (default) use formula for equal variances; otherwise use formula for unequal variances"
                  

                  General
                  Stream Path:VBA/DescriptorDistributions
                  VBA File Name:DescriptorDistributions
                  Stream Size:340594
                  Data ASCII:. . . . . . . . . . . . . . . . . / . . . n . . . . . . . . . . . a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . . L . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 c2 0f 02 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 2f 10 02 00 cf 6e 04 00 00 00 00 00 01 00 00 00 d4 1f 61 9f 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorDistributions"
                  Sub Distribution_Descriptors()
                      Call BETA_Descriptor
                      Call NT_DIST_Descriptor
                      Call NT_NCP_Descriptor
                      Call NT_INV_Descriptor
                      Call NF_DIST_Descriptor
                      Call NF_NCP_Descriptor
                      Call NF_INV_Descriptor
                      Call NCHISQ_DIST_Descriptor
                      Call NCHISQ_NCP_Descriptor
                      Call NCHISQ_INV_Descriptor
                      Call UNIFORM_DIST_Descriptor
                      Call UNIFORM_INV_Descriptor
                      Call NEGBINOM_INV_Descriptor
                      Call HYPGEOM_INV_Descriptor
                      Call WEIBULL_INV_Descriptor
                      Call BINOM_CRIT_Descriptor
                      Call F_DIST_Descriptor
                      Call F_INV_Descriptor
                      Call F_DIST_RT_Descriptor
                      Call F_INV_RT_Descriptor
                      Call CHISQ_DIST_Descriptor
                      Call CHISQ_INV_Descriptor
                      Call CHISQ_DIST_RT_Descriptor
                      Call CHISQ_INV_RT_Descriptor
                      Call T_DIST_Descriptor
                      Call T_INV_Descriptor
                      Call T_DIST_RT_Descriptor
                      Call T_DIST_2T_Descriptor
                      Call T_INV_2T_Descriptor
                      Call MULTINOMDIST_Descriptor
                      Call QDIST_Descriptor
                      Call QINV_Descriptor
                      Call RUNSDIST_Descriptor
                      Call RUNSINV_Descriptor
                      Call KDIST_Descriptor
                      Call KINV_Descriptor
                      Call KSDIST_Descriptor
                      Call KSINV_Descriptor
                      Call CORRDIST_Descriptor
                      Call CORRINV_Descriptor
                      Call LDIST_Descriptor
                      Call LINV_Descriptor
                      Call PERM_DIST_Descriptor
                      Call PERMDIST_Descriptor
                      Call PERMINV_Descriptor
                      Call PERM2_DIST_Descriptor
                      Call PERM2DIST_Descriptor
                      Call PERM2INV_Descriptor
                      Call SRDIST_Descriptor
                      Call SRINV_Descriptor
                      Call MWDIST_Descriptor
                      Call MWINV_Descriptor
                      Call ICHISQ_DIST_Descriptor
                      Call ICHISQ_INV_Descriptor
                      Call IGAMMA_DIST_Descriptor
                      Call IGAMMA_INV_Descriptor
                      Call DIRICHLET_DIST_Descriptor
                      Call DIRICHLET_RAND_Descriptor
                      Call BETA_FIT_Descriptor
                      Call PARETO_FIT_Descriptor
                      Call GAMMA_FIT_Descriptor
                      Call UNIFORM_FIT_Descriptor
                      Call WEIBULL_FIT_Descriptor
                      Call WEIBULL_MCFIT_Descriptor
                      Call BETA_FITM_Descriptor
                      Call PARETO_FITM_Descriptor
                      Call GAMMA_FITM_Descriptor
                      Call UNIFORM_FITM_Descriptor
                      Call WEIBULL_FITM_Descriptor
                      Call WEIBULL_FITR_Descriptor
                      Call POLYGAMMA_Descriptor
                      Call T_CONF_Descriptor
                      Call T_LOWER_Descriptor
                      Call T_UPPER_Descriptor
                      Call CONFIDENCE_T_Descriptor
                      Call NORM_CONF_Descriptor
                      Call NORM_LOWER_Descriptor
                      Call NORM_UPPER_Descriptor
                      Call SHAPIRO_Descriptor
                      Call SWTEST_Descriptor
                      Call SWPROB_Descriptor
                      Call SWCoeff_Descriptor
                      Call JARQUE_Descriptor
                      Call JBTEST_Descriptor
                      Call DAGOSTINO_Descriptor
                      Call DPTEST_Descriptor
                      Call SKEWTEST_Descriptor
                      Call KURTTEST_Descriptor
                      Call SKEWPTEST_Descriptor
                      Call KURTPTEST_Descriptor
                      Call DF_POOLED_Descriptor
                      Call WEIBULL_MRL_Descriptor
                      Call WEIBULL_CMEAN_Descriptor
                      Call WEIBULL_CVAR_Descriptor
                      Call WEIBULL_MCMEAN_Descriptor
                      Call WEIBULL_MCVAR_Descriptor
                      Call EXPON_INV_Descriptor
                      Call LCRIT_Descriptor
                      Call LPROB_Descriptor
                      Call LTEST_Descriptor
                      Call EXPON_FIT_Descriptor
                      Call TRIMTEST_Descriptor
                      Call YUENTEST_Descriptor
                      Call T_EFFECT1_Descriptor
                      Call T_EFFECT2_Descriptor
                      Call T_EFFECT2P_Descriptor
                      Call TT_EFFECT1_Descriptor
                      Call TT_EFFECT2_Descriptor
                      Call TT_EFFECT2P_Descriptor
                      Call GOFTEST_Descriptor
                      Call GOFTESTExact_Descriptor
                      Call CVTEST_Descriptor
                      Call CV2TEST_Descriptor
                      Call CV_CONF_Descriptor
                      Call TOLERANCE_NORM_Descriptor
                      Call TOLERANCE_LOWER_Descriptor
                      Call TOLERANCE_UPPER_Descriptor
                      Call TOLERANCE_SIZE_Descriptor
                      Call ORDERDIST_Descriptor
                      Call RANGEDIST_Descriptor
                      Call MEANORDER_Descriptor
                      Call MEANRANGE_Descriptor
                      Call SPANDIST_Descriptor
                      Call SKELLAM_DIST_Descriptor
                      Call KSSTAT_Descriptor
                      Call KSTEST_Descriptor
                      Call PERT_DIST_Descriptor
                      Call PERT_INV_Descriptor
                      Call TRIANG_DIST_Descriptor
                      Call TRIANG_INV_Descriptor
                      Call MEAN_DIST_Descriptor
                      Call VAR_DIST_Descriptor
                      Call KDE_Descriptor
                      Call GUMBEL_DIST_Descriptor
                      Call GUMBEL_INV_Descriptor
                      Call GEV_DIST_Descriptor
                      Call GEV_INV_Descriptor
                      Call FRECHET_DIST_Descriptor
                      Call FRECHET_INV_Descriptor
                      Call LOGISTIC_DIST_Descriptor
                      Call LOGISTIC_INV_Descriptor
                      Call LAPLACE_DIST_Descriptor
                      Call LAPLACE_INV_Descriptor
                      Call PARETO_DIST_Descriptor
                      Call PARETO_INV_Descriptor
                      Call GEOM_FIT_Descriptor
                      Call LOGNORM_FIT_Descriptor
                      Call GUMBEL_FIT_Descriptor
                      Call GUMBEL_FITM_Descriptor
                      Call CAUCHY_FIT_Descriptor
                      Call CAUCHY_FITM_Descriptor
                      Call LAPLACE_FIT_Descriptor
                      Call LAPLACE_FITM_Descriptor
                      Call LOGISTIC_FIT_Descriptor
                      Call LOGISTIC_FITM_Descriptor
                      Call AD_DIST_Descriptor
                      Call AD_INV_Descriptor
                      Call LAPLACE_CONF_Descriptor
                      Call GUMBEL_CONF_Descriptor
                      Call LOGISTIC_CONF_Descriptor
                      Call LOGNORM_CONF_Descriptor
                      Call BETA_CONF_Descriptor
                      Call PARETO_CONF_Descriptor
                      Call GAMMA_CONF_Descriptor
                      Call WEIBULL_CONF_Descriptor
                      Call EXPON_CONF_Descriptor
                      Call GEOM_CONF_Descriptor
                      Call UNIFORM_CONF_Descriptor
                      Call NORMAL_CONF_Descriptor
                      Call GRID_HDI_Descriptor
                      Call SAMPLE_HDI_Descriptor
                      Call BETA_HDI_Descriptor
                      Call ESS_Descriptor
                      Call TNORM_DIST_Descriptor
                      Call TNORM_INV_Descriptor
                      Call TNORM_PARAM_Descriptor
                      Call T3_DIST_Descriptor
                      Call T3_INV_Descriptor
                      Call PropCI_Descriptor
                      Call MSSD_Descriptor
                      Call MSSD_CRIT_Descriptor
                      Call MSSD_PROB_Descriptor
                      Call CATEST_Descriptor
                      Call T1_TEST_Descriptor
                      Call SICHISQ_DIST_Descriptor
                      Call SICHISQ_INV_Descriptor
                      Call MBETA_Descriptor
                      Call NORM_GAMMA_Descriptor
                      Call ORDER_DIST_Descriptor
                      Call ORDER2_DIST_Descriptor
                      Call RANGE_DIST_Descriptor
                      Call ORDER_MEAN_Descriptor
                      Call ORDER_INV_Descriptor
                      Call ORDER_CI_Descriptor
                      Call MEDIAN_CI_Descriptor
                      Call ORDER_SIM_Descriptor
                      Call RANGE_SIM_Descriptor
                      Call ORDER_BOOTSTRAP_Descriptor
                      Call HNORM_DIST_Descriptor
                      Call HNORM_INV_Descriptor
                      Call GEV_FIT_Descriptor
                      Call GEV_FITM_Descriptor
                      Call GEVSKEW_Descriptor
                      Call SNORM_DIST_Descriptor
                      Call SNORM_INV_Descriptor
                      Call RNORM_DIST_Descriptor
                      Call RNORM_INV_Descriptor
                      Call GPD_DIST_Descriptor
                      Call GPD_INV_Descriptor
                      Call GPD_FITM_Descriptor
                      Call CAUCHY_FITX_Descriptor
                      Call Effect_Paired_Descriptor
                  End Sub
                  
                  Sub BETA_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "positive number"
                      argDescription(1) = "positive number"
                      Application.MacroOptions Macro:="BETA", Description:="returns beta function for a and b",         category:="Distribution", StatusBar:="returns beta function for a and b",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NT_DIST_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric value at which you want to evaluate the t distribution"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "noncentrality parameter; a number"
                      argDescription(3) = "TRUE if cumulative distribution value (cdf) is returned or FALSE if probability density function value (pdf) is returned"
                      argDescription(4) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="NT_DIST", Description:="returns noncentral t distribution value",         category:="Distribution", StatusBar:="returns noncentral t distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NT_NCP_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "probability associated with the noncentral t distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "numeric value at which you want to evaluate the distribution"
                      argDescription(3) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(4) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(5) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="NT_NCP", Description:="returns the noncentrality parameter for the t distribution",         category:="Distribution", StatusBar:="returns noncentrality parameter for the t distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NT_INV_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "probability associated with the noncentral t distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "noncentrality parameter; a number"
                      argDescription(3) = "maximumn number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(4) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(5) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="NT_INV", Description:="returns the inverse of the noncentral t distribution",         category:="Distribution", StatusBar:="returns the inverse of the noncentral t distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NF_DIST_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "non-negative numeric value at which you want to evaluate the F distribution"
                      argDescription(1) = "numerator degrees of freedom; a positive number"
                      argDescription(2) = "denominator degrees of freedom; a positive number"
                      argDescription(3) = "noncentrality parameter; a non-negative number"
                      argDescription(4) = "TRUE if cumulative distribution value (cdf) is returned or FALSE if probability density function value (pdf) is returned"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NF_DIST", Description:="returns noncentral F distribution value",         category:="Distribution", StatusBar:="returns noncentral F distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NF_NCP_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "probability associated with the noncentral F distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "numerator degrees of freedom; a positive number"
                      argDescription(2) = "denominator degrees of freedom; a positive number"
                      argDescription(3) = "non-negative numeric value at which you want to evaluate the distribution"
                      argDescription(4) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(6) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NF_NCP", Description:="returns the noncentrality parameter for F distribution",         category:="Distribution", StatusBar:="returns noncentrality parameter for F distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NF_INV_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "probability associated with the noncentral F distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "numerator degrees of freedom; a positive number"
                      argDescription(2) = "denominator degrees of freedom; a positive number"
                      argDescription(3) = "noncentrality parameter; a non-negative number"
                      argDescription(4) = "mximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(6) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NF_INV", Description:="returns the inverse of the noncentral F distribution",         category:="Distribution", StatusBar:="returns the inverse of the noncentral F distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NCHISQ_DIST_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "non-negative numeric value at which you want to evaluate the chi-square distribution"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "noncentrality parameter; a non-negative number"
                      argDescription(3) = "TRUE if cumulative distribution value (cdf) is returned or FALSE if probability density function value (pdf) is returned"
                      argDescription(4) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NCHISQ_DIST", Description:="returns noncentral chi-square distribution value",         category:="Distribution", StatusBar:="returns noncentral chi-square distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NCHISQ_NCP_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "probability associated with the noncentral chi-square distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "non-negative numeric value at which you want to evaluate the distribution"
                      argDescription(3) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(4) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(5) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NCHISQ_NCP", Description:="returns the noncentrality parameter for chi-square distribution",         category:="Distribution", StatusBar:="returns noncentrality parameter for chi-square distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NCHISQ_INV_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "probability associated with the noncentral chi-square distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "degrees of freedom; a positive number"
                      argDescription(2) = "noncentrality parameter; a non-negative number"
                      argDescription(3) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(4) = "number of iterations to use in the calculation (default 40); positive integer"
                      argDescription(5) = "precision of result (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="NCHISQ_INV", Description:="returns the inverse of the noncentral chi-square distribution",         category:="Distribution", StatusBar:="returns the inverse of the noncentral chi-square distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub UNIFORM_DIST_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value at which you want to evaluate the uniform distribution"
                      argDescription(1) = "numeric parameter value"
                      argDescription(2) = "numeric parameter value > a"
                      argDescription(3) = "TRUE if cumulative distribution value (cdf) is returned or FALSE if probability density function value (pdf) is returned"
                      Application.MacroOptions Macro:="UNIFORM_DIST", Description:="returns uniform distribution value",         category:="Distribution", StatusBar:="returns uniform distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub UNIFORM_INV_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "probability associated with the uniform distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "numeric parameter value"
                      argDescription(2) = "numeric parameter value > a"
                      Application.MacroOptions Macro:="UNIFORM_INV", Description:="returns the inverse of the uniform distribution",         category:="Distribution", StatusBar:="returns the inverse of the uniform distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WEIBULL_INV_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "probability associated with the Weibull distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "shape parameter value; a positive number"
                      argDescription(2) = "scale parameter value; a positive number"
                      Application.MacroOptions Macro:="WEIBULL_INV", Description:="returns the inverse of the Weibull distribution",         category:="Distribution", StatusBar:="returns the inverse of the Weibull distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NEGBINOM_INV_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "probability associated with the negative binomial distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "number of successes; a positive number"
                      argDescription(2) = "probability of success on any trial; a number between 0 and 1 inclusive"
                      Application.MacroOptions Macro:="NEGBINOM_INV", Description:="returns the inverse of the negative binomial distribution; i.e. the smallest integer x such that NEGBINOM.DIST(x,k,pp,TRUE)>=p",         category:="Distribution", StatusBar:="returns the inverse of the negative binomial distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub HYPGEOM_INV_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "probability associated with the hypergeometric distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "size of the sample; a positive integer"
                      argDescription(2) = "number of successes in the population; a positive number"
                      argDescription(3) = "size of the population; a positive integer"
                      Application.MacroOptions Macro:="HYPGEOM_INV", Description:="returns the inverse of the hypergeometric distribution; i.e. the smallest integer x such that HYPGEOM.DIST(x,n,k,m,TRUE)>=p",         category:="Distribution", StatusBar:="returns the inverse of the hypergeometric distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BINOM_CRIT_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "probability fo success on any trial; a number between 0 and 1 inclusive"
                      argDescription(2) = "probability associated with the binomial distribution; a number between 0 and 1 inclusive"
                      Application.MacroOptions Macro:="BINOM_CRIT", Description:="returns the critical value for the binomial distribution",         category:="Distribution", StatusBar:="returns the critical value for the binomial distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F_DIST_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "non-negative numeric value at which you want to evaluate the F distribution"
                      argDescription(1) = "numerator degrees of freedom; a positive number"
                      argDescription(2) = "denominator degrees of freedom; a positive number"
                      argDescription(3) = "TRUE if cumulative distribution value (cdf) is returned or FALSE if probability density function value (pdf) is returned"
                      Application.MacroOptions Macro:="F_DIST", Description:="returns F distribution value",         category:="Distribution", StatusBar:="returns F distribution value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F_INV_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "probability associated with the F distribution; a number between 0 and 1 inclusive"
                      argDescription(1) = "numerator degrees of freedom; a positive number"
                      argDescription(2) = "denominato

                  General
                  Stream Path:VBA/DescriptorGames
                  VBA File Name:DescriptorGames
                  Stream Size:20412
                  Data ASCII:. . . . . . . . : ! . . . . . . . . ! . . C . . . . . . . . . . . . D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . . l . X . . . . . . `
                  Data Raw:01 16 03 00 06 f0 00 00 00 3a 21 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff a7 21 00 00 9f 43 00 00 00 00 00 00 01 00 00 00 d4 1f 07 44 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorGames"
                  Sub Games_Descriptors()
                      Call NPatterns4_Descriptor
                      Call PatternCount_Descriptor
                      Call BestGuess2_Descriptor
                      Call Guesses3_Descriptor
                      Call DictList_Descriptor
                      Call PatternId_Descriptor
                      Call SPattern_Descriptor
                      Call Guesses2_Descriptor
                      Call Pattern2Counts_Descriptor
                      Call WordleProb2_Descriptor
                      Call Targets_Descriptor
                      Call TargetCount_Descriptor
                  End Sub
                  
                  Sub PatternId_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "text string with 5 characters, representing a Wordle pattern such as *GY*Y"
                      Application.MacroOptions Macro:="PatternId", Description:="returns a pattern identification number corresponding to spattern; an integer between 1 and 243",         category:="Games", StatusBar:="returns a pattern identification number corresponding to spattern; an integer between 1 and 243",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SPattern_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "integer between 1 and 243; Wordle pattern identification number"
                      Application.MacroOptions Macro:="SPattern", Description:="returns a 5-character text string (such as *GY*Y) with pattern corresponding to pattern",         category:="Games", StatusBar:="returns a 5-character text string (such as *GY*Y) with pattern corresponding to pattern",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PatternCount_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "text string with 5 characters, representing a Wordle word"
                      Application.MacroOptions Macro:="PatternCount", Description:="returns the # of patterns for which some target has this pattern for the specified guess",         category:="Games", StatusBar:="returns the # of patterns for which some target has this pattern for the specified guess",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BestGuess2_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess"
                      argDescription(2) = "if 0 (default) second guess comes from list of target words; if 1 second guess comes from full dictionary; if -1 second guess comes from list of target words and is compatible qith guess1/pattern1"
                      Application.MacroOptions Macro:="BestGuess2", Description:="returns a 2 x 1 array with the second guess with the largest # of non-zero patterns and this # of patterns",         category:="Games", StatusBar:="returns a 2 x 1 array with the second guess with the largest # of non-zero patterns and this # of patterns",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Guesses3_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary; first guess"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess1"
                      argDescription(2) = "text string with 5 characters, representing a word in the Wordle dictionary; second guess"
                      argDescription(3) = "0, 1, or -1; if 0 output is sorted by third guess; if 1 (default) output is sorted by second-guess pattern; if -1 output is sorted by second-guess pattern w/o duplicates, a 4th col is added to output with # of duplicates"
                      Application.MacroOptions Macro:="Guesses3", Description:="returns an array with 3 columns containing 3rd guesses and the 2nd guess patterns (id and text) they correspond to; if order = -1 a 4th column is appended",         category:="Games", StatusBar:="returns an array with 3 columns containing 3rd guesses and the 2nd guess patterns (id and text) they correspond to; if order = -1 a 4th column is appended",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DictList_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "if TRUE return the full list of words in the Wordle dictionary; if FALSE (deafult) return the list of target words"
                      Application.MacroOptions Macro:="DictList", Description:="returns a column array with the words in the Wordle dictionary",         category:="Games", StatusBar:="returns a column array with the words in the Wordle dictionary",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Guesses2_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary; first guess"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess1"
                      argDescription(2) = "positive integer; # of non-zero patterns"
                      argDescription(3) = "0, 1, or -1; if 0 output is sorted by third guess; if 1 (default) output is sorted by second-guess pattern; if -1 output is sorted by second-guess pattern w/o duplicates, a 4th col is added to output with # of duplicates"
                      Application.MacroOptions Macro:="Guesses2", Description:="returns a column array containing all the words in the dictionary that are compatible with guess1/pattern1 and have npatterns many non-zero patterns",         category:="Games", StatusBar:="returns a column array containing all the words in the dictionary that are compatible with guess1/pattern1 and have npatterns many non-zero patterns",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WordleProb2_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary; first guess"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess1"
                      argDescription(2) = "text string with 5 characters, representing a word in the Wordle dictionary; second guess"
                      argDescription(3) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="WordleProb2", Description:="returns a column array containing # of non-zero patterns, # of compatible targets, probability of winning within 2, 3, 4, 5, and 6 tries, worst case pattern and # of targets for that pattern",         category:="Games", StatusBar:="returns a column array containing # of non-zero patterns, # of compatible targets, probability of winning within 2, 3, 4, 5, and 6 tries, worst case pattern and # of targets for that pattern",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Pattern2Counts_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary; first guess"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess1"
                      argDescription(2) = "text string with 5 characters, representing a word in the Wordle dictionary; second guess"
                      Application.MacroOptions Macro:="Pattern2Counts", Description:="returns a column array with 243 entries, one for each pattern, with the count of targets that are compatible with guess1/pattern1 for the first guess and compatible with guess/pattern for the second guess",         category:="Games", StatusBar:="returns a column array with 243 entries, one for each pattern, with the count of targets that are compatible with guess1/pattern1 for the first guess and compatible with guess/pattern for the second guess",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NPatterns4_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary; first guess"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess1"
                      argDescription(2) = "text string with 5 characters, representing a word in the Wordle dictionary; second guess"
                      Application.MacroOptions Macro:="NPatterns4", Description:="# of patterns for 4th guess based on the best 3rd guess (i.e. the guess that maximizes the # of patterns)",         category:="Games", StatusBar:="# of patterns for 4th guess based on the best 3rd guess (i.e. the guess that maximizes the # of patterns)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Targets_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess"
                      Application.MacroOptions Macro:="Targets", Description:="returns a column array that lists all the target words compatible with guess/pattern",         category:="Games", StatusBar:="returns a column array that lists all the target words compatible with guess/pattern",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TargetCount_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "text string with 5 characters, representing a word in the Wordle dictionary"
                      argDescription(1) = "integer between 1 and 243; Wordle pattern identification number for guess"
                      Application.MacroOptions Macro:="TargetCount", Description:="# of target words compatible with guess/pattern",         category:="Games", StatusBar:="# of target words compatible with guess/pattern",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  
                  

                  General
                  Stream Path:VBA/DescriptorInfo
                  VBA File Name:DescriptorInfo
                  Stream Size:14883
                  Data ASCII:. . . . . . . . b . . . . . . . . . . . . 3 . . . . . . . . . . . 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . . n . X . . . . . . `
                  Data Raw:01 16 03 00 06 f0 00 00 00 62 1f 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff cf 1f 00 00 8f 33 00 00 01 00 00 00 01 00 00 00 d4 1f 32 ac 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorInfo"
                  Sub Info_Descriptors()
                      Call FillRGB_Descriptor
                      Call FontRGB_Descriptor
                      Call RedRGB_Descriptor
                      Call GreenRGB_Descriptor
                      Call BlueRGB_Descriptor
                      Call IsBold_Descriptor
                      Call RGBCode_Descriptor
                      Call FillColor_Descriptor
                      Call FontColor_Descriptor
                      Call RGBDistSq_Descriptor
                      Call NameAddress_Descriptor
                      Call CharCount_Descriptor
                  End Sub
                  
                  Sub FillRGB_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "cell range"
                      Application.MacroOptions Macro:="FillRGB", Description:="returns the RGB value for the fill color of rg",         category:="Info", StatusBar:="returns the RGB value for the fill color of rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FontRGB_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "cell range"
                      Application.MacroOptions Macro:="FontRGB", Description:="returns the RGB value for the font color of rg",         category:="Info", StatusBar:="returns the RGB value for the font color of rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RedRGB_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "integer representing an RGB color value"
                      Application.MacroOptions Macro:="RedRGB", Description:="returns the Red RGB value (0-255) for the RGB code n",         category:="Info", StatusBar:="returns the Red RGB value (0-255) for the RGB code n",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GreenRGB_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "integer representing an RGB color value"
                      Application.MacroOptions Macro:="GreenRGB", Description:="returns the Green RGB value (0-255) for the RGB code n",         category:="Info", StatusBar:="returns the Green RGB value (0-255) for the RGB code n",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BlueRGB_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "integer representing an RGB color value"
                      Application.MacroOptions Macro:="BlueRGB", Description:="returns the Blue RGB value (0-255) for the RGB code n",         category:="Info", StatusBar:="returns the Blue RGB value (0-255) for the RGB code n",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub IsBold_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "cell range"
                      Application.MacroOptions Macro:="IsBold", Description:="TRUE if all the cells in rg are bold; FALSE otherwise",         category:="Info", StatusBar:="TRUE if all the cells in rg are bold; FALSE otherwise",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RGBCode_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "text containing one of the named colors"
                      Application.MacroOptions Macro:="RGBCode", Description:="returns the RGB code for the specified color",         category:="Info", StatusBar:="returns the RGB code for the specified color",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FillColor_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "cell range"
                      argDescription(1) = "TRUE (default) if an exact match is required; otherwise the closest matching color is returned"
                      Application.MacroOptions Macro:="FillColor", Description:="returns the name of the fill color in range rg; if not one of the named colors then unknown is returned",         category:="Info", StatusBar:="returns the name of the fill color in range rg; if not one of the named colors then unknown is returned",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FontColor_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "cell range"
                      argDescription(1) = "TRUE (default) if an exact match is required; otherwise the closest matching color is returned"
                      Application.MacroOptions Macro:="FontColor", Description:="returns the name of the font color in range rg; if not one of the named colors then 'unknown' is returned",         category:="Info", StatusBar:="returns the name of the font color in range rg; if not one of the named colors then 'unknown' is returned",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RGBDistSq_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "integer representing an RGB color value"
                      argDescription(1) = "integer representing an RGB color value"
                      argDescription(2) = "if 1 use Euclidean distance; if -1 use weighted Euclidean distance using greyscale weights; if 0 (default) use weighted Euclidean distance using weights for this purpose"
                      Application.MacroOptions Macro:="RGBDistSq", Description:="returns the squared distance between the two RGB color values",         category:="Info", StatusBar:="returns the squared distance between the two RGB color values",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NameAddress_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "defined name"
                      Application.MacroOptions Macro:="NameAddress", Description:="returns cell address of the defined name",         category:="Info", StatusBar:="returns cell address of the defined name",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CharCount_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "text (i.e. string of characters)"
                      argDescription(1) = "character (i.e. string of length one)"
                      Application.MacroOptions Macro:="CharCount", Description:="returns a count of the number of times character c appears in string s",         category:="Info", StatusBar:="returns a count of the number of times character c appears in string s",         ArgumentDescriptions:=argDescription
                  End Sub
                  

                  General
                  Stream Path:VBA/DescriptorLambda
                  VBA File Name:DescriptorLambda
                  Stream Size:92101
                  Data ASCII:. . . . . . . . 2 z . . . . . . . . z . . / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . w . . . . h . X . . . . . . ` . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 32 7a 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 9f 7a 00 00 bb 2f 01 00 00 00 00 00 01 00 00 00 d4 1f b0 bd 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorLambda"
                  Sub Lambda_Descriptors()
                      Call DERIV_Descriptor
                      Call DERIV2_Descriptor
                      Call INTEGRAL_Descriptor
                      Call INTEGRAL2_Descriptor
                      Call BRENT_Descriptor
                      Call BISECTION_Descriptor
                      Call NEWTON_Descriptor
                      Call NROOTS_Descriptor
                      Call SECANT_Descriptor
                      Call MNEWTON_Descriptor
                      Call FMIN_Descriptor
                      Call FMAX_Descriptor
                      Call F2MIN_Descriptor
                      Call F2MAX_Descriptor
                      Call F3MIN_Descriptor
                      Call F3MAX_Descriptor
                      Call NEWTON2_Descriptor
                      Call NEWTON3_Descriptor
                      Call MNEWTON2_Descriptor
                      Call MNEWTON3_Descriptor
                      Call FUNC_Descriptor
                      Call FUNC2_Descriptor
                      Call FUNC3_Descriptor
                      Call FUNC2D_Descriptor
                      Call GRADIENT2_Descriptor
                      Call GRADIENT3_Descriptor
                      Call HESSIAN2_Descriptor
                      Call HESSIAN3_Descriptor
                      Call BYCOLS_Descriptor
                      Call BYROWS_Descriptor
                      Call SCANS_Descriptor
                      Call MAPS_Descriptor
                      Call REDUCES_Descriptor
                      Call MAKESARRAY_Descriptor
                      Call JACKKNIFE_Descriptor
                      Call Acceleration_Descriptor
                      Call BOOTSTRAP_Descriptor
                      Call CI_BOOTSTRAP_Descriptor
                      Call NMEAD_Descriptor
                      Call EvalFunc_Descriptor
                      Call EVAL2_Descriptor
                      Call EVALX_Descriptor
                      Call EVALXY_Descriptor
                      Call BGFS_Descriptor
                      Call MGRADIENT_Descriptor
                      Call MGRADIENTX_Descriptor
                      Call GRADIENT_Descriptor
                      Call EvalArray_Descriptor
                  End Sub
                  
                  Sub DERIV_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "formula representing a function f(x)"
                      argDescription(2) = "small positive number, default is 0.000001"
                      argDescription(3) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="DERIV", Description:="returns an estimate of the derivative of f(x), namely f'(x) = f(x+incr)-f(x-incr)/(2*incr)",         category:="Lambda", StatusBar:="returns an estimate of the derivative of f(x), namely f'(x) = f(x+incr)-f(x-incr)/(2*incr)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DERIV2_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "formula representing a function f(x)"
                      argDescription(2) = "small positive number, default is 0.000001"
                      argDescription(3) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="DERIV2", Description:="returns an estimate of the second derivative of f(x), namely f''(x) = f'(x+incr)-f'(x-incr)/(2*incr)",         category:="Lambda", StatusBar:="returns an estimate of the second derivative of f(x), namely f''(x) = f'(x+incr)-f'(x-incr)/(2*incr)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub INTEGRAL_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; lower limit of integral; if omitted then -infinity"
                      argDescription(2) = "numeric value: upper limit of integral; if omitted then +infinity"
                      argDescription(3) = "# of iterations (default 10000); represents number of subintervals"
                      argDescription(4) = "if 0 (default) then Simpson's rule is used; if 1 then the midpoint rule is used"
                      argDescription(5) = "optional cell address representing the unknown variable in expression; if missing then the first cell address in expression is used"
                      Application.MacroOptions Macro:="INTEGRAL", Description:="returns a numerical estimate of the integral of f(x) between lower and upper",         category:="Lambda", StatusBar:="returns a numerical estimate of the integral of f(x) between lower and upper",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub INTEGRAL2_Descriptor()
                      Dim argDescription(8) As String
                      argDescription(0) = "formula representing a function f(x,y)"
                      argDescription(1) = "numeric value or expression for a function g(x); lower limit of integral for x"
                      argDescription(2) = "numeric value or expression for a function h(x): upper limit of integral for x"
                      argDescription(3) = "numeric value; lower limit of integral for y; if omitted then -infinity"
                      argDescription(4) = "numeric value: upper limit of integral for y; if omitted then +infinity"
                      argDescription(5) = "# of iterations (default 400); represents the number of subintervals for x"
                      argDescription(6) = "# of iterations (default 400); represents the number of subintervals for y"
                      argDescription(7) = "optional cell address representing the unknown x variable in expression; if missing then the first cell address in expression is used"
                      argDescription(8) = "optional cell address representing the unknown y variable in expression; if missing then the second cell address in expression is used"
                      Application.MacroOptions Macro:="INTEGRAL2", Description:="returns a numerical estimate of the double integral of f(x,y) between lower and upper for x and y",         category:="Lambda", StatusBar:="returns a numerical estimate of the double integral of f(x,y) between lower and upper for x and y",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SECANT_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; any x value near a root of f(x)"
                      argDescription(2) = "numeric value different from x1; any x value near a root of f(x)"
                      argDescription(3) = "# of iterations (default 100)"
                      argDescription(4) = "small positive number, default is 0.0000001"
                      argDescription(5) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="SECANT", Description:="returns an estimate of a root of f(x) using the secant method",         category:="Lambda", StatusBar:="returns an estimate of a root of f(x) using the secant method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BISECTION_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; any value less than a root of f(x)"
                      argDescription(2) = "numeric value; any value greater than a root of f(x); lower < upper; f(lower) and f(upper) have different signs"
                      argDescription(3) = "# of iterations (default 100)"
                      argDescription(4) = "small positive number, default is 0.0000001"
                      argDescription(5) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="BISECTION", Description:="returns an estimate of a root of f(x) in the interval (lower, upper) using the bisection method",         category:="Lambda", StatusBar:="returns an estimate of a root of f(x) in the interval (lower, upper) using the bisection method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BRENT_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; any value less than a root of f(x)"
                      argDescription(2) = "numeric value; any value greater than a root of f(x); lower < upper; f(lower) and f(upper) have different signs"
                      argDescription(3) = "# of iterations (default 100)"
                      argDescription(4) = "small positive number, default is 0.0000001"
                      argDescription(5) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="BRENT", Description:="returns an estimate of a root of f(x) in the interval (lower, upper) using Brent's method",         category:="Lambda", StatusBar:="returns an estimate of a root of f(x) in the interval (lower, upper) using Brent's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NEWTON_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; any x value near a root of f(x)"
                      argDescription(2) = "# of iterations (default 100)"
                      argDescription(3) = "small positive number, default is 0.0000001"
                      argDescription(4) = "small positive number, default is 0.000001; used to find the derivative of f(x)"
                      argDescription(5) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="NEWTON", Description:="returns an estimate of a root of f(x) using Newton's method",         category:="Lambda", StatusBar:="returns an estimate of a root of f(x) using Newton's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NROOTS_Descriptor()
                      Dim argDescription(7) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lower < upper"
                      argDescription(3) = "if nguess > 0, then # of random guesses (default 50); if nguess < 0, then -nguess = # of equally-spaced guesses"
                      argDescription(4) = "# of iterations (default 100)"
                      argDescription(5) = "small positive number, default is 0.0000001"
                      argDescription(6) = "small positive number, default is 0.000001; used to find the derivative of f(x)"
                      argDescription(7) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="NROOTS", Description:="returns a column array with estimates of the roots of f(x) in the interval (lower, upper) using Newton's method",         category:="Lambda", StatusBar:="returns a column array with estimates of the roots of f(x) in the interval (lower, upper) using Newton's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MNEWTON_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric value; any x value near a root of the derivative of f(x)"
                      argDescription(2) = "# of iterations (default 100)"
                      argDescription(3) = "small positive number, default is 0.0000001"
                      argDescription(4) = "small positive number, default is 0.0005; used to find the derivative f'(x) of f(x)"
                      argDescription(5) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="MNEWTON", Description:="returns an estimate of a root of f'(x) using Newton's method, presumably a local minima or maxima",         category:="Lambda", StatusBar:="returns an estimate of a root of f'(x) using Newton's method, presumably a local minima or maxima",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FMAX_Descriptor()
                      Dim argDescription(7) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lower < upper"
                      argDescription(3) = "# of equally-spaced guesses (default 1000)"
                      argDescription(4) = "# of iterations (default 100)"
                      argDescription(5) = "small positive number, default is 0.0000001"
                      argDescription(6) = "small positive number, default is 0.000001; used to find the derivative of f(x)"
                      argDescription(7) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="FMAX", Description:="returns the maximum value of f(x) in the interval (lower, upper); uses Newton's method",         category:="Lambda", StatusBar:="returns the maximum value of f(x) in the interval (lower, upper); uses Newton's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FMIN_Descriptor()
                      Dim argDescription(7) As String
                      argDescription(0) = "formula representing a function f(x)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lower < upper"
                      argDescription(3) = "# of equally-spaced guesses (default 1000)"
                      argDescription(4) = "# of iterations (default 100)"
                      argDescription(5) = "small positive number, default is 0.0000001"
                      argDescription(6) = "small positive number, default is 0.000001; used to find the derivative of f(x)"
                      argDescription(7) = "optional cell address representing unknown variable in expression; if missing then first cell address in expression is used"
                      Application.MacroOptions Macro:="FMIN", Description:="returns the minimum value of f(x) in the interval (lower, upper); uses Newton's method",         category:="Lambda", StatusBar:="returns the minimum value of f(x) in the interval (lower, upper); uses Newton's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F2MAX_Descriptor()
                      Dim argDescription(10) As String
                      argDescription(0) = "formula representing a function f(x,y)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lox < upx"
                      argDescription(3) = "numeric y value"
                      argDescription(4) = "numeric y value; loy < upy"
                      argDescription(5) = "# of equally-spaced guesses for x (default 200)"
                      argDescription(6) = "# of equally-spaced guesses for y (default 200)"
                      argDescription(7) = "# of iterations (default 100)"
                      argDescription(8) = "small positive number, default is 0.0000001"
                      argDescription(9) = "optional cell address representing the x variable in expression; if missing then the first cell address in expression is used"
                      argDescription(10) = "optional cell address representing the y variable in expression; if missing then the second cell address in expression is used"
                      Application.MacroOptions Macro:="F2MAX", Description:="returns a 1 x 3 array with the values x,y that maximize f(x,y) in the ellipse defined by lox, upx and loy, upy",         category:="Lambda", StatusBar:="returns a 1 x 3 array with the values x,y that maximize f(x,y) in the ellipse defined by lox, upx and loy, upy",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F2MIN_Descriptor()
                      Dim argDescription(10) As String
                      argDescription(0) = "formula representing a function f(x,y)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lox < upx"
                      argDescription(3) = "numeric y value"
                      argDescription(4) = "numeric y value; loy < upy"
                      argDescription(5) = "# of equally-spaced guesses for x (default 200)"
                      argDescription(6) = "# of equally-spaced guesses for y (default 200)"
                      argDescription(7) = "# of iterations (default 100)"
                      argDescription(8) = "small positive number, default is 0.0000001"
                      argDescription(9) = "optional cell address representing the x variable in expression; if missing then the first cell address in expression is used"
                      argDescription(10) = "optional cell address representing the y variable in expression; if missing then the second cell address in expression is used"
                      Application.MacroOptions Macro:="F2MIN", Description:="returns a 1 x 3 array with the values x,y that minimize f(x,y) in the ellipse defined by lox, upx and loy, upy",         category:="Lambda", StatusBar:="returns a 1 x 3 array with the values x,y that minimize f(x,y) in the ellipse defined by lox, upx and loy, upy",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F3MAX_Descriptor()
                      Dim argDescription(14) As String
                      argDescription(0) = "formula representing a function f(x,y)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lox < upx"
                      argDescription(3) = "numeric y value"
                      argDescription(4) = "numeric y value; loy < upy"
                      argDescription(5) = "numeric z value"
                      argDescription(6) = "numeric z value; loz < upz"
                      argDescription(7) = "# of equally-spaced guesses for x (default 50)"
                      argDescription(8) = "# of equally-spaced guesses for y (default 50)"
                      argDescription(9) = "# of equally-spaced guesses for z (default 50)"
                      argDescription(10) = "# of iterations (default 100)"
                      argDescription(11) = "small positive number, default is 0.0000001"
                      argDescription(12) = "optional cell address representing the x variable in expression; if missing then the first cell address in expression is used"
                      argDescription(13) = "optional cell address representing the y variable in expression; if missing then the second cell address in expression is used"
                      argDescription(14) = "optional cell address representing the z variable in expression; if missing then the third cell address in expression is used"
                      Application.MacroOptions Macro:="F3MAX", Description:="returns a 1 x 4 array with the values x,y,z that maximize f(x,y,z) in the hyper-ellipse defined by lox, upx and loy, upy and loz, upz",         category:="Lambda", StatusBar:="returns a 1 x 4 array with the values x,y,z that maximize f(x,y,z) in the hyper-ellipse defined by lox, upx and loy, upy and loz, upz",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub F3MIN_Descriptor()
                      Dim argDescription(14) As String
                      argDescription(0) = "formula representing a function f(x,y)"
                      argDescription(1) = "numeric x value"
                      argDescription(2) = "numeric x value; lox < upx"
                      argDescription(3) = "numeric y value"
                      argDescription(4) = "numeric y value; loy < upy"
                      argDescription(5) = "numeric z value"
                      argDescription(6) = "numeric z value; loz < upz"
                      argDescription(7) = "# of equally-spaced guesses for x (default 50)"
                      argDescription(8) = "# of equally-spaced guesses for y (default 50)"
                      argDescription(9) = "# of equally-spaced guesses for z (default 50)"
                      argDescription(10) = "# of iterations (default 100)"
                      argDescription(11) = "small positive number, default is 0.0000001"
                      argDescription(12) = "optional cell address representing the x variable in expression; if missing then the first cell address in expression is used"
                      argDescription(13) = "optional cell address representing the y variable in expression; if missing then the second cell address in expression is used"
                      argDescription(14) = "optional cell address representing the z variable in expression; if missing then the third cell address in expression is used"
                      Application.MacroOptions Macro:="F3MIN", Description:="returns a 1 x 4 array with the values x,y,z that minimize f(x,y,z) in the hyper-ellipse defined by lox, upx and loy, upy and loz, upz",         category:="Lambda", StatusBar:="returns a 1 x 4 array with the values x,y,z that minimize f(x,y,z) in the hyper-ellipse defined by lox, upx and loy, upy and loz, upz",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NEWTON2_Descriptor()
                      Dim argDescription(8) As String
                      argDescription(0) = "formula representing a function f1(x,y)"
                      argDescription(1) = "formula representing a function f2(x,y)"
                      argDescription(2) = "numeric value; any x value near a root of f1(x,y) and f2(x,y)"
                      argDescription(3) = "numeric value; any y value near a root of f1(x,y) and f2(x,y)"
                      argDescription(4) = "# of iterations (default 100)"
                      argDescription(5) = "small positive number, default is 0.0000001"
                      argDescription(6) = "small positive number, default is 0.00001; used to find the partial derivatives of f(x,y)"
                      argDescription(7) = "optional cell address representing x variable in the formulas in expressions; if missing then first cell address in expression1 is used"
                      argDescription(8) = "optional cell address representing y variable in the formulas in expressions; if missing then second cell address in expression1 is used"
                      Application.MacroOptions Macro:="NEWTON2", Description:="returns a 1 x 4 row array with an estimate of a root x,y of f1(x,y) and f2(x,y) using Newton's method",         category:="Lambda", StatusBar:="returns a 1 x 4 row array with an estimate of a root x,y of f1(x,y) and f2(x,y) using Newton's method",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NEWTON3_Descriptor()
                      Dim argDescription(10) As String
                      argDescription(0) = "formula representin

                  General
                  Stream Path:VBA/DescriptorLinAlg
                  VBA File Name:DescriptorLinAlg
                  Stream Size:102137
                  Data ASCII:. . . . . . . . . . . . . . . . . . . Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . P . . . . f . X . . . . . . ` . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 92 9d 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff ff 9d 00 00 7f 51 01 00 05 00 00 00 01 00 00 00 d4 1f ba 7f 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorLinAlg"
                  Sub LinAlg_Descriptors()
                      Call MERGE_Descriptor
                      Call DET_Descriptor
                      Call IDENTITY_Descriptor
                      Call LENGTH_Descriptor
                      Call MCONST_Descriptor
                      Call NORM_Descriptor
                      Call TRACE_Descriptor
                      Call DIAG_Descriptor
                      Call DIAGONAL_Descriptor
                      Call SUBMATRIX_Descriptor
                      Call MPOWER_Descriptor
                      Call ELIM_Descriptor
                      Call MRANK_Descriptor
                      Call LINEQU_Descriptor
                      Call eVALUES_Descriptor
                      Call eVECTORS_Descriptor
                      Call SCHUR_Descriptor
                      Call SCHURQ_Descriptor
                      Call eVAL_Descriptor
                      Call eVECT_Descriptor
                      Call QRFactor_Descriptor
                      Call QRFactorQ_Descriptor
                      Call QRFactorR_Descriptor
                      Call QRFull_Descriptor
                      Call QRFullQ_Descriptor
                      Call QRFullR_Descriptor
                      Call MSQRT_Descriptor
                      Call CHOL_Descriptor
                      Call SSCP_Descriptor
                      Call SVD_U_Descriptor
                      Call SVD_V_Descriptor
                      Call SVD_D_Descriptor
                      Call QRINVERSE_Descriptor
                      Call QRSolve_Descriptor
                      Call SPECTRAL_Descriptor
                      Call IsSquare_Descriptor
                      Call MPROD_Descriptor
                      Call MSUB_Descriptor
                      Call KMULT_Descriptor
                      Call KSUM_Descriptor
                      Call HESS_Descriptor
                      Call HessQ_Descriptor
                      Call HessH_Descriptor
                      Call LUPFactor_Descriptor
                      Call LUPFactorL_Descriptor
                      Call LUPFactorU_Descriptor
                      Call LUPFactorP_Descriptor
                      Call LUSolve_Descriptor
                      Call LUDet_Descriptor
                      Call LUInverse_Descriptor
                      Call MPERM_Descriptor
                      Call eigVAL_Descriptor
                      Call eigVALSym_Descriptor
                      Call eigVALReal_Descriptor
                      Call eigVECT_Descriptor
                      Call eigVECTSym_Descriptor
                      Call eigVECTReal_Descriptor
                      Call eigMultVECT_Descriptor
                      Call GRAM_Descriptor
                      Call PseudoInv_Descriptor
                      Call PseudoInv0_Descriptor
                      Call ZEigVAL_Descriptor
                      Call ZEigVECT_Descriptor
                      Call IMEigVECT_Descriptor
                      Call ZLinEqSolve_Descriptor
                      Call IMLinEqSolve_Descriptor
                      
                  End Sub
                  
                  Sub MERGE_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "array or cell range"
                      Application.MacroOptions Macro:="MERGE", Description:="returns an array consisting of the columns in array1 followed by the columns in array2, with any missing cells filled with blanks",         category:="Linear Algebra", StatusBar:="returns an array consisting of the columns in array1 followed by the columns in array2, with any missing cells filled with blanks",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DET_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range, with equal number of rows and columns"
                      Application.MacroOptions Macro:="DET", Description:="returns determinant of array1; equivalent to MDETERM",         category:="Linear Algebra", StatusBar:="returns determinant of array1; equivalent to MDETERM",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub IDENTITY_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "number of rows/columns in a square array or cell range (optional parameter)"
                      Application.MacroOptions Macro:="IDENTITY", Description:="returns an array or cell range consisting of a k x k identity matrix; if k parameter is ommitted then highlighted range is filled with an identity matrix (if not a square range, then #N/A is output)",         category:="Linear Algebra", StatusBar:="if k is not omitted, returns an array or cell range consisting of a k x k identity matrix; if k parameter is ommitted then highlighted range is filled with an identity matrix",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LENGTH_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="LENGTH", Description:="returns length of array1, i.e. the square root of the sum of the squares of the elements in array1",         category:="Linear Algebra", StatusBar:="returns length of array1, i.e. the square root of the sum of the squares of the elements in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MCONST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "scalar constant (number or text) that is used to fill all the elements in the array; default = 0"
                      argDescription(1) = "# of rows in the output; if 0 or omitted then the dimensions of the highlighted range is used"
                      argDescription(2) = "# of columns in the output; default = 1"
                      Application.MacroOptions Macro:="MCONST", Description:="returns an array of the selected dimensions filled completely with c",         category:="Linear Algebra", StatusBar:="returns an array of the selected dimensions filled completely with c",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NORM_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="NORM", Description:="returns the normalization of array1, i.e. the array with each element divided by the square root of the sum of the squares of the elements in the array",         category:="Linear Algebra", StatusBar:="returns the normalization of array1, i.e. the array with each element divided by the square root of the sum of the squares of the elements in the array",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TRACE_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="TRACE", Description:="returns the trace of array1, i.e. the sum of the elements on the main diagonal",         category:="Linear Algebra", StatusBar:="returns the trace of array1, i.e. the sum of the elements on the main diagonal",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DIAG_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "cell range"
                      Application.MacroOptions Macro:="DIAG", Description:="fills in the highlighted row or column range with the elements on the main diagonal of rg",         category:="Linear Algebra", StatusBar:="fills in the highlighted row or column range with the elements on the main diagonal of rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DIAGONAL_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="DIAGONAL", Description:="returns an n x n diagonal array whose main diagonal consists of the elements in array1 (n = # of elements in array1)",         category:="Linear Algebra", StatusBar:="returns an n x n diagonal array whose main diagonal consists of the elements in array1 (n = # of elements in array1)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SUBMATRIX_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "positive integer (initial row); default 1"
                      argDescription(2) = "positive integer (initial column); default 1"
                      argDescription(3) = "non-negative integer (# of rows in the output); default 0"
                      argDescription(4) = "non-negative integer (# of columns in the output); default 0"
                      Application.MacroOptions Macro:="SUBMATRIX", Description:="return a subarray of array1 starting in row row1 and column col1 with nrows rows and ncols columns; if ncols = 0 then use all remaining columns, similarly for rows",         category:="Linear Algebra", StatusBar:="return a subarray of array1 starting in row row1 and column col1 with nrows rows and ncols columns; if ncols = 0 then use all remaining columns, similarly for rows",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MPOWER_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "positive integer"
                      Application.MacroOptions Macro:="MPOWER", Description:="returns an array which consists of array1 raised to the kth power",         category:="Linear Algebra", StatusBar:="returns an array which consists of array1 raised to the kth power",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ELIM_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range (represents the augmented matrix for AX = C"
                      argDescription(1) = "small positive integer (default .0001); any entry during the Gaussian elimination process whose absolute value is less than prec is treated as zero"
                      Application.MacroOptions Macro:="ELIM", Description:="returns an array which contains the result of Gaussian elimination on the matrix defined by array1",         category:="Linear Algebra", StatusBar:="returns an array which contains the result of Gaussian elimination on the matrix defined by array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MRANK_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "positive integer (default .0001); assumes that any entry during the Gaussian elimination process whose absolute value is less than prec is considered to be zero"
                      Application.MacroOptions Macro:="MRANK", Description:="returns the rank of the matrix defined by array1",         category:="Linear Algebra", StatusBar:="returns the rank of the matrix defined by array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LINEQU_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range; with one row per linear equation and one column per variable plus one column for the constant term"
                      argDescription(1) = "positive integer (default .0001); assumes that any entry during the Gaussian elimination process whose absolute value is less than prec is considered to be zero"
                      Application.MacroOptions Macro:="LINEQU", Description:="returns a column array with the solution to the set of linear equations in array1; # of rows in the output = the number of columns in array1 minus one; returns an error array if non-unique solution (#NUM!) or no solution (#N/A!)",         category:="Linear Algebra", StatusBar:="returns a column array with the solution to the set of linear equations in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub eVALUES_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "a square numeric array or cell range"
                      argDescription(1) = "# of iterations in the eigenvalue refinement algorithm (default 200)"
                      argDescription(2) = "if TRUE, eigenvalues are in sorted from highest to lowest in absolute value; otherwise, eigenvalues are sorted from highest to lowest value"
                      argDescription(3) = "if TRUE, a second row is added to the output with values of det(A-cI); valid eigenvalues take a zero value in this row"
                      Application.MacroOptions Macro:="eVALUES", Description:="returns a row array listing the real eigenvalues for array1; non-real eigenvalues are labeled imag",         category:="Linear Algebra", StatusBar:="returns a row array listing the real eigenvalues for array1; non-real eigenvalues are labeled imag",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub eVECTORS_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "a square numeric array or cell range"
                      argDescription(1) = "# of iterations in the eigenvalue refinement algorithm (default 200)"
                      argDescription(2) = "if TRUE, eigenvalues are in sorted from highest to lowest in absolute value; otherwise, eigenvalues are sorted from highest to lowest value"
                      argDescription(3) = "if TRUE, two extra row are added to the output with values of det(A-cI) (valid eigenvalues take a zero value) and max of entries in (A-cI)X (valid eigenvectors take a zero value)"
                      Application.MacroOptions Macro:="eVECTORS", Description:="returns an array whose first row lists the real eigenvalues for array1 (non-real eigenvalues are labeled imag); below each real eigenvalue is a corresponding eigenvector",         category:="Linear Algebra", StatusBar:="returns an array whose first row lists the real eigenvalues for array1 (non-real eigenvalues are labeled imag); below each real eigenvalue is a corresponding eigenvector",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SCHUR_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "a square numeric array or cell range with at least two rows/columns"
                      argDescription(1) = "# of iterations in the Schur factorization process; positive integer (default 100)"
                      argDescription(2) = "if TRUE or -1 (default), eigenvalues used in the calculation are in sorted from highest to lowest in absolute value; if FALSE or 0, eigenvalues are sorted from highest to lowest value; if +1, eigenvalues are not sorted"
                      Application.MacroOptions Macro:="SCHUR", Description:="returns a 2n x n array consisting of Q over T where A = QTQ' is a Schur factorization of A = array1 and n = # of rows/columns in array1",         category:="Linear Algebra", StatusBar:="returns a 2n x n array consisting of Q over T where A = QTQ' is a Schur factorization of A = array1 and n = # of rows/columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SCHURQ_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "a square numeric array or cell range with at least two rows/columns"
                      argDescription(1) = "# of iterations in the Schur factorization process; positive integer (default 100)"
                      argDescription(2) = "if TRUE or -1 (default), eigenvalues used in the calculation are in sorted from highest to lowest in absolute value; if FALSE or 0, eigenvalues are sorted from highest to lowest value; if +1, eigenvalues are not sorted"
                      Application.MacroOptions Macro:="SCHURQ", Description:="returns the n x n Q array where A = QTQ' is a Schur factorization of A = array1 and n = # of rows/columns in array1",         category:="Linear Algebra", StatusBar:="returns an n x n Q array where A = QTQ' is a Schur factorization of A = array1 and n = # of rows/columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub eVAL_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "a square numeric array or cell range"
                      argDescription(1) = "# of iterations in the eigenvalue refinement algorithm (default 200)"
                      argDescription(2) = "if TRUE, eigenvalues are in sorted from highest to lowest in absolute value; otherwise, eigenvalues are sorted from highest to lowest value"
                      argDescription(3) = "if TRUE, a second row is added to the output with values of det(A-cI); valid eigenvalues take a zero value in this row"
                      Application.MacroOptions Macro:="eVAL", Description:="returns a row array listing the real eigenvalues for array1; non-real eigenvalues are labeled imag",         category:="Linear Algebra", StatusBar:="returns a row array listing the real eigenvalues for array1; non-real eigenvalues are labeled imag",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub eVECT_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "a square numeric array or cell range"
                      argDescription(1) = "# of iterations in the eigenvalue refinement algorithm (default 200)"
                      argDescription(2) = "if TRUE, eigenvalues are in sorted from highest to lowest in absolute value; otherwise, eigenvalues are sorted from highest to lowest value"
                      argDescription(3) = "if TRUE, two extra row are added to the output with values of det(A-cI) (valid eigenvalues take a zero value) and max of entries in (A-cI)X (valid eigenvectors take a zero value)"
                      Application.MacroOptions Macro:="eVECT", Description:="returns an array whose first row lists the real eigenvalues for array1 (non-real eigenvalues are labeled imag); below each real eigenvalue is a corresponding eigenvector",         category:="Linear Algebra", StatusBar:="returns an array whose first row lists the real eigenvalues for array1 (non-real eigenvalues are labeled imag); below each real eigenvalue is a corresponding eigenvector",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFactorR_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFactorR", Description:="returns the n x n R array where A = QR is the reduced QR factorization of A = array1 and n = # of columns in array1",         category:="Linear Algebra", StatusBar:="returns the n x n R array where A = QR is the reduced QR factorization of A = array1 and n = # of columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFactorQ_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFactorQ", Description:="returns the m x n Q array where A = QR is the reduced QR factorization of A = array1, an m x n mtrix",         category:="Linear Algebra", StatusBar:="returns the m x n Q array where A = QR is the reduced QR factorization of A = array1, an m x n mtrix",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFactor_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFactor", Description:="returns the (m+n) x n array consisting of Q over R where A = QR is the reduced QR factorization of A = array1, m = # of rows in array1 and n = # of columns in array1",         category:="Linear Algebra", StatusBar:="returns the (m+n) x n array consisting of Q over R where A = QR is the reduced QR factorization of A = array1, m = # of rows in array1 and n = # of columns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFullR_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFullR", Description:="returns the m x n R array where A = QR is a QR factorization of A = array1, an m x n mtrix",         category:="Linear Algebra", StatusBar:="returns the m x n R array where A = QR is a QR factorization of A = array1, an m x n mtrix",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFullQ_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFullQ", Description:="returns the m x m Q array where A = QR is a QR factorization of A = array1, an m x n mtrix",         category:="Linear Algebra", StatusBar:="returns the m x m Q array where A = QR is a QR factorization of A = array1, an m x n mtrix",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRFull_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "estimate of what is considered to be zero; small positive integer (default 0)"
                      Application.MacroOptions Macro:="QRFull", Description:="returns the m x (m+n) array consisting of Q to the left of R where A = QR is a QR factorization of A = array1, an m x n mtrix",         category:="Linear Algebra", StatusBar:="returns the m x (m+n) array consisting of Q to the left of R where A = QR is a QR factorization of A = array1, an m x n mtrix",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSQRT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range representing a positive definite matrix"
                      argDescription(1) = "# of iterations in the QR method used to calculate the eigenvalues of array1; positive integer (default 100)"
                      Application.MacroOptions Macro:="MSQRT", Description:="returns an array which contains the square root of array1; output has the same # of rows/columns as ar

                  General
                  Stream Path:VBA/DescriptorMath
                  VBA File Name:DescriptorMath
                  Stream Size:119022
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . b . X . . . . . . ` . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 1a dd 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 87 dd 00 00 d7 95 01 00 00 00 00 00 01 00 00 00 d4 1f 93 c5 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorMath"
                  Sub StatMath_Descriptors()
                      Call RANDOM_Descriptor
                      Call WRAND_Descriptor
                      Call WRANDOM_Descriptor
                      Call CReal_Descriptor
                      Call CImag_Descriptor
                      Call CAdd_Descriptor
                      Call CSub_Descriptor
                      Call CMult_Descriptor
                      Call CDiv_Descriptor
                      Call CPower_Descriptor
                      Call CLn_Descriptor
                      Call CExp_Descriptor
                      Call CConj_Descriptor
                      Call CAbs_Descriptor
                      Call CSet_Descriptor
                      Call CMap_Descriptor
                      Call CText_Descriptor
                      Call CPolar_Descriptor
                      Call CRect_Descriptor
                      Call CRoots_Descriptor
                      Call ZTranspose_Descriptor
                      Call ZIdentity_Descriptor
                      Call ZAdd_Descriptor
                      Call ZSub_Descriptor
                      Call ZMult_Descriptor
                      Call ZMultScalar_Descriptor
                      Call ZInverse_Descriptor
                      Call ZConj_Descriptor
                      Call ZIndex_Descriptor
                      Call ZMap_Descriptor
                      Call ZText_Descriptor
                      Call ZDET_Descriptor
                      Call ROOTS_Descriptor
                      Call Interpolate_Descriptor
                      Call RandPart_Descriptor
                      Call OrderedPart_Descriptor
                      Call SortedPart_Descriptor
                      Call XGAMMA_Descriptor
                      Call UpperGamma_Descriptor
                      Call LowerGamma_Descriptor
                      Call INIT_PARTITION_Descriptor
                      Call NEXT_PARTITION_Descriptor
                      Call RAND_PARTITION_Descriptor
                      Call INIT_SPLIT_Descriptor
                      Call NEXT_SPLIT_Descriptor
                      Call RAND_SPLIT_Descriptor
                      Call ODDEVEN_SPLIT_Descriptor
                      Call CubicRoots_Descriptor
                      Call MBETA_Descriptor
                      Call MLookup_Descriptor
                      Call ILookup_Descriptor
                      Call PrimeCount_Descriptor
                      Call PrimeList_Descriptor
                      Call NextPrime_Descriptor
                      Call PriorPrime_Descriptor
                      Call NthPrime_Descriptor
                      Call IsPrime_Descriptor
                      Call Factors_Descriptor
                      Call BIT_OR_Descriptor
                      Call BIT_XOR_Descriptor
                      Call BIT_AND_Descriptor
                      Call BIT_LSHIFT_Descriptor
                      Call BIT_RSHIFT_Descriptor
                      Call ZMADD_Descriptor
                      Call ZMSUB_Descriptor
                      Call ZMMULT_Descriptor
                      Call ZMMULTSCALAR_Descriptor
                      Call ZMINVERSE_Descriptor
                      Call ZMCONJUGATE_Descriptor
                      Call ZMDETERM_Descriptor
                      Call ZMROUND_Descriptor
                      Call LNCOMBIN_Descriptor
                      Call IMROUND_Descriptor
                      Call IMROOTS_Descriptor
                      Call SPLINE_Descriptor
                      Call SPLINE0_Descriptor
                      Call MSTKruskal_Descriptor
                      Call MSTPrim_Descriptor
                      Call MSTVectors_Descriptor
                      Call ZReal_Descriptor
                      Call ZImag_Descriptor
                      Call ZLen_Descriptor
                      Call ZNorm_Descriptor
                      Call ZSet_Descriptor
                      Call RANDX_Descriptor
                      Call Array2String_Descriptor
                      Call FIRST_SIG_Descriptor
                      Call Ei_Descriptor
                  End Sub
                  
                  Sub RANDOM_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "number (defaults to 0)"
                      argDescription(1) = "number larger than a (defaults to 1)"
                      argDescription(2) = "if FALSE (default) then random decimal number is generated, while if TRUE then a random integer is generated"
                      argDescription(3) = "integer value; if positive then this value is used as a seed; otherwise no seed is employed (default 0)"
                      Application.MacroOptions Macro:="RANDOM", Description:="returns a (non-volatile) random number between a and b",         category:="More Math", StatusBar:="returns a (non-volatile) random number between a and b",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WRAND_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column array or cell range containing non-negative numbers which play the role of weights"
                      argDescription(1) = "if TRUE (default) then index to the random value in array1 is returned; otherwise the cummulative value for this entry is returned"
                      Application.MacroOptions Macro:="WRAND", Description:="a random number is generated between 1 and the number of elements in array1, based on this number a value is returned as described in indx",         category:="More Math", StatusBar:="a random number is generated between 1 and the number of elements in array1, based on this number a value is returned as described in indx",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CReal_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CReal", Description:="Real part of z",         category:="More Math", StatusBar:="Real part of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CImag_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CImag", Description:="Imaginary part of z",         category:="More Math", StatusBar:="Imaginary part of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CAdd_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      argDescription(1) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      argDescription(2) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number (optional)"
                      argDescription(3) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number (optional)"
                      argDescription(4) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number (optional)"
                      Application.MacroOptions Macro:="CAdd", Description:="1 x 2 numeric array representing the sum z1 + z2 (+ z3 + z4 + z5)",         category:="More Math", StatusBar:="1 x 2 numeric array representing the sum z1 + z2 (+ z3 + z4 + z5)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CSub_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      argDescription(1) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      Application.MacroOptions Macro:="CSub", Description:="1 x 2 numeric array representing the difference z1 - z2",         category:="More Math", StatusBar:="1 x 2 numeric array representing the difference z1 - z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CMult_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      argDescription(1) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      Application.MacroOptions Macro:="CMult", Description:="1 x 2 numeric array representing the product z1 x z2",         category:="More Math", StatusBar:="1 x 2 numeric array representing the product z1 x z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CDiv_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number, or numeric value representing a real number"
                      argDescription(1) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CDiv", Description:="1 x 2 numeric array representing the quotient z1 / z2",         category:="More Math", StatusBar:="1 x 2 numeric array representing the quotient z1 / z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CPower_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      argDescription(1) = "numeric value"
                      Application.MacroOptions Macro:="CPower", Description:="1 x 2 numeric array representing z raised to the c power",         category:="More Math", StatusBar:="1 x 2 numeric array representing z raised to the c power",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CLn_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CLn", Description:="1 x 2 numeric array representing the natural log of z",         category:="More Math", StatusBar:="1 x 2 numeric array representing the natural log of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CExp_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CExp", Description:="1 x 2 numeric array representing the exponential of z, Exp(z)",         category:="More Math", StatusBar:="1 x 2 numeric array representing the exponential of z, Exp(z)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CConj_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CConj", Description:="1 x 2 numeric array representing the conjugate of z",         category:="More Math", StatusBar:="1 x 2 numeric array representing the conjugate of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CAbs_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="CAbs", Description:="1 x 2 numeric array representing the absolute value of z",         category:="More Math", StatusBar:="1 x 2 numeric array representing the absolute value of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CSet_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric value representing the real part of a complex number"
                      argDescription(1) = "numeric value representing the imaginary part of a complex number"
                      Application.MacroOptions Macro:="CSet", Description:="1 x 2 numeric array representing the complex number with real part xreal and imaginary part ximag",         category:="More Math", StatusBar:="1 x 2 numeric array representing the complex number with real part xreal and imaginary part ximag",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CMap_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "string representing a complex number in Excel format"
                      Application.MacroOptions Macro:="CMap", Description:="1 x 2 numeric array representing the complex number in s",         category:="More Math", StatusBar:="1 x 2 numeric array representing the complex number in s",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CText_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "1 x 2 numeric array or cell range representing the complex number"
                      Application.MacroOptions Macro:="CText", Description:="text representation of the complex number z (i.e. z in Excel complex number format)",         category:="More Math", StatusBar:="text representation of the complex number z (i.e. in Excel complex number format)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZTranspose_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "m x 2n array or cell range representing a complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      Application.MacroOptions Macro:="ZTranspose", Description:="n x 2m array representing the transpose of the complex matrix z",         category:="More Math", StatusBar:="n x 2m array representing the transpose of the complex matrix z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZIdentity_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "dimension of the identity matrix; numeric value (if omitted, use the dimensions of the highlighted range)"
                      Application.MacroOptions Macro:="ZIdentity", Description:="k x 2k array representing the complex number identity matrix, where left half contains real parts and right half contains imaginary parts",         category:="More Math", StatusBar:="k x 2k array representing the complex number identity matrix, where left half contains real parts and right half contains imaginary parts",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZAdd_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "m x 2n array or cell range representing a complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "m x 2n array or cell range representing a complex matrix with the same dimensions as z1"
                      Application.MacroOptions Macro:="ZAdd", Description:="m x 2n array representing the complex matrix which is the sum z1 + z2",         category:="More Math", StatusBar:="m x 2n array representing the complex matrix which is the sum z1 + z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZSub_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "m x 2n array or cell range representing a complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "m x 2n array or cell range representing a complex matrix with the same dimensions as z1"
                      Application.MacroOptions Macro:="ZSub", Description:="m x 2n array representing the complex matrix which is the difference z1 - z2",         category:="More Math", StatusBar:="m x 2n array representing the complex matrix which is the difference z1 - z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZMult_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "m x 2n array or cell range representing a complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "n x 2k array or cell range representing a complex matrix with the same # of rows as z1 has columns"
                      Application.MacroOptions Macro:="ZMult", Description:="m x 2k array representing the complex matrix which is the product z1 x z2",         category:="More Math", StatusBar:="m x 2k array representing the complex matrix which is the product z1 x z2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZMultScalar_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "m x 2n array or cell range representing a complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "1 x 2 numeric array or cell range representing a complex number"
                      Application.MacroOptions Macro:="ZMultScalar", Description:="m x 2n array representing the complex matrix which is the product of c and z",         category:="More Math", StatusBar:="m x 2n array representing the complex matrix which is the product of c and z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZInverse_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "n x 2n array or cell range representing a square complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      Application.MacroOptions Macro:="ZInverse", Description:="n x 2n array representing the inverse of the complex matrix z",         category:="More Math", StatusBar:="n x 2n array representing the inverse of the complex matrix z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZConj_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "n x 2n array or cell range representing a square complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      Application.MacroOptions Macro:="ZConj", Description:="n x 2n array representing the conjugate of the complex matrix z",         category:="More Math", StatusBar:="n x 2n array representing the conjugate of the complex matrix z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZIndex_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "m x 2n array or cell range representing a square complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "row index (non-negative integer between 1 and m)"
                      argDescription(2) = "column index (non-negative integer between 1 and n)"
                      Application.MacroOptions Macro:="ZIndex", Description:="1 x 2 array representing the complex number in the rth row and cth column of z",         category:="More Math", StatusBar:="1 x 2 array representing the complex number in the rth row and cth column of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZMap_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "m x n array or cell range representing a complex number matrix whose values are in Excel format"
                      Application.MacroOptions Macro:="ZMap", Description:="m x 2n numeric array representing the matrix of complex numbers in z",         category:="More Math", StatusBar:="m x 2n numeric array representing the matrix of complex numbers in z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZText_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "m x 2n numeric array or cell range representing the complex number"
                      Application.MacroOptions Macro:="ZText", Description:="m x n array containing the complex number values in z in Excel format",         category:="More Math", StatusBar:="m x n array containing the complex number values in z in Excel format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ZDET_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "n x 2n array or cell range representing a square complex number matrix, where left half contains real parts and right half contains imaginary parts"
                      argDescription(1) = "positive number (default 0.0001); any number less than this is equivalent to zero"
                      Application.MacroOptions Macro:="ZDET", Description:="returns the determinant of z",         category:="More Math", StatusBar:="returns the determinant of z",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ROOTS_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric column array or cell range representing a polynomial with real coefficients; first entry is the constant and last entry is the coefficient with degree m-1 where array1 has m rows"
                      argDescription(1) = "Bairstow's method terminates if this level of precision is met; small positive number (default 0.00000001)"
                      argDescription(2) = "maximum # of iterations in the Bairstow's method; positive integer (default 200)"
                      argDescription(3) = "Bairstow's r seed value (default 0)"
                      argDescription(4) = "Bairstow's s seed value (default 0)"
                      Application.MacroOptions Macro:="ROOTS", Description:="returns an m-1 x 2 array, where m = # of rows in array1; each row represents a complex number root",         category:="More Math", StatusBar:="returns an m-1 x 2 array, where m = # of rows in array1; each row represents a complex number root",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WRANDOM_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "row or column array or cell range containing non-negative numbers which play the role of weights"
                      argDescription(1) = "if TRUE then repetitions are allowed; if FALSE (default) then no repetitions are allowed"
                      Application.MacroOptions Macro:="WRANDOM", Description:="returns a range of indices (i.e. row or column numbers) randomly selected based on the weights in warray; if warray is a row (column) array then so is the output",         category:="More Math", StatusBar:="returns a range of indices (i.e. row or column numbers) randomly selected based on the weights in warray; if warray is a row (column) array then so is the output",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Interpolate_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "number between r1 and r2"
                      argDescription(1) = "number"
                      argDescription(2) = "number"
                      argDescription(3) = "number corresponding to r1"
                      argDescription(4) = "number co

                  General
                  Stream Path:VBA/DescriptorMisc
                  VBA File Name:DescriptorMisc
                  Stream Size:237277
                  Data ASCII:. . . . . . . . . . . . . . . . . 7 . . . . . . . . . . . . . . { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . . . T . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 ca 87 01 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 37 88 01 00 ff 11 03 00 00 00 00 00 01 00 00 00 d4 1f 99 7b 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorMisc"
                  Sub Misc_Descriptors()
                      Call TREND_ANOVA_Descriptor
                      Call TREND_COEFF_Descriptor
                      Call ADDITIVITY_ANOVA_Descriptor
                      Call CONTEST_Descriptor
                      Call BARTLETT_Descriptor
                      Call Ancova1Light_Descriptor
                      Call dfRowStd_Descriptor
                      Call dfColStd_Descriptor
                      Call dfIntStd_Descriptor
                      Call dfWFStd_Descriptor
                      Call Std2Art_Descriptor
                      Call Std3Art_Descriptor
                      Call SheetNames_Descriptor
                      Call ZEigMultVECT_Descriptor
                      Call ExtractCommunalities_Descriptor
                      Call ARIMA_SE_Descriptor
                      Call HAUSMAN_Descriptor
                      Call HLTEST_Descriptor
                      Call HOSMER_Descriptor
                      Call LogitReduce_Descriptor
                      Call LogitSelect_Descriptor
                      Call LogitMatches_Descriptor
                      Call SEN_INTERCEPT_Descriptor
                      Call CONCORD_Descriptor
                      Call DISCORD_Descriptor
                      Call GAMMA_TEST_Descriptor
                      Call LAMBDA_TEST_Descriptor
                      Call SOMERS_TEST_Descriptor
                      Call LAMBDA_COEFF_Descriptor
                      Call MSOMERS_Descriptor
                      Call KTSReg_Descriptor
                      Call KENDALLU_PROB_Descriptor
                      Call TC_PROB_Descriptor
                      Call PERM_TEST_Descriptor
                      Call PERM2_TEST_Descriptor
                      Call PageCRIT_Descriptor
                      Call PagePROB_Descriptor
                      Call PREF_MATRIX_Descriptor
                      Call PAGE_TEST_Descriptor
                      Call ST_TEST_Descriptor
                      Call MOSES_TEST_Descriptor
                      Call CHANGEPT_TEST_Descriptor
                      Call CHANGEPT_BTEST_Descriptor
                      Call KENDALLU_Descriptor
                      Call TC_TEST_Descriptor
                      Call NEGBINOM_FIT_Descriptor
                      Call NEGBINOM_FITM_Descriptor
                      Call PERT_MLE_Descriptor
                      Call TRIANG_MLE_Descriptor
                      Call PERT_FIT_Descriptor
                      Call TRIANG_FIT_Descriptor
                      Call PERT_FITM_Descriptor
                      Call TRIANG_FITM_Descriptor
                      Call ICF_GOF_Descriptor
                      Call OBrienTest_Descriptor
                      Call IsCell_Descriptor
                      Call FRACS_Descriptor
                      Call NFRAC_Descriptor
                      Call FRAC2DEC_Descriptor
                      Call FRAC_REP_Descriptor
                      Call FRAC_FIXED_Descriptor
                      Call EULER_Descriptor
                      Call Divisors_Descriptor
                      Call PrimeFactors_Descriptor
                      Call TConvert_Descriptor
                      Call IGAMMA_Descriptor
                      Call CodeImage_Descriptor
                      Call GAMMA_DIST_Descriptor
                      Call GAMMA_INV_Descriptor
                      Call Convert2Grey_Descriptor
                      Call ColorDistSq_Descriptor
                      Call ColLabel_Descriptor
                      Call FirstNonNum_Descriptor
                      Call FTEXT_Descriptor
                      Call INDEX_MAX_Descriptor
                      Call INDEX_MIN_Descriptor
                      Call VER_Descriptor
                      Call ExcelVer_Descriptor
                      Call TOptimize_Descriptor
                      Call TInteract_Descriptor
                      Call Anova1Res_Descriptor
                      Call Anova2Res_Descriptor
                      Call Anova3Res_Descriptor
                      Call Anova1ResX_Descriptor
                      Call Anova2Std_Descriptor
                      Call StdAnova2_Descriptor
                      Call Anova1Std_Descriptor
                      Call StdAnova1_Descriptor
                      Call Anova3Cols_Descriptor
                      Call Anova3Rows_Descriptor
                      Call StdNested_Descriptor
                      Call Split2Std_Descriptor
                      Call Ancova1Std_Descriptor
                      Call ADJK_Descriptor
                      Call GGEpsilon_Descriptor
                      Call HFEpsilon_Descriptor
                      Call GG_Epsilon_Descriptor
                      Call HF_Epsilon_Descriptor
                      Call LEVENE_Descriptor
                      Call DunnSidak_Descriptor
                      Call FKTEST_Descriptor
                      Call RCBDMissing_Descriptor
                      Call RCBDAdjSS_Descriptor
                      Call SS_RCBD_Descriptor
                      Call REGWQ_Descriptor
                      Call SSAncova_Descriptor
                      Call AncovaMeans_Descriptor
                      Call AncovaParallel_Descriptor
                      Call TUKEY_Descriptor
                      Call SS2k_Descriptor
                      Call Effect2k_Descriptor
                      Call Design2k_Descriptor
                      Call ExpandDesign2k_Descriptor
                      Call MauchlyTest_Descriptor
                      Call JNSTest_Descriptor
                      Call Ancova1Reg_Descriptor
                      Call Ancova1RegFull_Descriptor
                      Call MNORMDIST_Descriptor
                      Call MNORMRECT_Descriptor
                      Call HAMPEL_Descriptor
                      Call TobitCoeff_Descriptor
                      Call TobitPred_Descriptor
                      Call TobitLL_Descriptor
                      Call T_EFFECT3_Descriptor
                      Call TT_EFFECT3_Descriptor
                      Call WVAR_Descriptor
                      Call WSTDEV_Descriptor
                      Call WCOV_Descriptor
                      Call COUNT_IF_Descriptor
                      Call COUNTS_IF_Descriptor
                      Call SUM_IF_Descriptor
                      Call SUMS_IF_Descriptor
                      Call AVG_IF_Descriptor
                      Call AVGS_IF_Descriptor
                      Call COV_IF_Descriptor
                      Call NORM_FIT_Descriptor
                      Call LOGNORM_FITM_Descriptor
                      Call POISSON_FIT_Descriptor
                      Call BINOM_FIT_Descriptor
                      Call Pruning_Descriptor
                      Call MatchQuality_Descriptor
                      Call CEM_Coding_Descriptor
                      Call CEM_Pairing_Descriptor
                      Call PSM_Matching_Descriptor
                      Call RowMatch_Descriptor
                      Call POISSON_INV_Descriptor
                      Call ORDER_VAR_Descriptor
                      Call DELCOL_Descriptor
                      Call SSAnova2_Descriptor
                      Call SSAnova3_Descriptor
                      Call SSRW_Descriptor
                      Call SSRRow_Descriptor
                      Call SSRInt_Descriptor
                      Call CorrelETest_Descriptor
                      Call LinEqSolve_Descriptor
                      Call GEOM_DIST_Descriptor
                      Call GEOM_INV_Descriptor
                  End Sub
                  
                  ' anova
                  
                  Sub ADDITIVITY_ANOVA_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range with ANOVA data in Excel format"
                      Application.MacroOptions Macro:="ADDITIVITY_ANOVA", Description:="returns the p-value for Tukey's Additivity Test for the data in array1",         category:="Anova", StatusBar:="returns the p-value for Tukey's Additivity Test for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CONTEST_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range with ANOVA data in Excel format"
                      Application.MacroOptions Macro:="CONTEST", Description:="returns the p-value for Conover's Test of homogeneity of variances for the data in array1",         category:="Anova", StatusBar:="returns the p-value for Conover's Test of homogeneity of variances for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BARTLETT_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range with ANOVA data in Excel format"
                      Application.MacroOptions Macro:="BARTLETT", Description:="returns the p-value for Bartlett's Test of homogeneity of variances for the data in array1",         category:="Anova", StatusBar:="returns the p-value for Bartlett's Test of homogeneity of variances for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub OBrienTest_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range with ANOVA data in Excel format"
                      Application.MacroOptions Macro:="OBrienTest", Description:="returns the p-value for O'Brien's Test of homogeneity of variances for the data in array1",         category:="Anova", StatusBar:="returns the p-value for O'Brien's Test of homogeneity of variances for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Ancova1Light_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array in standard form with 3 or 4 columns; col 1 = categorical avariable; col 2 = dependent variable; col 3 (and optionally col 4) = covariant(s)"
                      argDescription(1) = "if TRUE then array1 contains column headings (default FALSE)"
                      argDescription(2) = "if TRUE then covariant data is centered in the output (default TRUE)"
                      Application.MacroOptions Macro:="Ancova1Light", Description:="converts data in one-way Ancova stacked format to full regression format for Ancova Light",         category:="Anova", StatusBar:="converts data in one-way Ancova stacked format to full regression format for Ancova Light",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TREND_ANOVA_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric column array or cell range with group means"
                      argDescription(1) = "numeric column array or cell range with group counts"
                      argDescription(2) = "positive numeric value with SS for error"
                      argDescription(3) = "positive integer value with df for error"
                      argDescription(4) = "positive numeric value with SS for treatments (optional)"
                      argDescription(5) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="TREND_ANOVA", Description:="returns trend analysis based on ANOVA",         category:="Anova", StatusBar:="returns trend analysis based on ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TREND_COEFF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "# of groups; integer 2 or higher"
                      argDescription(1) = "if TRUE then a column of lambda values is appended to the right side of the output (default FALSE)"
                      Application.MacroOptions Macro:="TREND_COEFF", Description:="returns an array of orthogonal polynomial contrast coefficients (and optionally lambda values) of the specified size",         category:="Anova", StatusBar:="returns an array of orthogonal polynomial contrast coefficients (and optionally lambda values) of the specified size",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfRowStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range in standard (stacked) format for two-factor ANOVA"
                      Application.MacroOptions Macro:="dfRowStd", Description:="returns dfRow for two-factor ANOVA",         category:="Anova", StatusBar:="returns dfRow for two-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfColStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range in standard (stacked) format for two-factor ANOVA"
                      Application.MacroOptions Macro:="dfColStd", Description:="returns dfCol for two-factor ANOVA",         category:="Anova", StatusBar:="returns dfCol for two-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfIntStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range in standard (stacked) format for two-factor ANOVA"
                      Application.MacroOptions Macro:="dfIntStd", Description:="returns dfInt for two-factor ANOVA",         category:="Anova", StatusBar:="returns dfInt for two-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfWFStd_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range in standard (stacked) format for two-factor ANOVA"
                      Application.MacroOptions Macro:="dfWFStd", Description:="returns dfW for two-factor ANOVA",         category:="Anova", StatusBar:="returns dfW for two-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Std2Art_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data in two-way ANOVA standard (stacked) format"
                      argDescription(1) = "if TRUE (default FALSE) data as well as output contains column headings"
                      Application.MacroOptions Macro:="Std2Art", Description:="converts data in darray in standard format for two factor Anova into ART Anova format for rows, columns and interaction",         category:="Anova", StatusBar:="converts data in darray in standard format for two factor Anova into ART Anova format for rows, columns and interaction",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Std3Art_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data in three-way ANOVA standard (stacked) format"
                      argDescription(1) = "if TRUE (default FALSE) data as well as output contains column headings"
                      Application.MacroOptions Macro:="Std3Art", Description:="converts data in darray in standard format for three factor Anova into ART Anova format for A, B, C, and interactions",         category:="Anova", StatusBar:="converts data in darray in standard format for three factor Anova into ART Anova format for A, B, C, and interactions",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TOptimize_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or range with appended row labels and no column labels from a Taguchi design"
                      argDescription(1) = "two-col array; the 2nd col contains labels that correspond to the row labels in marray; labels with non-blank entries in the 1st col are excluded from the output (default: no entries are excluded)"
                      argDescription(2) = "optimization code: 'max' (default), 'min', or target value (positive numeric value)"
                      argDescription(3) = "if TRUE (default), use S/N values; otherwise, use average values"
                      argDescription(4) = "if TRUE (default), only return optimum values; otherwise return all combinations"
                      Application.MacroOptions Macro:="TOptimize", Description:="returns an array with optimum factor values",         category:="Anova", StatusBar:="returns an array with optimum factor values",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TInteract_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column number in a Taguchi design (positive integer)"
                      argDescription(1) = "column number in a Taguchi design (positive integer) different from i"
                      argDescription(2) = "maximum # of levels in columns i and j limited to 2 (default), 3 and 4; or 8 for L8 design or 16 for L16 design"
                      Application.MacroOptions Macro:="TInteract", Description:="returns row array with column number(s) of interaction between columns i and j (or 0 if none exists)",         category:="Anova", StatusBar:="returns row array with column number(s) of interaction between columns i and j (or 0 if none exists)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova1Res_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in standard format for one-factor ANOVA format"
                      Application.MacroOptions Macro:="Anova1Res", Description:="returns a column array with the residuals for the one-factor ANOVA",         category:="Anova", StatusBar:="returns a column array with the residuals for the one-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova2Res_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in standard format for two-factor ANOVA format"
                      Application.MacroOptions Macro:="Anova2Res", Description:="returns a column array with the residuals for the two-factor ANOVA",         category:="Anova", StatusBar:="returns a column array with the residuals for the two-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova3Res_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in standard (column) format for three-factor ANOVA format"
                      Application.MacroOptions Macro:="Anova3Res", Description:="returns a column array with the residuals for the three-factor ANOVA",         category:="Anova", StatusBar:="returns a column array with the residuals for the three-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova1ResX_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in Excel format w/o headings for one-factor ANOVA format"
                      Application.MacroOptions Macro:="Anova1ResX", Description:="returns a column array with the residuals for the one-factor ANOVA",         category:="Anova", StatusBar:="returns a column array with the residuals for the one-factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova2Std_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data in two-way ANOVA Excel format with headings"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="Anova2Std", Description:="returns the data in rg converted to stacked format",         category:="Anova", StatusBar:="returns the data in rg converted to stacked format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub StdAnova2_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data in two-way ANOVA standard (stacked) format without headings"
                      Application.MacroOptions Macro:="StdAnova2", Description:="returns the data in rg converted to Excel format (with headings)",         category:="Anova", StatusBar:="returns the data in rg converted to Excel format (with headings)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova1Std_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA Excel format with headings"
                      Application.MacroOptions Macro:="Anova1Std", Description:="returns the data in array1 converted to stacked format",         category:="Anova", StatusBar:="returns the data in array1 converted to stacked format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub StdAnova1_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range with data in one-way ANOVA standard (stacked) format without headings"
                      Application.MacroOptions Macro:="StdAnova1", Description:="returns the data in array1 converted to Excel format (with headings)",         category:="Anova", StatusBar:="returns the data in array1 converted to Excel format (with headings)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova3Cols_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data in three-way ANOVA standard row (stacked) format without headings"
                      Application.MacroOptions Macro:="Anova3Cols", Description:="returns the data in rg converted to three-way ANOVA standard column format",         category:="Anova", StatusBar:="returns the data in rg converted to three-way ANOVA standard column format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Anova3Rows_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data in three-way ANOVA standard column (stacked) format without headings"
                      Application.MacroOptions Macro:="Anova3Rows", Description:="returns the data in rg converted to three-way ANOVA standard row format",         category:="Anova", StatusBar:="returns the data in rg converted to three-way ANOVA standard row format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub StdNested_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data in standard column (stacked) format without headings"
                      Application.MacroOptions Macro:="StdNested", Description:="returns the data in rg converted to two-factor nested ANOVA Excel format with headings",         category:="Anova", StatusBar:="returns the data in rg converted to two-factor nested ANOVA Excel format with headings",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Split2Std_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data in two-way Split-Plot ANOVA Excel format with headings"
                      argDescription(1) = "number of rows making up a group"
                      Application.MacroOptions Macro:="Split2Std", Description:="returns the data in rg converted to stacked format",         category:="Anova", StatusBar:="returns the data in rg converted to stacked format",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ADJK_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "positive integer"
                      argDescription(1) = "positive integer; defaults to 1"
                      argDescription(2) = "positive integer; defaults to 1"
                      Application.MacroOptions Macro:="ADJK", Description:="returns adjusted k value for m x n table in Tukey's HSD for Two factor ANOVA or m x n x h table for Three Factor ANOVA",         category:="Anova", StatusBar:="returns adjusted k value for m x n table in Tukey's HSD for Two factor ANOVA or m x n x h table for Three Factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Ancova1Std_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data in one factor ANCOVA Excel format with headings"
                      argDescription(1) = "numeric range with covariates in one factor ANCOVA Excel format with headings"
                      Application.MacroOptions Macro:="Ancova1Std", Description:="returns the data in rg converted to stacked format",         category:="Anova", StatusBar:="ret

                  General
                  Stream Path:VBA/DescriptorMissing
                  VBA File Name:DescriptorMissing
                  Stream Size:34947
                  Data ASCII:. . . . . . . . 2 . . . . . . . . 2 . . o q . . . . . . . . . . . ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . P 0 . . . . j . X . . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 92 32 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff ff 32 00 00 6f 71 00 00 00 00 00 00 01 00 00 00 d4 1f 28 0d 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorMissing"
                  Sub Missing_Descriptors()
                      Call EM_MNORM_Descriptor
                      Call EM_MNORM_IMPUTE_Descriptor
                      Call EM_CHISQ_IMPUTE_Descriptor
                      Call EM_CHISQ_EXP_IMPUTE_Descriptor
                      Call EM_CHISQ_Descriptor
                      Call EM_CHISQ_EXP_Descriptor
                      Call EM_CHISQ_TEST_Descriptor
                      Call ImputeParam_Descriptor
                      Call ImputeVar_Descriptor
                      Call ImputeSimple_Descriptor
                      Call ImputeReg_Descriptor
                      Call ImputeFCS_Descriptor
                      Call ImputedData_Descriptor
                      Call DescStats_Descriptor
                      Call MissingPatterns_Descriptor
                      Call CountPatterns_Descriptor
                      Call MissingFreq_Descriptor
                      Call MissingPairwise_Descriptor
                      Call MISummary_Descriptor
                  End Sub
                  
                  Sub EM_MNORM_IMPUTE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range (each column represents data for a different variable; non-numeric values represent missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      Application.MacroOptions Macro:="EM_MNORM_IMPUTE", Description:="returns an array identical to arrray1 but with any missing data elements imputed (using EM algorithm)",         category:="Missing", StatusBar:="returns an array identical to arrray1 but with any missing data elements imputed (using EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_MNORM_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range (each column represents data for a different variable; non-numeric values represent missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      Application.MacroOptions Macro:="EM_MNORM", Description:="returns the covariance matrix for arrray1 with any missing data elements imputed (using EM algorithm) with a row of variable means",         category:="Missing", StatusBar:="returns the covariance matrix for arrray1 with any missing data elements imputed (using EM algorithm) with a row of variable means",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_CHISQ_IMPUTE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range: two-dimensional contingency table in Excel format (the last row and column contain counts of missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      argDescription(2) = "precision of result (default 0.00000001); small positive number"
                      Application.MacroOptions Macro:="EM_CHISQ_IMPUTE", Description:="returns an array with one less row and column than array1, representing array1 with missing data imputed (via EM algorithm)",         category:="Missing", StatusBar:="returns an array with one less row and column than array1, representing array1 with missing data imputed (via EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_CHISQ_EXP_IMPUTE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range: two-dimensional contingency table in Excel format (the last row and column contain counts of missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      argDescription(2) = "precision of result (default 0.00000001); small positive number"
                      Application.MacroOptions Macro:="EM_CHISQ_EXP_IMPUTE", Description:="returns an array with one less row and column than array1, representing array1 with missing data imputed assuming independence (via EM algorithm)",         category:="Missing", StatusBar:="returns an array with one less row and column than array1, representing array1 with missing data imputed assuming independence (via EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_CHISQ_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range: two-dimensional contingency table in Excel format (the last row and column contain counts of missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      argDescription(2) = "precision of result (default 0.00000001); small positive number"
                      Application.MacroOptions Macro:="EM_CHISQ", Description:="returns an array with one less row and column than array1, containing probability estimates based on imputed missing data (via EM algorithm)",         category:="Missing", StatusBar:="returns an array with one less row and column than array1, containing probability estimates based on imputed missing data (via EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_CHISQ_EXP_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range: two-dimensional contingency table in Excel format (the last row and column contain counts of missing data)"
                      argDescription(1) = "number of iterations to use in the calculation (default 200); positive integer"
                      argDescription(2) = "precision of result (default 0.00000001); small positive number"
                      Application.MacroOptions Macro:="EM_CHISQ_EXP", Description:="returns an array with one less row and column than array1, containing probability estimates based on imputed missing data assuming independence (via EM algorithm)",         category:="Missing", StatusBar:="returns an array with one less row and column than array1, containing probability estimates based on imputed missing data assuming independence(via EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub EM_CHISQ_TEST_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range: two-dimensional contingency table in Excel format (the last row and column contain counts of missing data)"
                      argDescription(1) = "if TRUE, then a column of labels is appended to the output (default FALSE)"
                      argDescription(2) = "number of iterations to use in the calculation (default 200); positive integer"
                      argDescription(3) = "precision of result (default 0.00000001); small positive number"
                      Application.MacroOptions Macro:="EM_CHISQ_TEST", Description:="returns an array with chi-sq stat, df and p-value for chi-square independence test for a contingency table with missing data (via EM algorithm)",         category:="Missing", StatusBar:="returns an array with chi-sq stat, df and p-value for chi-square independence test for a contingency table with missing data (via EM algorithm)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputeReg_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "cell range with numeric data except possibly in one column (non-numeric data assumed to be missing)"
                      argDescription(1) = "positive integer (specifies column with missing data)"
                      argDescription(2) = "if TRUE (default) then column headings are included in rg and output; otherwise no column headings are included"
                      argDescription(3) = "cell range (w/o headings) containing one set of constraints of form min, max, roundoff (if ommitted then no constraints)"
                      argDescription(4) = "number of iterations for constraints (default 25); positive integer"
                      Application.MacroOptions Macro:="ImputeReg", Description:="returns an array identical to rg but with missing data imputed via stochastice regression",         category:="Missing", StatusBar:="returns an array identical to rg but with missing data imputed via stochastice regression",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputeSimple_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "cell range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "if TRUE (default) then column headings are included in rg and output; otherwise no column headings are included"
                      argDescription(2) = "cell range (w/o headings) containing one set of constraints of form variable name, min, max, roundoff (if ommitted then no constraints)"
                      argDescription(3) = "number of iterations for constraints (default 25); positive integer"
                      Application.MacroOptions Macro:="ImputeSimple", Description:="returns an array identical to rg with missing data filled in with mean + standard deviation times a random value from standard normal distribution",         category:="Missing", StatusBar:="returns an array identical to rg with missing data filled in with mean + standard deviation times a random value from standard normal distribution",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputeFCS_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "cell range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "number of iterations in FCS algorithm (default 20); positive integer"
                      argDescription(2) = "if TRUE (default) then column headings are included in rg and output (required if there are constraints); otherwise no column headings are included"
                      argDescription(3) = "cell range (w/o headings) containing one set of constraints of form variable name, min, max, roundoff (if ommitted then no constraints)"
                      argDescription(4) = "number of iterations for constraints (default 25); positive integer"
                      Application.MacroOptions Macro:="ImputeFCS", Description:="returns an array identical to rg but with missing data imputed via FCS algorithm",         category:="Missing", StatusBar:="returns an array identical to rg but with missing data imputed via FCS algorithm",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputedData_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "array or range with numeric data (complete data) of same size as marray"
                      argDescription(2) = "if TRUE (default FALSE) then column headings are included in marray, carray and output; otherwise no column headings are included"
                      Application.MacroOptions Macro:="ImputedData", Description:="returns an array of the same size as marray containing only the missing data filled in from data in carray",         category:="Missing", StatusBar:="returns an array of the same size as marray containing only the missing data filled in from data in carray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DescStats_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or range with numeric data (presumably complete data)"
                      argDescription(1) = "if TRUE (default FALSE) then a column of labels is appended to the output"
                      argDescription(2) = "if TRUE (deafult FALSE) then column headings are included in marray, carray and output; otherwise no column headings are included"
                      argDescription(3) = "array or range with numeric data of same size as carray possibly with some missing (i.e. non-numeric) data (can be ommitted)"
                      Application.MacroOptions Macro:="DescStats", Description:="returns an array with count, mean, standard deviation, min and max of each column in carray (or of elements in carray where marray has missing data)",         category:="Missing", StatusBar:="returns an array with count, mean, standard deviation, min and max of column in carray (or of elements in carray where marray has missing data",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MissingPatterns_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "if TRUE (default) then column headings are included in array1 and output; otherwise no column headings are included"
                      argDescription(2) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="MissingPatterns", Description:="returns an array with a list of all the missing data patterns in array1 plus a count and freq % for each pattern",         category:="Missing", StatusBar:="returns an array with a list of all the missing data patterns in array1 plus a count and freq % for each pattern",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CountPatterns_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      Application.MacroOptions Macro:="CountPatterns", Description:="returns a count of all the missing data patterns in array1",         category:="Missing", StatusBar:="returns a count of all the missing data patterns in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MissingFreq_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "cell range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "if TRUE (default) then column headings are included in rg"
                      Application.MacroOptions Macro:="MissingFreq", Description:="returns a 3 x (n+2) array with counts of non-missing data, where n = # of columns in rg",         category:="Missing", StatusBar:="returns a 3 x (n+2) array with counts of non-missing data, where n = # of columns in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MissingPairwise_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "cell range with numeric data except for missing data (non-numeric data assumed to be missing)"
                      argDescription(1) = "if TRUE (default = FALSE) then rg contains column headings and these are used to create row and column headings in the output"
                      Application.MacroOptions Macro:="MissingPairwise", Description:="returns a n x n array containing the % of pairwise non-missing data, where n = # of columns in rg",         category:="Missing", StatusBar:="returns a a n x n array containing the % of pairwise non-missing data, where n = # of columns in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MISummary_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "cell range with numeric data (n columns, the last column contains y data, other columns contain x data)"
                      argDescription(1) = "if TRUE (default = FALSE) then rg and output contains column headings"
                      Application.MacroOptions Macro:="MISummary", Description:="returns a 5 x (n+1) array containing regression summary data (coeff, se, mean, stdev, R^2, size); extra row appended if head = TRUE",         category:="Missing", StatusBar:="returns a 5 x (n+1) array containing regression summary data (coeff, se, mean, stdev, R^2, size); extra row appended if head = TRUE",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputeParam_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "2m x n range with numeric data (w/o counting an optional labels in 1st col); cols represent imputations; the top part of rg are parameters (for each imputation) and the bottom part are the corresponding std errors"
                      argDescription(1) = "number of rows in rg (positive integer), including missing data"
                      argDescription(2) = "if TRUE (default) then first column of rg contains labels and a column of labels is appended to the output"
                      argDescription(3) = "if TRUE (default) then a row of headings is appended to the output"
                      argDescription(4) = "significance level (positive numeric value between 0 and .5); default .05"
                      Application.MacroOptions Macro:="ImputeParam", Description:="returns an m x 7 array with values coeff, std err, df, t-stat, p-value, 1-alpha confidence level(lower, upper)",         category:="Missing", StatusBar:="returns an m x 7 array with values coeff, std err, df, t-stat, p-value, 1-alpha confidence level(lower, upper)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ImputeVar_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "2m x n range with numeric data (w/o counting an optional labels in 1st col); cols represent imputations; the top part of rg are parameters (for each imputation) and the bottom part are the corresponding std errors"
                      argDescription(1) = "number of rows in rg (positive integer), including missing data"
                      argDescription(2) = "if TRUE (default) then first column of rg contains labels and a column of labels is appended to the output"
                      argDescription(3) = "if TRUE (default) then a row of headings is appended to the output"
                      Application.MacroOptions Macro:="ImputeVar", Description:="returns an m x 10 array with values est (mean), (total) std err, df, within var, between var, relative increase in variance due to nonresponse, % of missing data, relative efficiency",         category:="Missing", StatusBar:="returns an m x 10 array with values est (mean), (total) std err, df, within var, between var, relative increase in variance due to nonresponse, % of missing data, relative efficiency",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  

                  General
                  Stream Path:VBA/DescriptorMultivar
                  VBA File Name:DescriptorMultivar
                  Stream Size:162726
                  Data ASCII:. . . . . . . . : . . . . . . . . . . . . . . . . . . . . . . . . t _ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . ^ . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 3a 02 01 00 d4 00 00 00 b0 01 00 00 ff ff ff ff a7 02 01 00 b7 1f 02 00 00 00 00 00 01 00 00 00 d4 1f 74 5f 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorMultivar"
                  Sub Multivariate_Descriptors()
                      Call Hotellingdf1_Descriptor
                      Call Hotellingdf2_Descriptor
                      Call HotellingF_Descriptor
                      Call HotellingT2_Descriptor
                      Call T2TEST_Descriptor
                      Call Hotelling_Descriptor
                      Call T2_RepeatedMeasures_Descriptor
                      Call MANOVA_T_Descriptor
                      Call MANOVA_H_Descriptor
                      Call MANOVA_E_Descriptor
                      Call MANOVA_Wilks_Descriptor
                      Call MANOVA_Hotel_Descriptor
                      Call MANOVA_Pillai_Descriptor
                      Call MANOVA_WilksLambda_Descriptor
                      Call MANOVA_Wilksdf1_Descriptor
                      Call MANOVA_Wilksdf2_Descriptor
                      Call MANOVA_WilksF_Descriptor
                      Call MANOVA_WilksTest_Descriptor
                      Call MANOVA_HotelTrace_Descriptor
                      Call MANOVA_Hoteldf1_Descriptor
                      Call MANOVA_Hoteldf2_Descriptor
                      Call MANOVA_HotelF_Descriptor
                      Call MANOVA_HotelTest_Descriptor
                      Call MANOVA_PillaiTrace_Descriptor
                      Call MANOVA_Pillaidf1_Descriptor
                      Call MANOVA_Pillaidf2_Descriptor
                      Call MANOVA_PillaiF_Descriptor
                      Call MANOVA_PillaiTest_Descriptor
                      Call MANOVA_RoyRoot_Descriptor
                      Call MDistSq_Descriptor
                      Call MSKEWTEST_Descriptor
                      Call MKURTTEST_Descriptor
                      Call BNORMSDIST_Descriptor
                      Call BNORMDIST_Descriptor
                      Call BNORMSRECT_Descriptor
                      Call BNORMRECT_Descriptor
                      Call BNORMRAND_Descriptor
                      Call MNORMRAND_Descriptor
                      Call CLUSTERS_Descriptor
                      Call CENTROIDS_Descriptor
                      Call CLUSTErr_Descriptor
                      Call CENTROIDErr_Descriptor
                      Call CLUST_Descriptor
                      Call ClustAnal_Descriptor
                      Call CLUST_Converge_Descriptor
                      Call JENKS_Descriptor
                      Call GVF_Descriptor
                      Call VARIMAX_Descriptor
                      Call CONF_MNORM_Descriptor
                      Call CONF_BNORM_Descriptor
                      Call CONF_VOLUME_Descriptor
                      Call MOUTLIERS_Descriptor
                      Call BOX_Descriptor
                      Call BOXTEST_Descriptor
                      Call BOXM_Descriptor
                      Call BOXF_Descriptor
                      Call BOXdf1_Descriptor
                      Call BOXdf2_Descriptor
                      Call MANOVA2_Tot_Descriptor
                      Call MANOVA2_Row_Descriptor
                      Call MANOVA2_Col_Descriptor
                      Call MANOVA2_Int_Descriptor
                      Call MANOVA2_Res_Descriptor
                      Call MANOVA2_WilksRow_Descriptor
                      Call MANOVA2_HotelRow_Descriptor
                      Call MANOVA2_PillaiRow_Descriptor
                      Call MANOVA2_RoyRow_Descriptor
                      Call MANOVA2_WilksCol_Descriptor
                      Call MANOVA2_HotelCol_Descriptor
                      Call MANOVA2_PillaiCol_Descriptor
                      Call MANOVA2_RoyCol_Descriptor
                      Call MANOVA2_WilksInt_Descriptor
                      Call MANOVA2_HotelInt_Descriptor
                      Call MANOVA2_PillaiInt_Descriptor
                      Call MANOVA2_RoyInt_Descriptor
                      Call MANOVA2_BOX_Descriptor
                      Call ExtractRows_Descriptor
                      Call ExtractCol_Descriptor
                      Call ExtractCov_Descriptor
                      Call Extract2Rows_Descriptor
                      Call Extract2Cov_Descriptor
                      Call COVPooled_Descriptor
                      Call COV2Pooled_Descriptor
                      Call PseudoF_Descriptor
                      Call PERMANOVA_Descriptor
                      Call LDACoeff_Descriptor
                      Call LDAPred_Descriptor
                      Call LDAPredC_Descriptor
                      Call QDAPred_Descriptor
                      Call DAClassification_Descriptor
                      Call DASummary_Descriptor
                      Call QuadForm_Descriptor
                      Call LLReg_Descriptor
                      Call FR_TEST_Descriptor
                      Call MNORMTEST_Descriptor
                      Call RepMeasTransform_Descriptor
                      Call CARowFactors_Descriptor
                      Call CAColFactors_Descriptor
                      Call CAEigen_Descriptor
                      Call UniGMM_Descriptor
                      Call MultiGMM_Descriptor
                      Call UniGMMClust_Descriptor
                      Call MultiGMMClust_Descriptor
                  End Sub
                  
                  Sub Hotellingdf1_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or range with numeric data"
                      argDescription(1) = "array or range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      Application.MacroOptions Macro:="Hotellingdf1", Description:="returns df1 for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns df1 for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Hotellingdf2_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range with numeric data"
                      argDescription(1) = "array or cell range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      Application.MacroOptions Macro:="Hotellingdf2", Description:="returns df2 for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns df2 for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub HotellingF_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range with numeric data"
                      argDescription(1) = "array or cell range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      Application.MacroOptions Macro:="HotellingF", Description:="returns F stat for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns F stat for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub HotellingT2_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range with numeric data"
                      argDescription(1) = "array or cell range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      Application.MacroOptions Macro:="HotellingT2", Description:="returns T-square stat for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns T-square stat for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub T2TEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range with numeric data"
                      argDescription(1) = "array or cell range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      Application.MacroOptions Macro:="T2TEST", Description:="returns p-value for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns p-value for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Hotelling_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range with numeric data"
                      argDescription(1) = "array or cell range with numeric data; if d = 0 then # of columns in array1 must equal # of rows in array2 ; otherwise array1 and array2 must have the same number of columns"
                      argDescription(2) = "0 for one sample test, 1 for paired sample test, 2 for independent samples with equal covariances, 3 for independent samples with unequal covariances"
                      argDescription(3) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="Hotelling", Description:="returns T-square, df1, df2, F and p-value for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         category:="Multivariate", StatusBar:="returns T-square, df1, df2, F and p-value for Hotelling T-square Test based on the data in array1 and array2 (if d = 0 then array2 contains the goal)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub T2_RepeatedMeasures_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range with numeric data (no headings)"
                      argDescription(1) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="T2_RepeatedMeasures", Description:="returns T-square, df1, df2, F and p-value for repeated measures Hotelling T-square Test based on the data in array",         category:="Multivariate", StatusBar:="returns T-square, df1, df2, F and p-value for repeated measures Hotelling T-square Test based on the data in array",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_T_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_T", Description:="returns T matrix for one-way MANOVA based on the data in rg",         category:="Multivariate", StatusBar:="returns T matrix for one-way MANOVA based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_H_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_H", Description:="returns H matrix for one-way MANOVA based on the data in rg",         category:="Multivariate", StatusBar:="returns H matrix for one-way MANOVA based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_E_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_E", Description:="returns E matrix for one-way MANOVA based on the data in rg",         category:="Multivariate", StatusBar:="returns E matrix for one-way MANOVA based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Wilks_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      argDescription(1) = "if TRUE then a column of labels is appended to the numerical output (default FALSE)"
                      Application.MacroOptions Macro:="MANOVA_Wilks", Description:="returns an array with lambda, df1, df2, F stat and p-value for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns an array with lambda, df1, df2, F stat and p-value for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Hotel_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      argDescription(1) = "if TRUE then a column of labels is appended to the numerical output (default FALSE)"
                      Application.MacroOptions Macro:="MANOVA_Hotel", Description:="returns an array with trace, df1, df2, F stat and p-value for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns an array with trace, df1, df2, F stat and p-value for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Pillai_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      argDescription(1) = "if TRUE then a column of labels is appended to the numerical output (default FALSE)"
                      Application.MacroOptions Macro:="MANOVA_Pillai", Description:="returns an array with trace, df1, df2, F stat and p-value for one-way MANOVA's Pillai-Bartlett Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns an array with trace, df1, df2, F stat and p-value for one-way MANOVA's Pillai-Bartlett Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_WilksLambda_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_WilksLambda", Description:="returns lambda stat for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns lambda stat for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Wilksdf1_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_Wilksdf1", Description:="returns df1 for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns df1 for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Wilksdf2_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_Wilksdf2", Description:="returns df2 for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns df2 for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_WilksF_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_WilksF", Description:="returns F stat for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns F stat for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_WilksTest_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_WilksTest", Description:="returns p-value for one-way MANOVA's Wilk's Lambda test based on the data in rg",         category:="Multivariate", StatusBar:="returns p-value for one-way MANOVA's Wilk's Lambda test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_HotelTrace_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_HotelTrace", Description:="returns trace stat for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns trace stat for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Hoteldf1_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_Hoteldf1", Description:="returns df1 for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns df1 for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Hoteldf2_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_Hoteldf2", Description:="returns df2 for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns df2 for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_HotelF_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_HotelF", Description:="returns F stat for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns F stat for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_HotelTest_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_HotelTest", Description:="returns p-value for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns p-value for one-way MANOVA's Hotelling-Lawley Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_PillaiTrace_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Macro:="MANOVA_PillaiTrace", Description:="returns trace stat for one-way MANOVA's Pillai-Bartlett Trace test based on the data in rg",         category:="Multivariate", StatusBar:="returns trace stat for one-way MANOVA's Pillai-Bartlett Trace test based on the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANOVA_Pillaidf1_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "range whose first column consists of identifiers for the independent variables; the other columns contain numeric data for dependent variables"
                      Application.MacroOptions Mac

                  General
                  Stream Path:VBA/DescriptorNonparametric
                  VBA File Name:DescriptorNonparametric
                  Stream Size:150757
                  Data ASCII:. . . . . . . . . . . . . . . . O . . 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . V . X . . . . . . ` . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 e2 f0 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 4f f1 00 00 33 f4 01 00 00 00 00 00 01 00 00 00 d4 1f 90 cc 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorNonparametric"
                  Sub Nonparametric_Descriptors()
                      Call MWTEST_Descriptor
                      Call MANN_Descriptor
                      Call WTEST_Descriptor
                      Call WILCOXON_Descriptor
                      Call SRTEST_Descriptor
                      Call SRANK_Descriptor
                      Call BFTEST_Descriptor
                      Call FSTAR_Descriptor
                      Call DFSTAR_Descriptor
                      Call FSTAR_TEST_Descriptor
                      Call WELCH_TEST_Descriptor
                      Call KRUSKAL_Descriptor
                      Call KTEST_Descriptor
                      Call FRIEDMAN_Descriptor
                      Call FrTEST_Descriptor
                      Call TiesCorrection_Descriptor
                      Call MW_TEST_Descriptor
                      Call MW_CONF_Descriptor
                      Call MW_EXACT_Descriptor
                      Call SR_EXACT_Descriptor
                      Call KW_TEST_Descriptor
                      Call COCHRAN_Descriptor
                      Call QTEST_Descriptor
                      Call QRATIO_Descriptor
                      Call RUNSTEST_Descriptor
                      Call RUNS2TEST_Descriptor
                      Call RLowerCRIT_Descriptor
                      Call RUpperCRIT_Descriptor
                      Call KSCRIT_Descriptor
                      Call KSPROB_Descriptor
                      Call KS2CRIT_Descriptor
                      Call KS2PROB_Descriptor
                      Call SignTest_Descriptor
                      Call MOODS_STAT_Descriptor
                      Call MOODS_TEST_Descriptor
                      Call CHI_STAT_Descriptor
                      Call CHI_MAX_Descriptor
                      Call CHI_STAT2_Descriptor
                      Call CHI_MAX2_Descriptor
                      Call CHI_TEST_Descriptor
                      Call CHI_MAX_TEST_Descriptor
                      Call SR_TEST_Descriptor
                      Call SR_CONF_Descriptor
                      Call FISHERTEST_Descriptor
                      Call FISHER_TEST_Descriptor
                      Call CMHTEST_Descriptor
                      Call WoolfTest_Descriptor
                      Call ADCRIT_Descriptor
                      Call ADPROB_Descriptor
                      Call ANDERSON_Descriptor
                      Call ADTEST_Descriptor
                      Call AD2CRIT_Descriptor
                      Call AD2PROB_Descriptor
                      Call AD2CRITX_Descriptor
                      Call AD2TEST_Descriptor
                      Call FIT_TEST_Descriptor
                      Call FPSTAT_Descriptor
                      Call FPTEST_Descriptor
                      Call JT_TEST_Descriptor
                      Call KS2TEST_Descriptor
                      Call MW_SIMUL_Descriptor
                      Call SR_SIMUL_Descriptor
                      Call CLIFF_DELTA_Descriptor
                      Call MK_TEST_Descriptor
                      Call SK_TEST_Descriptor
                      Call SEN_SLOPE_Descriptor
                      Call GINI_Descriptor
                      Call GiniTest_Descriptor
                      Call GiniUnbiased_Descriptor
                      Call POST_CHISQ_Descriptor
                      Call POST_CHIMAX_Descriptor
                      Call CompactTable_Descriptor
                      Call StdRes_Descriptor
                      Call AdjRes_Descriptor
                      Call StdResTest_Descriptor
                      Call AdjResTest_Descriptor
                      Call BOWKER_Descriptor
                      Call MBTEST_Descriptor
                      Call TRINOM_TEST_Descriptor
                      Call TrinomTest_Descriptor
                      Call ODDS_RATIO_Descriptor
                      Call CHISQ_STAT_Descriptor
                      Call CHISQ_TEST_Descriptor
                      Call CHISQ_SIM_Descriptor
                      Call FISHER_MIDP_Descriptor
                      Call KS_BCRIT_Descriptor
                      Call KS_BPROB_Descriptor
                      Call KS_BTEST_Descriptor
                      Call KS_BSTAT_Descriptor
                      Call AD_BSTAT_Descriptor
                      Call RUNS_TEST_Descriptor
                      Call RUNS_Descriptor
                      Call COX_STUART_Descriptor
                      Call RunsUpDn_Descriptor
                      Call BM_TEST_Descriptor
                      Call BM_PTEST_Descriptor
                  End Sub
                  
                  Sub MWTEST_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or range (sample 1)"
                      argDescription(1) = "numeric array or range (sample 2)"
                      argDescription(2) = "number of tails; 1 (default) or 2"
                      argDescription(3) = "if TRUE (default) then a ties correction is applied"
                      argDescription(4) = "if TRUE (default) then a continuity correction is applied"
                      Application.MacroOptions Macro:="MWTEST", Description:="returns p-value for Mann-Whitney test using normal approximation",         category:="Nonparametric", StatusBar:="returns p-value for Mann-Whitney test using normal approximation",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MANN_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "case 1: numeric array or range, case 2: # of columns (from array1) in sample 1; positive integer (default 1)"
                      Application.MacroOptions Macro:="MANN", Description:="returns U statistic for Mann-Whitney test using normal approximation",         category:="Nonparametric", StatusBar:="returns U statistic for Mann-Whitney test using normal approximation",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "case 1: numeric array or range, case 2: # of columns (from array1) in sample 1; positive integer (default 1)"
                      argDescription(2) = "number of tails; 1 (default) or 2"
                      Application.MacroOptions Macro:="WTEST", Description:="returns p-value for Wilcoxon Rank-Sum test using normal approximation",         category:="Nonparametric", StatusBar:="returns p-value for Wilcoxon Rank-Sum test using normal approximation",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WILCOXON_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "case 1: numeric array or range, case 2: # of columns (from array1) in sample 1; positive integer (default 1)"
                      Application.MacroOptions Macro:="WILCOXON", Description:="returns W statistic for Wilcoxon Rank-Sum test using normal approximation",         category:="Nonparametric", StatusBar:="returns W statistic for Wilcoxon Rank-Sum test using normal approximation",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SRTEST_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or range (with one or two columns; if two columns then arg2 is not used)"
                      argDescription(1) = "numeric array or range (if paired test) or numeric value (hypothetical median, default 0, if one sample test)"
                      argDescription(2) = "number of tails; 1 (default) or 2"
                      argDescription(3) = "if TRUE (default) then a ties correction is applied"
                      argDescription(4) = "if TRUE (default) then a continuity correction is applied"
                      Application.MacroOptions Macro:="SRTEST", Description:="returns p-value for Wilcoxon signed ranks test using the normal approximation",         category:="Nonparametric", StatusBar:="returns p-value for for Wilcoxon signed ranks test using the normal approximation",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SRANK_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range (with one or two columns; if two columns then arg2 is not used)"
                      argDescription(1) = "numeric array or range (if paired test) or numeric value (hypothetical median, default 0, if one sample test)"
                      Application.MacroOptions Macro:="SRANK", Description:="returns signed rank T for Wilcoxon signed ranks test",         category:="Nonparametric", StatusBar:="returns signed rank T for Wilcoxon signed ranks test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BFTEST_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data"
                      Application.MacroOptions Macro:="BFTEST", Description:="returns p-value for the Brown-Forsythe test for data in rg",         category:="Nonparametric", StatusBar:="returns p-value for the Brown-Forsythe test for data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KRUSKAL_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data"
                      argDescription(1) = "if TRUE (default) then a ties correction is applied"
                      Application.MacroOptions Macro:="KRUSKAL", Description:="returns H statistic for Kruskal-Wallis test for data in array1",         category:="Nonparametric", StatusBar:="returns H statistic for Kruskal-Wallis test for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FrTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or cell range with data"
                      argDescription(1) = "if TRUE (default) then a ties correction is applied"
                      argDescription(2) = "if TRUE (default) then the chi-square test is used; otherwise an F test is used"
                      Application.MacroOptions Macro:="FrTEST", Description:="returns p-value for Friedman test for data in array1",         category:="Nonparametric", StatusBar:="returns p-value for Friedman test for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FRIEDMAN_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or cell range with data"
                      argDescription(1) = "if TRUE (default) then a ties correction is applied"
                      argDescription(2) = "if TRUE (default) then the chi-square test is used; otherwise an F test is used"
                      Application.MacroOptions Macro:="FRIEDMAN", Description:="returns Q statistic for Friedman test for data in array1",         category:="Nonparametric", StatusBar:="returns Q statistic for Friedman test for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KTEST_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range with data"
                      argDescription(1) = "if TRUE (default) then a ties correction is applied"
                      Application.MacroOptions Macro:="KTEST", Description:="returns p-value for Kruskal-Wallis test for data in array1",         category:="Nonparametric", StatusBar:="returns p-value for Kruskal-Wallis test for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FSTAR_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data"
                      Application.MacroOptions Macro:="FSTAR", Description:="returns F* statistic for the Brown-Forsythe test on data in rg",         category:="Nonparametric", StatusBar:="returns F* statistic for the Brown-Forsythe test on data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DFSTAR_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range with data"
                      Application.MacroOptions Macro:="DFSTAR", Description:="returns df* for the Brown-Forsythe test on data in rg",         category:="Nonparametric", StatusBar:="returns df* for the Brown-Forsythe test on data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub FSTAR_TEST_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range with data"
                      argDescription(1) = "if TRUE, then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="FSTAR_TEST", Description:="returns F, df1, df2 and p-value for the Brown-Forsythe test on data in rg",         category:="Nonparametric", StatusBar:="returns F, df1, df2 and p-value for the Brown-Forsythe test on data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WELCH_TEST_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range with data"
                      argDescription(1) = "if TRUE, then a column of labels is appended to the output (default FALSE)"
                      Application.MacroOptions Macro:="WELCH_TEST", Description:="returns F, df1, df2 and p-value for the Welch ANOVA test for data in array1",         category:="Nonparametric", StatusBar:="returns F, df1, df2 and p-value for the Welch ANOVA test for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TiesCorrection_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range; or a numeric value (population median) if ttype = 0 (default is 0); not used if ttype = 3"
                      argDescription(2) = "if 0 then one sample of data, if 1 then paired data, if 2 then two independent samples, if 3 (default) then more than two samples"
                      Application.MacroOptions Macro:="TiesCorrection", Description:="returns ties correction factor f^3 - f for non-parametric tests based on data in array1 and arg2",         category:="Nonparametric", StatusBar:="returns ties correction factor f^3 - f for non-parametric tests based on data in array1 and arg2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MW_SIMUL_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(3) = "non-negative integer (# of iterations in the simulation, default = 10000)"
                      Application.MacroOptions Macro:="MW_SIMUL", Description:="returns U-stat, p-value left tail, p-value right tail and p-value two-tails, based on a simulation for the signed-ranks test",         category:="Nonparametric", StatusBar:="returns U-stat, p-value left tail, p-value right tail and p-value two-tails, based on a simulation for the signed-ranks test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MW_TEST_Descriptor()
                      Dim argDescription(8) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "if TRUE (default) then a ties correction is applied"
                      argDescription(5) = "if TRUE (default) then a continuity correction is applied"
                      argDescription(6) = "if TRUE (default FALSE, although overriden if sample size is at most 500) then the p-value of the exact test is returned"
                      argDescription(7) = "non-negative integer (# of iterations in the simulation, zero means no simulation, default = 10000)"
                      argDescription(8) = "if TRUE or 1 (default) use usual effect size; if FALSE or 0 use rank-serial correlation"
                      Application.MacroOptions Macro:="MW_TEST", Description:="returns U-stat, z-stat, effect r and p-values based on normal approximation, exact test and simulation for the Mann-Whitney test",         category:="Nonparametric", StatusBar:="returns U-stat, z-stat, effect r and p-values based on normal approximation, exact test and simulation for the Mann-Whitney test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MW_CONF_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(3) = "if 0 (default) then normal approximation is used, if 1 then exact test is used"
                      argDescription(4) = "significance level (default .05)"
                      Application.MacroOptions Macro:="MW_CONF", Description:="returns U-crit, alpha, lower, upper, median, U-crit + 1, alpha, lower, upper for the Mann-Whitney test",         category:="Nonparametric", StatusBar:="returns U-crit, alpha, lower, upper, median, U-crit + 1, alpha, lower, upper for the Mann-Whitney test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KW_TEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(2) = "if TRUE (default) then a ties correction is applied to calculate the p-value"
                      Application.MacroOptions Macro:="KW_TEST", Description:="returns H-stat, ties corrected H-stat, df and p-value for the Kruskal-Wallis test",         category:="Nonparametric", StatusBar:="returns H-stat, ties corrected H-stat, df and p-value for the Kruskal-Wallis test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MW_EXACT_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      Application.MacroOptions Macro:="MW_EXACT", Description:="returns p-value for Mann-Whitney exact test",         category:="Nonparametric", StatusBar:="returns p-value for Mann-Whitney exact test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SR_EXACT_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range (with one or two columns; if two columns then arg2 is not used)"
                      argDescription(1) = "numeric array or range (if paired test) or numeric value (hypothetical median, default 0, if one sample test)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      Application.MacroOptions Macro:="SR_EXACT", Description:="returns p-value for Wilcoxon signed ranks exact test",         category:="Nonparametric", StatusBar:="returns p-value for Wilcoxon signed ranks exact test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COCHRAN_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric range"
                      argDescription(1) = "if TRUE then rg contains raw data; otherwise it contains frequency data (default FALSE)"
                      argDescription(2) = "if TRUE (default) then apply continuity correction (provided there are only two non-empty columns in rg)"
                      Application.MacroOptions Macro:="COCHRAN", Description:="returns Q statistic for Cochran's Q test",         category:="Nonparametric", StatusBar:="returns Q statistic for Cochran's Q test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric range"
                      argDescription(1) = "if TRUE then rg contains raw data; otherwise it contains frequency data (default FALSE)"
                      argDescription(2) = "if TRUE (default) then apply continuity correction (provided there are only two non-empty columns in rg)"
                      Application.MacroOptions Macro:="QTEST", Description:="returns p-value for Cochran's Q test",         category:="Nonparametric", StatusBar:="returns p-value for Cochran's Q test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QRATIO_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range"
                      argDescription(1) = "if TRUE then rg contains raw data; otherwise it contains frequency data (default FALSE)"
                      Application.MacroOptions Macro:="QRATIO", Description:="returns row array with percentages for each independent variable for Cochran's Q test",         category:="Nonparametric", StatusBar:="returns row array with percentages for each independent variable for Cochran's Q test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RUNSTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "case 1: string with two distinct characters; case 2: numeric array or range"
                      argDescription(1) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      Application.MacroOptions Macro:="RUNSTEST", Description:="returns # of each character in string (case1) or # of elements >= median and < median (case 2), stat mean, stat std dev, # of runs, # of tails, z-stat, p-value (based on normal approximation and exact test) for the Runs test",         category:="Nonparametric", StatusBar:="returns # of each character in string (case1) or # of elements >= median and < median (case 2), stat mean, stat std dev, # of runs, # of tails, z-stat, p-value (based on normal approximation and exact test) for the Runs test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RUNS2TEST_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      argDescription(2) = "if TRUE then a column of labels is appended to the output (default FALSE)"
                      argDescription(3) = "number of iterations; positive integer (used to handle ties)"
                      Application.MacroOptions Macro:="RUNS2TEST", Description:="returns # of elements in each sample, stat mean, stat std dev, # of runs, # of tails, z-stat, p-value (based on normal approximation and exact test) for the Two Sample Runs test",         category:="Nonparametric", StatusBar:="returns # of elements in each sample, stat mean, stat std dev, # of runs, # of tails, z-stat, p-value (based on normal approximation and exact test) for the Two Sample Runs test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RLowerCRIT_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "positive integer (# of times c

                  General
                  Stream Path:VBA/DescriptorPower
                  VBA File Name:DescriptorPower
                  Stream Size:96018
                  Data ASCII:. . . . . . . . . . . . . . . . . . . K < . . . . . . . . . . . w k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . p . . . . . Z . X . . . . . . `
                  Data Raw:01 16 03 00 06 f0 00 00 00 b2 81 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 1f 82 00 00 4b 3c 01 00 00 00 00 00 01 00 00 00 d4 1f 77 6b 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorPower"
                  Sub Power_Descriptors()
                      Call T1_POWER_Descriptor
                      Call T1_SIZE_Descriptor
                      Call T2_POWER_Descriptor
                      Call T2_SIZE_Descriptor
                      Call NORM1_POWER_Descriptor
                      Call NORM1_SIZE_Descriptor
                      Call NORM2_POWER_Descriptor
                      Call NORM2_SIZE_Descriptor
                      Call BINOM_POWER_Descriptor
                      Call BINOM_SIZE_Descriptor
                      Call CORREL1_POWER_Descriptor
                      Call CORREL1_SIZE_Descriptor
                      Call ICC_POWER_Descriptor
                      Call ICC_SIZE_Descriptor
                      Call ANOVA1_POWER_Descriptor
                      Call ANOVA1_SIZE_Descriptor
                      Call REG_POWER_Descriptor
                      Call REG_SIZE_Descriptor
                      Call VAR1_POWER_Descriptor
                      Call VAR1_SIZE_Descriptor
                      Call VAR2_POWER_Descriptor
                      Call VAR2_SIZE_Descriptor
                      Call CALPHA_POWER_Descriptor
                      Call CALPHA_SIZE_Descriptor
                      Call CHISQ_POWER_Descriptor
                      Call CHISQ_SIZE_Descriptor
                      Call T1_POWER_CONF_Descriptor
                      Call T2_POWER_CONF_Descriptor
                      Call MANOVA_POWER_Descriptor
                      Call MANOVA_SIZE_Descriptor
                      Call MANOVA2Row_POWER_Descriptor
                      Call MANOVA2Col_POWER_Descriptor
                      Call MANOVA2Int_POWER_Descriptor
                      Call MANOVA2Row_SIZE_Descriptor
                      Call MANOVA2Col_SIZE_Descriptor
                      Call MANOVA2Int_SIZE_Descriptor
                      Call Hotel1_POWER_Descriptor
                      Call Hotel1_SIZE_Descriptor
                      Call Hotel2_POWER_Descriptor
                      Call Hotel2_SIZE_Descriptor
                      Call Hotelling_POWER_Descriptor
                      Call BKAPPA_SIZE_Descriptor
                      Call BKAPPA_POWER_Descriptor
                      Call LOGIT_SIZE0_Descriptor
                      Call LOGIT_SIZE_Descriptor
                      Call LOGIT_POWER0_Descriptor
                      Call LOGIT_POWER_Descriptor
                      Call MW_POWER_Descriptor
                      Call SR_POWER_Descriptor
                      Call TUKEY_POWER_Descriptor
                      Call NCP_ANOVA_Descriptor
                  End Sub
                  
                  Sub T1_POWER_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(4) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="T1_POWER", Description:="returns power of a one-sample t test",         category:="Power", StatusBar:="returns power of a one-sample t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub T1_SIZE_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(4) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(5) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="T1_SIZE", Description:="returns sample size required for a one-sample t test",         category:="Power", StatusBar:="returns sample size required for a one-sample t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub T2_POWER_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "size of sample 1; a positive integer"
                      argDescription(2) = "size of sample 2; a positive integer; if omitted then defaults to n1"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="T2_POWER", Description:="returns power of a two-sample t test",         category:="Power", StatusBar:="returns power of a two-sample t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub T2_SIZE_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(4) = "ratio of the size of sample 1 divided by the size of sample 2 (default 1.0); if negative then the size of the second sample is the absolute value of this argument"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision of result (default 0.000000000001); small positive number"
                      Application.MacroOptions Macro:="T2_SIZE", Description:="returns sample size (of sample 1) required for a two-sample t test",         category:="Power", StatusBar:="returns sample size (of sample 1) required for a two-sample t test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NORM1_POWER_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="NORM1_POWER", Description:="returns power of a one-sample normal test",         category:="Power", StatusBar:="returns power of a one-sample normal test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NORM1_SIZE_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "Cohen's effect size; a positive number"
                      argDescription(1) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="NORM1_SIZE", Description:="returns sample size required for a one-sample normal test",         category:="Power", StatusBar:="returns sample size required for a one-sample normal test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NORM2_POWER_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "difference between population means; a positive number"
                      argDescription(1) = "population standard deviation corresponding to sample 1; a positive integer"
                      argDescription(2) = "population standard deviation corresponding to sample 2; a positive integer"
                      argDescription(3) = "size of sample 1; a positive integer"
                      argDescription(4) = "size of sample 2; a positive integer; if omitted then defaults to n1"
                      argDescription(5) = "number of tails; 1 or 2 (default)"
                      argDescription(6) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="NORM2_POWER", Description:="returns power of a two-sample normal test",         category:="Power", StatusBar:="returns power of a two-sample normal test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NORM2_SIZE_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "difference between population means; a positive number"
                      argDescription(1) = "population standard deviation corresponding to sample 1; a positive integer"
                      argDescription(2) = "population standard deviation corresponding to sample 2; a positive integer"
                      argDescription(3) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(4) = "number of tails; 1 or 2 (default)"
                      argDescription(5) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(6) = "ratio of the size of sample 1 divided by the size of sample 2 (default 1.0); if negative then the size of the second sample is the absolute value of this argument"
                      Application.MacroOptions Macro:="NORM2_SIZE", Description:="returns sample size (of sample 1) required for a two-sample normal test",         category:="Power", StatusBar:="returns sample size (of sample 1) required for a two-sample normal test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BINOM_POWER_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "probability based on null hypothesis; a number between 0 and 1"
                      argDescription(1) = "observed probability; a number between 0 and 1"
                      argDescription(2) = "sample size; a positive integer"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="BINOM_POWER", Description:="returns power of a binomial test",         category:="Power", StatusBar:="returns power of a binomial test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BINOM_SIZE_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "probability based on null hypothesis; a number between 0 and 1"
                      argDescription(1) = "observed probability; a number between 0 and 1"
                      argDescription(2) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="BINOM_SIZE", Description:="returns sample size required for a binomial test",         category:="Power", StatusBar:="returns sample size required for a binomial test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORREL1_POWER_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "correlation coefficient based on null hypothesis; a number between -1 and 1"
                      argDescription(1) = "correlation coefficient based on alternative hypothesis (i.e. sample correlation); a number between -1 and 1"
                      argDescription(2) = "sample size; a positive integer"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="CORREL1_POWER", Description:="returns power of a one-sample correlation test using the Fisher transformation",         category:="Power", StatusBar:="returns power of a one-sample correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORREL1_SIZE_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "correlation coefficient based on null hypothesis; a number between -1 and 1"
                      argDescription(1) = "correlation coefficient based on alternative hypothesis; a number between -1 and 1"
                      argDescription(2) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="CORREL1_SIZE", Description:="returns sample size required for a one-sample correlation test using the Fisher transformation",         category:="Power", StatusBar:="returns sample size required for a one-sample correlation test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ICC_POWER_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "ICC value based on null hypothesis; a number between 0 and 1"
                      argDescription(1) = "ICC value based on alternative hypothesis (i.e. the sample ICC); a number between 0 and 1"
                      argDescription(2) = "sample size; a positive integer"
                      argDescription(3) = "number of items; a positive integer"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="ICC_POWER", Description:="returns power of ICC(1,1) measurement",         category:="Power", StatusBar:="returns power of ICC(1,1) measurement",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ICC_SIZE_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "ICC value based on null hypothesis; a number between 0 and 1"
                      argDescription(1) = "ICC value based on alternative hypothesis; a number between 0 and 1"
                      argDescription(2) = "number of items; a positive integer"
                      argDescription(3) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="ICC_SIZE", Description:="returns sample size required for ICC(1,1) measurement",         category:="Power", StatusBar:="returns sample size required for ICC(1,1) measurement",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVA1_POWER_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "effect size based on the effect size type (4th argument); a positive number"
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "number of groups; a positive integer"
                      argDescription(3) = "effect size type: 1 is Cohen's f (default), 2 is RMSSE and 0 is noncentrality parameter"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision in calculating the infinite sum (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="ANOVA1_POWER", Description:="returns power of a one factor ANOVA",         category:="Power", StatusBar:="returns power of a one factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ANOVA1_SIZE_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "effect size based on the effect size type (4th argument); a positive number"
                      argDescription(1) = "number of groups; a positive integer"
                      argDescription(2) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(3) = "effect size type: 1 is Cohen's f (default) and 2 is RMSSE"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision in calculating the infinite sum (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="ANOVA1_SIZE", Description:="returns sample size for a one factor ANOVA",         category:="Power", StatusBar:="returns sample size (of sample 1) required for a one factor ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NCP_ANOVA_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric column array or range containing the group means or a single value with the largest difference between group means"
                      argDescription(1) = "numeric column array or range containing groups sizes or a single value (positive integer) with the size of each group (assumes all groups have the same size)"
                      argDescription(2) = "positive integer; variance of each group"
                      Application.MacroOptions Macro:="NCP_ANOVA", Description:="returns the non-centrality parameter for the specified one-way ANOVA",         category:="Power", StatusBar:="returns the non-centrality parameter for the specified one-way ANOVA",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub REG_POWER_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "effect size based on the effect size type (4th argument); a positive number"
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "number of independent variables; a positive integer"
                      argDescription(3) = "effect size type: 1 is Cohen's f-square (default), 2 is R-square and 0 is noncentrality parameter"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision in calculating the infinite sum (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="REG_POWER", Description:="returns power of multiple linear regression",         category:="Power", StatusBar:="returns power of multiple linear regression",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub REG_SIZE_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "effect size based on the effect size type (4th argument); a positive number"
                      argDescription(1) = "number of independent variables; a positive integer"
                      argDescription(2) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(3) = "effect size type: 1 is Cohen's f-square (default) and 2 is R-square"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(5) = "maximum number of terms to use in the infinite sum (default 1000); positive integer"
                      argDescription(6) = "precision in calculating the infinite sum (default 0.000000001); small positive number"
                      Application.MacroOptions Macro:="REG_SIZE", Description:="returns sample size for multiple linear regression",         category:="Power", StatusBar:="returns sample size (of sample 1) required for multiple linear regression",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VAR1_POWER_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "sample variance divided by hypothetical variance; a positive number"
                      argDescription(1) = "sample size; a positive integer"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="VAR1_POWER", Description:="returns power of a one-sample variance test",         category:="Power", StatusBar:="returns power of a one-sample variance test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VAR1_SIZE_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "sample variance divided by hypothetical variance; a positive number"
                      argDescription(1) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="VAR1_SIZE", Description:="returns sample size required for a one-sample variance test",         category:="Power", StatusBar:="returns sample size required for a one-sample variance test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VAR2_POWER_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "variance for sample 2 divided by variance for sample 1; a positive number"
                      argDescription(1) = "size of sample 1; a positive integer"
                      argDescription(2) = "size of sample 2; a positive integer; if omitted then defaults to n1"
                      argDescription(3) = "number of tails; 1 or 2 (default)"
                      argDescription(4) = "significance level; number between 0 and 1 (default .05)"
                      Application.MacroOptions Macro:="VAR2_POWER", Description:="returns power of a two-sample variance test",         category:="Power", StatusBar:="returns power of a two-sample variance test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub VAR2_SIZE_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "variance for sample 2 divided by variance for sample 1; a positive number"
                      argDescription(1) = "statistical power; a positive number between 0 and 1 (default .80)"
                      argDescription(2) = "number of tails; 1 or 2 (default)"
                      argDescription(3) = "significance level; number between 0 and 1 (default .05)"
                      argDescription(4) = "ratio of the size of sample 1 divided by the size of sample 2 (default 1.0); if negative then the size of the second sample is the absolute value of this argument"
                      Application.MacroOptions Macro:="VAR2_SIZE", 

                  General
                  Stream Path:VBA/DescriptorQueueing
                  VBA File Name:DescriptorQueueing
                  Stream Size:52506
                  Data ASCII:. . . . . . . . 2 U . . . . . . . . U . . { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . R . . . . d . X . . . . . . ` . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 32 55 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 9f 55 00 00 7b b4 00 00 00 00 00 00 01 00 00 00 d4 1f eb 82 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorQueueing"
                  Sub Queueing_Descriptors()
                      Call MM1X_Descriptor
                      Call MMs_Descriptor
                      Call MM1N_Descriptor
                      Call MMsN_Descriptor
                      Call MM1K_Descriptor
                      Call MMsK_Descriptor
                      Call MM1P_Descriptor
                      Call MMsP_Descriptor
                      Call MM1PP_Descriptor
                      Call MMsPP_Descriptor
                      Call MM1PS_Descriptor
                      Call MD1X_Descriptor
                      Call MG1X_Descriptor
                      Call MGinf_Descriptor
                      Call MM1Pn_Descriptor
                      Call MMsPn_Descriptor
                      Call MM1NPn_Descriptor
                      Call MMsNPn_Descriptor
                      Call MM1KPn_Descriptor
                      Call MMsKPn_Descriptor
                      Call MD1Pn_Descriptor
                      Call MGinfPn_Descriptor
                      Call MM1W_Descriptor
                      Call MMsW_Descriptor
                      Call MD1W_Descriptor
                      Call MM1KW_Descriptor
                      Call MM1Wq_Descriptor
                      Call MMsWq_Descriptor
                      Call MD1Wq_Descriptor
                      Call MM1KWq_Descriptor
                      Call MMsKWq_Descriptor
                      Call QUEUE_SIM_Descriptor
                      Call QUEUE_SIMX_Descriptor
                  End Sub
                  
                  Sub MM1X_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1X", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMs_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MMs", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                          
                  Sub MM1N_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "size of customer population (positive integer)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1N", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model with a finite # of customers",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model with a finite # of customers",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsN_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "size of customer population (positive integer)"
                      argDescription(4) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MMsN", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model with a finite # of customers",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model with a finite # of customers",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1K_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "queue size  (positive integer)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1K", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model with finite queue size",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/1 queueing model with finite queue size",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsK_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "queue size (positive integer)"
                      argDescription(4) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MMsK", Description:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model with finite queue size",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/M/s queueing model with finite queue size",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MD1X_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MD1X", Description:="returns column array with L, Lq, W, Wq, Rho for M/D/1 queueing model",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/D/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MG1X_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "standard deviation of service time (positive numeric)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MG1X", Description:="returns column array with L, Lq, W, Wq, Rho for M/G/1 queueing model",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/G/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MGinf_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MGinf", Description:="returns column array with L, Lq, W, Wq, Rho for M/G/inf queueing model",         category:="Queueing", StatusBar:="returns column array with L, Lq, W, Wq, Rho for M/G/inf queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1P_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "row or column array with mean arrival rates (positive numeric), one for each priority class"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1P", Description:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing with non-preemptive priority queuing",         category:="Queueing", StatusBar:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing model with non-preemptive priority queuing",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsP_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "row or column array with mean arrival rates (positive numeric), one for each priority class"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MMsP", Description:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/s queueing model with non-preemptive priority queuing",         category:="Queueing", StatusBar:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/s queueing model with non-preemptive priority queuing",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1PS_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "row or column array with mean arrival rates (positive numeric), one for each priority class"
                      argDescription(1) = "row or column array with mean service rates (positive numeric), one for each priority class"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1PS", Description:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing model with non-preemptive priority queuing",         category:="Queueing", StatusBar:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing model with non-preemptive priority queuing",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1PP_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "row or column array with mean arrival rates (positive numeric), one for each priority class"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="MM1PP", Description:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing model with preemptive priority queuing",         category:="Queueing", StatusBar:="returns array with L, Lq, W, Wq, Rho for each priority class in an M/M/1 queueing model with preemptive priority queuing",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsPP_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "row or column array with mean arrival rates (positive numeric), one for each priority class"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      Application.MacroOptions Macro:="MMsPP", Description:="returns a row array with Wq for each priority class in an M/M/s queueing model with preemptive priority queuing",         category:="Queueing", StatusBar:="returns a row array with Wq for each priority class in an M/M/s queueing model with preemptive priority queuing",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1Pn_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "customer count at the steady-state (non-negative integer)"
                      argDescription(3) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MM1Pn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsPn_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "customer count at the steady-state (non-negative integer)"
                      argDescription(4) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MMsPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1KPn_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "queue size  (positive integer)"
                      argDescription(3) = "customer count at the steady-state (non-negative integer)"
                      argDescription(4) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MM1KPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model with finite queue size",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model with finite queue size",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsKPn_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "queue size  (positive integer)"
                      argDescription(4) = "customer count at the steady-state (non-negative integer)"
                      argDescription(5) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MMsKPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model with finite queue size",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model with finite queue size",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1NPn_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "size of customer population  (positive integer)"
                      argDescription(3) = "customer count at the steady-state (non-negative integer)"
                      argDescription(4) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MM1NPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model with a finite # of customers",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/1 queueing model with a finite # of customers",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsNPn_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "size of customer population  (positive integer)"
                      argDescription(4) = "customer count at the steady-state (non-negative integer)"
                      argDescription(5) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MMsNPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model with a finite # of customers",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/M/s queueing model with a finite # of customers",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MD1Pn_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "customer count at the steady-state (non-negative integer)"
                      argDescription(3) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MD1Pn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/D/1 queueing model",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/D/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MGinfPn_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "customer count at the steady-state (non-negative integer)"
                      argDescription(3) = "if cum = FALSE (default) then pn is returned, while if cum = TRUE then Pn is returned"
                      Application.MacroOptions Macro:="MGinfPn", Description:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/G/inf queueing model",         category:="Queueing", StatusBar:="returns pn (probability that n customers are in the system) or Pn (probability that at most n customers are in the system) for the M/G/inf queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1W_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "time (positive numeric)"
                      Application.MacroOptions Macro:="MM1W", Description:="returns the probability that a customer remains in the system for more than t time for the M/M/1 queueing model",         category:="Queueing", StatusBar:="returns the probability that a customer remains in the system for more than t time for the M/M/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsW_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "# of servers (positive integer)"
                      argDescription(3) = "time (positive numeric)"
                      Application.MacroOptions Macro:="MMsW", Description:="returns the probability that a customer remains in the system for more than t time for the M/M/s queueing model",         category:="Queueing", StatusBar:="returns the probability that a customer remains in the system for more than t time for the M/M/s queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MM1Wq_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service rate (positive numeric)"
                      argDescription(2) = "time (positive numeric)"
                      Application.MacroOptions Macro:="MM1Wq", Description:="returns the probability that a customer waits in the queue for more than t time for the M/M/1 queueing model",         category:="Queueing", StatusBar:="returns the probability that a customer waits in the queue for more than t time for the M/M/1 queueing model",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MMsWq_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "mean arrival rate (positive numeric)"
                      argDescription(1) = "mean service 

                  General
                  Stream Path:VBA/DescriptorReformat
                  VBA File Name:DescriptorReformat
                  Stream Size:76409
                  Data ASCII:. . . . . . . . " . . . . . . . . . . . . . . . . . . . . . . k 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . ` . X . . . . . . ` . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 22 84 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 8f 84 00 00 e7 00 01 00 00 00 00 00 01 00 00 00 d4 1f 6b 34 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorReformat"
                  Sub Reformat_Descriptors()
                      Call QSORT_Descriptor
                      Call QSORTRows_Descriptor
                      Call QSORT2Rows_Descriptor
                      Call QSORT2RowsMixed_Descriptor
                      Call RESHAPE_Descriptor
                      Call REVERSE_Descriptor
                      Call REVERSES_Descriptor
                      Call SortUnique_Descriptor
                      Call ExtractUnique_Descriptor
                      Call SortsUnique_Descriptor
                      Call ExtractsUnique_Descriptor
                      Call NODUPES_Descriptor
                      Call COUNTU_Descriptor
                      Call COUNTAU_Descriptor
                      Call MERGE_Descriptor
                      Call SHUFFLE_Descriptor
                      Call RANDOMIZE_Descriptor
                      Call SHUFFLES_Descriptor
                      Call RANDOMIZES_Descriptor
                      Call DELROWBLANK_Descriptor
                      Call DELROWNonNum_Descriptor
                      Call DELBLANK_Descriptor
                      Call DELNonNum_Descriptor
                      Call DELErr_Descriptor
                      Call SelectCols_Descriptor
                      Call CountPairs_Descriptor
                      Call CountFullRows_Descriptor
                      Call TAGCODE_Descriptor
                      Call CATCODE_Descriptor
                      Call CountRowsUnique_Descriptor
                      Call SortRowsCount_Descriptor
                      Call SortRowsSum_Descriptor
                      Call SortRowsUnique_Descriptor
                      Call SEQ_Descriptor
                      Call DELROW_Descriptor
                      Call TEXT_JOIN_Descriptor
                      Call TEXT_REVERSE_Descriptor
                      Call FREQ_REFORMAT_Descriptor
                      Call IndexedValues_Descriptor
                      Call IndexedCounts_Descriptor
                      Call SortsRowsCount_Descriptor
                      Call SortsRowsSum_Descriptor
                      Call SortsRowsUnique_Descriptor
                      Call DELROWS_Descriptor
                      Call DUPECHAR_Descriptor
                      Call COMPACT_Descriptor
                      Call BCOMPACT_Descriptor
                      Call SORTRows_Descriptor
                      Call SHUFFLERows_Descriptor
                      Call RANDOMIZERows_Descriptor
                      Call RESHAPES_Descriptor
                      Call ExtractRandRows_Descriptor
                  End Sub
                  
                  Sub QSORT_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if TRUE (default) sort in ascending order; otherwise sort in descending order"
                      argDescription(2) = "# of rows in the output; if nrows = 0 (default), then use # of rows in the highlighted range: if nrows < 0 then use # of rows in array1"
                      argDescription(3) = "# of columns in the output (default 1); if nrows = 0 (or missing), then use # of columns in the highlighted range: if nrows < 0 then use # of columns in array1"
                      Application.MacroOptions Macro:="QSORT", Description:="returns array1 in sorted order; output does not need to have the same shape as array1",         category:="Reformat", StatusBar:="returns array1 in sorted order",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QSORTRows_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range (input data)"
                      argDescription(1) = "positive integer from 1 to n where n = # of columns in array1 (column # representing the sort key); default = 1"
                      argDescription(2) = "if TRUE (default) sort in ascending order; otherwise sort in descending order"
                      argDescription(3) = "if TRUE then first row (presumably headings) stays in place and is not sorted; default = FALSE"
                      Application.MacroOptions Macro:="QSORTRows", Description:="returns array1 in sorted order by rows based on the sort key (sortcol)",         category:="Reformat", StatusBar:="returns array1 in sorted order by rows based on the sort key (sortcol)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QSORT2Rows_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "array or cell range (input data)"
                      argDescription(1) = "positive integer from 1 to n where n = # of columns in array1 (column # representing the primary sort key); default = 1"
                      argDescription(2) = "positive integer from 1 to n where n = # of columns in array1 (column # representing the secondary sort key); default = 2"
                      argDescription(3) = "if TRUE (default) sort in ascending order; otherwise sort in descending order"
                      argDescription(4) = "if TRUE then first row (presumably headings) stays in place and is not sorted; default = FALSE"
                      Application.MacroOptions Macro:="QSORT2Rows", Description:="returns array1 in sorted order by rows based on the sort keys",         category:="Reformat", StatusBar:="returns array1 in sorted order by rows based on the sort keys",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub QSORT2RowsMixed_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "array or cell range (input data)"
                      argDescription(1) = "positive integer from 1 to n where n = # of columns in array1 (column # representing the primary sort key); default = 1"
                      argDescription(2) = "positive integer from 1 to n where n = # of columns in array1 (column # representing the secondary sort key); default = 2"
                      argDescription(3) = "if TRUE (default) sort in ascending order based on sortcol1 and descending order based on sortcol2; otherwise sort in descending order based on sortcol1 and ascending order based on sortcol2"
                      argDescription(4) = "if TRUE then first row (presumably headings) stays in place and is not sorted; default = FALSE"
                      Application.MacroOptions Macro:="QSORT2RowsMixed", Description:="returns array1 in sorted order by rows based on the sort keys",         category:="Reformat", StatusBar:="returns array1 in sorted order by rows based on the sort keys",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SortUnique_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="SortUnique", Description:="returns a column array with the elements in array1 without duplicates in ascending sorted order",         category:="Reformat", StatusBar:="returns a column array with the elements in array1 without duplicates in ascending sorted order",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ExtractUnique_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="ExtractUnique", Description:="returns a column array with the elements in array1 without duplicates",         category:="Reformat", StatusBar:="returns a column array with the elements in array1 without duplicates",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SortsUnique_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="SortsUnique", Description:="returns a column array with the elements in array1 without duplicates in ascending sorted order",         category:="Reformat", StatusBar:="returns a column array with the elements in array1 without duplicates in ascending sorted order",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ExtractsUnique_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="ExtractsUnique", Description:="returns a column array with the elements in array1 without duplicates",         category:="Reformat", StatusBar:="returns a column array with the elements in array1 without duplicates",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COUNTU_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="COUNTU", Description:="returns a count of the number of unique numeric elements in array1",         category:="Reformat", StatusBar:="returns a count of the number of unique numeric elements in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COUNTAU_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="COUNTAU", Description:="returns a count of the number of unique (non-empty) elements in array1",         category:="Reformat", StatusBar:="returns a count of the number of unique (non-empty) elements in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SHUFFLE_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      argDescription(2) = "# of rows in the output; if nrows = 0 (default), then use # of rows in the highlighted range: if nrows < 0 then use # of rows in array1"
                      argDescription(3) = "# of columns in the output (default 1); if nrows = 0 (or missing), then use # of columns in the highlighted range: if nrows < 0 then use # of columns in array1"
                      Application.MacroOptions Macro:="SHUFFLE", Description:="fills highlighted range with a random permutation of the data in array1 (sampling without replacement)",         category:="Reformat", StatusBar:="fills highlighted range with a random permutation of the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SHUFFLES_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="SHUFFLES", Description:="returns an array of the same size and shape as array1 with a random permutation of the data in array1 (sampling without replacement)",         category:="Reformat", StatusBar:="returns an array of the same size and shape as array1 with a random permutation of the data in array1 (sampling without replacement)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RANDOMIZE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "# of rows in the output; if nrows = 0 (default), then use # of rows in the highlighted range: if nrows < 0 then use # of rows in array1"
                      argDescription(2) = "# of columns in the output (default 1); if nrows = 0 (or missing), then use # of columns in the highlighted range: if nrows < 0 then use # of columns in array1"
                      Application.MacroOptions Macro:="RANDOMIZE", Description:="fills highlighted range with elements drawn at random from array1 (sampling with replacement)",         category:="Reformat", StatusBar:="fills highlighted range with elements drawn at random from array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RANDOMIZES_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="RANDOMIZES", Description:="returns an array of the same size and shape as array1 with elements drawn at random from array1 (sampling with replacement)",         category:="Reformat", StatusBar:="returns an array of the same size and shape as array1 with elements drawn at random from array1 (sampling with replacement)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RESHAPE_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      argDescription(2) = "if nrows > 0 then output an array of size nrows x ncols with data from array1; integer value"
                      argDescription(3) = "if nrows > 0 then output an array of size nrows x ncols with data from array1; integer value"
                      Application.MacroOptions Macro:="RESHAPE", Description:="fills highlighted range with data from array1 (if ncols omitted)",         category:="Reformat", StatusBar:="fills highlighted range with data from array1 (if ncols omitted)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub REVERSE_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      argDescription(2) = "# of rows in the output; if nrows = 0 (default), then use # of rows in the highlighted range: if nrows < 0 then use # of rows in array1"
                      argDescription(3) = "# of columns in the output (default 1); if nrows = 0 (or missing), then use # of columns in the highlighted range: if nrows < 0 then use # of columns in array1"
                      Application.MacroOptions Macro:="REVERSE", Description:="fills highlighted range with the data from array1 in reverse order",         category:="Reformat", StatusBar:="fills highlighted range with the data from array1 in reverse order",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub REVERSES_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="REVERSES", Description:="returns an array of the same size and shape as array1 with the data from array1 in reverse order",         category:="Reformat", StatusBar:="returns an array of the same size and shape as array1 with the data from array1 in reverse order",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub NODUPES_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      argDescription(2) = "if TRUE (default) then data will be sorted; otherwise it is assumed that the data is already sorted"
                      Application.MacroOptions Macro:="NODUPES", Description:="fills highlighted range with the data from array1 in sorted order eliminating any duplicates",         category:="Reformat", StatusBar:="fills highlighted range with the data from array1 in sorted order eliminating any duplicates",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELROWS_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "TRUE if first row (presumably a heading) is added to output even with empty elements; default is FALSE"
                      argDescription(2) = "if TRUE delete rows with blank entry; if FALSE (default) delete rows with blank or non-numeric entry"
                      Application.MacroOptions Macro:="DELROWS", Description:="returns the data from array1 eliminating any row with a blank or possibly non-numeric element",         category:="Reformat", StatusBar:="returns the data from array1 eliminating any row with a blank or possibly non-numeric element",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELROWBLANK_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "TRUE if first row (presumably a heading) is added to output even with empty elements; default is FALSE"
                      argDescription(2) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="DELROWBLANK", Description:="fills highlighted range with the data from array1 eliminating any row with a blank element",         category:="Reformat", StatusBar:="fills highlighted range with the data from array1 eliminating any row with a blank element",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELROWNonNum_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "TRUE if first row (presumably a heading) is added to output even with empty elements; default is FALSE"
                      argDescription(2) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="DELROWNonNum", Description:="fills highlighted range with the data from array1 eliminating any row with a blank or non-numeric element",         category:="Reformat", StatusBar:="fills highlighted range with the data from array1 eliminating any row with a blank or non-numeric element",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELBLANK_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="DELBLANK", Description:="fills highlighted range with the data in array1 eliminating any blank elements",         category:="Reformat", StatusBar:="fills highlighted range with the data in array1 eliminating any blank elements",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELNonNum_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "value used as a filler in case output is larger than array1; default is #N/A"
                      Application.MacroOptions Macro:="DELNonNum", Description:="fills highlighted range with the data in array1 eliminating any blank or non-numeric elements",         category:="Reformat", StatusBar:="fills highlighted range with the data in array1 eliminating any blank or non-numeric elements",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DELErr_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "array or cell range"
                      Application.MacroOptions Macro:="DELErr", Description:="returns an array of the same shape as array1 replacing all error values by a blank",         category:="Reformat", StatusBar:="returns an array of the same shape as array1 replacing all error values by a blank",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SelectCols_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if (1) a string containing numbers delimited by commas, then columns selected are based on the column numbers in the list; if (2) an array or range with same number of columns as array1, then columns selected correspond to non-blank entries in selections"
                      argDescription(2) = "if greater than 0, then sort the output by rows based on the values in the sortcol column, otherwise retain the order in array1; non-negative integer"
                      Application.MacroOptions Macro:="SelectCols", Description:="returns an array with the columns from array1 that are specified in selections",         category:="Reformat", StatusBar:="returns an array with the columns from array1 that are specified in selections",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CountPairs_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "array or cell range"
                      argDescription(2) = "if TRUE (default) then a pair has missing data if it contains one or more blanks, while if FALSE then a pair has missing data if it contains one or more blank or non-numeric values"
                      Application.MacroOptions Macro:="CountPairs", Description:="count of the number of pairs in array1 and array2 without any missing data",         category:="Reformat", StatusBar:="count of the number of pairs in array1 and array2 without any missing data",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CountFullRows_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "if TRUE (default) then a row has missing data if it contains one or more blanks, while if FALSE then a row has missing data if it contains one or more blank or non-numeric values"
                      argDescription(2) = "if TRUE, then the first row (presumably a heading) is not counted; default is FALSE"
                      Application.MacroOptions Macro:="CountFullRows", Description:="count of the number of rows in array1 without any missing data",         category:="Reformat", StatusBar:="count of the number of rows in array1 without any missing data",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MERGE_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "array or cell range"
                      argDescription(1) = "array or cell range"
                      Application.MacroOptions Macro:="MERGE", Description:="returns an array consisting of the columns in array1 followed by the columns in array2, filling any empty cells with blanks",         category:="Reformat", StatusBar:="returns an array consisting of the columns in array1 followed by the columns in array2, filling any empty cells with blanks",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub TAGCODE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or cell range"
                      argDescription(1) = "if TRUE (default) use 0, 1 c

                  General
                  Stream Path:VBA/DescriptorRegression
                  VBA File Name:DescriptorRegression
                  Stream Size:282720
                  Data ASCII:. . . . . . . . . . . . . . . . O . . _ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . . . . . . . P . X . . . . . . ` . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 e2 82 01 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 4f 83 01 00 5f 9d 03 00 00 00 00 00 01 00 00 00 d4 1f 18 e3 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorRegression"
                  Sub Regression_Descriptors()
                      Call RegF_Descriptor
                      Call RegY_Descriptor
                      Call RegE_Descriptor
                      Call SSRes_Descriptor
                      Call dfRes_Descriptor
                      Call MSRes_Descriptor
                      Call RegSE_Descriptor
                      Call SSReg_Descriptor
                      Call dfReg_Descriptor
                      Call MSReg_Descriptor
                      Call SSRegTot_Descriptor
                      Call dfRegTot_Descriptor
                      Call MSRegTot_Descriptor
                      Call RegTEST_Descriptor
                      Call RegCov_Descriptor
                      Call RegStudE_Descriptor
                      Call RegAIC_Descriptor
                      Call RegAICc_Descriptor
                      Call RegSBC_Descriptor
                      Call RSquare_Descriptor
                      Call RSquareTest_Descriptor
                      Call DURBIN_Descriptor
                      Call MultipleR_Descriptor
                      Call AdjRSquare_Descriptor
                      Call TOLERANCE_Descriptor
                      Call VIF_Descriptor
                      Call RegCoeffP_Descriptor
                      Call RegStepwise_Descriptor
                      Call RegPred_Descriptor
                      Call RegPredC_Descriptor
                      Call RegPredCC_Descriptor
                      Call StdRegCoeff_Descriptor
                      Call UnStdRegCoeff_Descriptor
                      Call DESIGN_Descriptor
                      Call CORE_Descriptor
                      Call HAT_Descriptor
                      Call DIAGHAT_Descriptor
                      Call LEVERAGE_Descriptor
                      Call RegCoeff_Descriptor
                      Call ExpCoeff_Descriptor
                      Call ExpPred_Descriptor
                      Call ExpPredC_Descriptor
                      Call LADRegCoeff_Descriptor
                      Call LADRegWeights_Descriptor
                      Call LADRegCoeffSE_Descriptor
                      Call LpRegCoeff_Descriptor
                      Call LpRegWeights_Descriptor
                      Call LpRegCoeffSE_Descriptor
                      Call PolyDesign_Descriptor
                      Call PolyCoeff_Descriptor
                      Call PolyRSquare_Descriptor
                      Call PolyDeg_Descriptor
                      Call RegRank_Descriptor
                      Call TRegCoeff0_Descriptor
                      Call TRegCoeff_Descriptor
                      Call DRegCoeff_Descriptor
                      Call DRegIdentity_Descriptor
                      Call DRegPred_Descriptor
                      Call DRegLambda_Descriptor
                      Call DRegResiduals_Descriptor
                      Call RidgeRegCoeff_Descriptor
                      Call RidgeCVError_Descriptor
                      Call RidgeRSQ_Descriptor
                      Call RidgeVIF_Descriptor
                      Call RidgeCoeff_Descriptor
                      Call RidgeMSE_Descriptor
                      Call RidgeLambda_Descriptor
                      Call RidgePred_Descriptor
                      Call LASSOCoeff_Descriptor
                      Call HACCoeff_Descriptor
                      Call COCoeff_Descriptor
                      Call CO_Coeff_Descriptor
                      Call CO_RHO_Descriptor
                      Call BGSTAT_Descriptor
                      Call BGTEST_Descriptor
                      Call BPagStat_Descriptor
                      Call BPagTest_Descriptor
                      Call WhiteStat_Descriptor
                      Call WhiteTest_Descriptor
                      Call SlopesTest_Descriptor
                      Call SHAPLEY_Descriptor
                      Call DUpperCRIT_Descriptor
                      Call DLowerCRIT_Descriptor
                      Call WRegCoeff_Descriptor
                      Call ProbitRSquare_Descriptor
                      Call ProbitPred_Descriptor
                      Call ProbitPredC_Descriptor
                      Call ProbitTest_Descriptor
                      Call ProbitCoeff_Descriptor
                      Call ProbitCoeff2_Descriptor
                      Call PoissonPred_Descriptor
                      Call PoissonPredC_Descriptor
                      Call PoissonPredCC_Descriptor
                      Call PoissonCoeff_Descriptor
                      Call PoissonCov_Descriptor
                      Call LogitSummary_Descriptor
                      Call LogitRSquare_Descriptor
                      Call LogitPred_Descriptor
                      Call LogitPredC_Descriptor
                      Call LogitTest_Descriptor
                      Call LogitCoeff_Descriptor
                      Call LogitCoeff2_Descriptor
                      Call RRegCoeff_Descriptor
                      Call RRegF_Descriptor
                      Call WVIF_Descriptor
                      Call WRSquare_Descriptor
                      Call RegCV_Descriptor
                      Call PredRSquare_Descriptor
                      Call PRESS_Descriptor
                      Call MLogitCoeff_Descriptor
                      Call MLogitSummary_Descriptor
                      Call MLogitExtract_Descriptor
                      Call MLogitSelect_Descriptor
                      Call MLogitParam_Descriptor
                      Call MLogitTest_Descriptor
                      Call MLogitRSquare_Descriptor
                      Call MLogitPred_Descriptor
                      Call MLogitPredC_Descriptor
                      Call MLogit_Accuracy_Descriptor
                      Call OLogitPredC_Descriptor
                      Call R_Square_Descriptor
                      Call SS_REG_Descriptor
                      Call SS_RES_Descriptor
                      Call LOGRANK_Descriptor
                      Call IPFP2_Descriptor
                      Call IPFP3_Descriptor
                      Call PBRegCoeff_Descriptor
                      Call PBTEST_Descriptor
                      Call COXPRED_Descriptor
                      Call COXPRED0_Descriptor
                      Call COXEST_Descriptor
                      Call BRegCoeff_Descriptor
                      Call CRegCoeff_Descriptor
                      Call ProbitLL_Descriptor
                      Call ProbitCorrect_Descriptor
                      Call ProbitConverge_Descriptor
                      Call ProbitCov_Descriptor
                      Call ProbitAUC_Descriptor
                      Call ProbitROC_Descriptor
                      Call LogitLL_Descriptor
                      Call LogitCorrect_Descriptor
                      Call LogitConverge_Descriptor
                      Call LogitCov_Descriptor
                      Call LogitAUC_Descriptor
                      Call LogitROC_Descriptor
                      Call OLogitCoeff_Descriptor
                      Call OLogitLL_Descriptor
                      Call OLogitCorrect_Descriptor
                      Call OLogitConverge_Descriptor
                      Call OLogitCov_Descriptor
                      Call OLogitSummary_Descriptor
                      Call OLogitPredX_Descriptor
                      Call RSquare_Test_Descriptor
                      Call TRegParam_Descriptor
                      Call LOESS_Descriptor
                  End Sub
                  
                  Sub DESIGN_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="DESIGN", Description:="returns design matrix for array1, i.e. array augmented with a first column consisting of ones",         category:="Regression", StatusBar:="returns design matrix for array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORE_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or cell range"
                      Application.MacroOptions Macro:="CORE", Description:="returns core matrix for array1, i.e. the inverse of the transpose of array1 multiplied by array1",         category:="Regression", StatusBar:="returns core matrix for range array1, i.e. the inverse of the transpose of array1 multiplied by array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub HAT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="HAT", Description:="returns the hat matrix for data in array1",         category:="Regression", StatusBar:="returns the hat matrix for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub DIAGHAT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="DIAGHAT", Description:="returns a column vector with the values in the diagonal of the hat matrix for data in array1",         category:="Regression", StatusBar:="returns a column vector with the values in the diagonal of the hat matrix for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LEVERAGE_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or cell range"
                      argDescription(1) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="LEVERAGE", Description:="returns leverage vector; i.e. a column vector with the values in the diagonal of the hat matrix for data in array1",         category:="Regression", StatusBar:="returns leverage vector; i.e. a column vector with the values in the diagonal of the hat matrix for data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RegCoeff_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values; one column per independent variable"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="RegCoeff", Description:="returns column vectors consisting of the regression coefficients and their standard errors for linear regression based on xarray and yarray",         category:="Regression", StatusBar:="returns column vectors consisting of the regression coefficients and their standard errors for linear regression based on xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RRegCoeff_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range consisting of x values; one column per independent variable"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "numeric code 0, 1, 2, 3 (default) or 4 corresponding to the robust errors HC0 through HC4"
                      argDescription(3) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="RRegCoeff", Description:="returns column vectors consisting of the regression coefficients and their standard errors for linear regression with robust standard errors",         category:="Regression", StatusBar:="returns column vectors consisting of the regression coefficients and their standard errors for linear regression with robust standard errors",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RRegF_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, one column per independent variable"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "numeric code 0, 1, 2, 3 (default) or 4 corresponding to the robust errors HC0 through HC4"
                      Application.MacroOptions Macro:="RRegF", Description:="returns F statistic for linear regression with intercept and robust standard errors",         category:="Regression", StatusBar:="returns F statistic for linear regression with intercept and robust standard errors",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub R_Square_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric range consisting of x values; no max of 64 columns"
                      argDescription(1) = "numeric range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="R_Square", Description:="returns R square value for the regression based on xarray, yarray and con",         category:="Regression", StatusBar:="returns R square value for the regression based on xarray, yarray and con",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SS_REG_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, no max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="SS_REG", Description:="returns regression SS for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns regression SS for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SS_RES_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, no max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="SS_RES", Description:="returns residual SS for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns residual SS for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RegY_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values; max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="RegY", Description:="returns column vector with predicted values corresponding to the x values in xarray based on the linear regression",         category:="Regression", StatusBar:="returns column vector with predicted values corresponding to the x values in xarray based on the linear regression",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RegE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values; max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="RegE", Description:="returns column vector with residual values corresponding to the x values in xarray based on the linear regression",         category:="Regression", StatusBar:="returns column vector with residual values corresponding to the x values in xarray based on the linear regression",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSRes_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="SSRes", Description:="returns SS for residuals for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns SS for residuals for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfRes_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="dfRes", Description:="returns degrees of freedom of residuals for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns degrees of freedom of residuals for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSRes_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="MSRes", Description:="returns MS for residuals for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns MS for residuals for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub RegSE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="RegSE", Description:="returns standard error for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns standard error for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSReg_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="SSReg", Description:="returns regression SS for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns regression SS for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfReg_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; this argument is for consistency but is not used"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="dfReg", Description:="returns regression degrees of freedom for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns regression degrees of freedom for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSReg_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; one column with same number of rows as xarray"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="MSReg", Description:="returns regression MS for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns regression MS for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SSRegTot_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric range; if rg2 is not void then this consists of x values (not used); if array2 is void then this consists of the y values in a single column"
                      argDescription(1) = "numeric range consisting of y values (one column), although this argument is optional"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="SSRegTot", Description:="returns total SS for linear regression based on the y data (in array1 or array2)",         category:="Regression", StatusBar:="returns total SS for linear regression based on the y value data (in array1 or array2)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub dfRegTot_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                      argDescription(1) = "numeric array or range consisting of y values; this argument is for consistency but is not used"
                      argDescription(2) = "TRUE (default) if regression includes a constant (intercept) term or FALSE otherwise"
                      Application.MacroOptions Macro:="dfRegTot", Description:="returns total degrees of freedom for linear regression based on the data in xarray and yarray",         category:="Regression", StatusBar:="returns total degrees of freedom for linear regression based on the data in xarray and yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MSRegTot_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range consisting of x values, max of 64 columns"
                    

                  General
                  Stream Path:VBA/DescriptorReliability
                  VBA File Name:DescriptorReliability
                  Stream Size:85643
                  Data ASCII:. . . . . . . . b } . . . . . . . . } . . . . . . . . . . . . . . . b d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . { . . . . X . X . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 62 7d 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff cf 7d 00 00 1b 18 01 00 01 00 00 00 01 00 00 00 d4 1f 62 64 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorReliability"
                  Sub Reliability_Descriptors()
                      Call KAPPA_Descriptor
                      Call KENDALLW_Descriptor
                      Call GTRANS_Descriptor
                      Call KTRANS_Descriptor
                      Call GWET_AC2_Descriptor
                      Call KALPHA_Descriptor
                      Call GWET_SER_Descriptor
                      Call KRIP_SER_Descriptor
                      Call GWET_SES_Descriptor
                      Call KRIP_SES_Descriptor
                      Call GWET_Descriptor
                      Call KRIP_Descriptor
                      Call GUTTMAN_Descriptor
                      Call ICC_Descriptor
                      Call CRONALPHA_Descriptor
                      Call CALPHA_Descriptor
                      Call SPLIT_HALF_Descriptor
                      Call SPLITHALF_Descriptor
                      Call KUDER_Descriptor
                      Call WKAPPA_Descriptor
                      Call COV_SPLIT_Descriptor
                      Call CORR_SPLIT_Descriptor
                      Call GUTTMAN_SPLIT_Descriptor
                      Call SB_SPLIT_Descriptor
                      Call SB_PRED_Descriptor
                      Call SB_SIZE_Descriptor
                      Call SB_CORRECTION_Descriptor
                      Call ITEMDIFF_Descriptor
                      Call ITEMDISC_Descriptor
                      Call RASCH_Descriptor
                      Call RASCHFIT_Descriptor
                      Call RASCH_EXP_Descriptor
                      Call RASCH_FIT_Descriptor
                      Call RASCH_INIT_Descriptor
                      Call RASCH_SUBJ_Descriptor
                      Call RASCH_ITEM_Descriptor
                      Call PROX_SUBJ_Descriptor
                      Call PROXX_SUBJ_Descriptor
                      Call PROX_ITEM_Descriptor
                      Call PROXX_ITEM_Descriptor
                      Call UCON_Descriptor
                      Call UCONFIT_Descriptor
                      Call UCON_THRESH_Descriptor
                      Call UCON_SUBJ_Descriptor
                      Call UCON_ITEM_Descriptor
                      Call LINCCC_Descriptor
                      Call BKAPPA_SD_Descriptor
                      Call BT_MODEL_Descriptor
                      Call Pairwise_Sample_Descriptor
                      Call Pairwise_Pop_Descriptor
                  End Sub
                  
                  Sub KAPPA_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric range containing non-negative integer values; the sum of the values in each row must be the same"
                      argDescription(1) = "column number in rg; calculate kappa for all the data in rg if col = 0 (default) or kappa for the category in column col f col > 0"
                      argDescription(2) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(3) = "numeric value; significance level, default is .05"
                      argDescription(4) = "number of tails: 1 or 2 (default)"
                      argDescription(5) = "TRUE if the formula for the standard error in Fleiss' orginal paper is used and FALSE (default) otherwise"
                      Application.MacroOptions Macro:="KAPPA", Description:="returns an array with Fleiss' kappa for data in rg, plus s.e., z-stat, p-value and confidence interval limits",         category:="Reliability", StatusBar:="returns an array with Fleiss' kappa for data in rg, plus s.e., z-stat, p-value and confidence interval limits",         ArgumentDescriptions:=argDescription
                   End Sub
                  
                  Sub KENDALLW_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric range containing non-negative integer values; the sum of the values in each row must be the same"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "TRUE (default) if a ties correction is employed"
                      Application.MacroOptions Macro:="KENDALLW", Description:="returns an array with Kendall's W, r, chi-square stat, df and p-value",         category:="Reliability", StatusBar:="returns an array with Kendall's W, r, chi-square stat, df and p-value",         ArgumentDescriptions:=argDescription
                  End Sub
                   
                  Sub GTRANS_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "column number from rg to eliminate; if zero (default) then don't eliminate any columns from rg"
                      Application.MacroOptions Macro:="GTRANS", Description:="returns an n x q array where n = # of rows in rg which is the agreement table for Gwet's AC2 corresponding to rg",         category:="Reliability", StatusBar:="returns an n x q array where n = # of rows in rg which is the agreement table for Gwet's AC2 corresponding to rg",         ArgumentDescriptions:=argDescription
                  End Sub
                   
                  Sub KTRANS_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "column number from rg to eliminate; if zero (default) then don't eliminate any columns from rg"
                      Application.MacroOptions Macro:="KTRANS", Description:="returns an n x q array where n = # of rows in rg which is the agreement table for Krippendorff's alpha corresponding to rg",         category:="Reliability", StatusBar:="returns an n x q array where n = # of rows in rg which is the agreement table for Krippendorff's alpha corresponding to rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GWET_AC2_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range (agreement table) containing counts (non-negative integer values) where rows = subjects and columns = rating categories"
                      argDescription(1) = "weights: q x q range or array where q = # of columns in array1 or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(2) = "ratings: q x 1 or 1 x q range where q = # of columns in array1 or omitted (default) in which case values 1,...,q are used"
                      Application.MacroOptions Macro:="GWET_AC2", Description:="returns Gwet's AC2 for agreement table in array1 based on the given weights and ratings",         category:="Reliability", StatusBar:="returns Gwet's AC2 for agreement table in array1 based on the given weights and ratings",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KALPHA_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric array or range (agreement table) containing counts (non-negative integer values) where rows = subjects and columns = rating categories"
                      argDescription(1) = "weights: q x q array where q = # of columns in array1 or number 0 to 3 corresponding categorical, ordinal, interval, ratio"
                      argDescription(2) = "ratings: q x 1 or 1 x q range where q = # of columns in array1 or omitted (default) in which case values 1,...,q are used"
                      Application.MacroOptions Macro:="KALPHA", Description:="returns Krippensdorff's alpha for agreement table in array1 based on the given weights and ratings",         category:="Reliability", StatusBar:="returns Krippendorff's alpha for agreement table in array1 based on the given weights and ratings",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GWET_SER_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "weights: q x q range or array where q = largest value in rg or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(2) = "ratings: q x 1 or 1 x q range where q = largest value in rg or omitted (default) in which case values 1,...,q are used"
                      argDescription(3) = "rating population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="GWET_SER", Description:="returns raters standard error of Gwet's AC2 for rating table in rg based on the given weights and ratings",         category:="Reliability", StatusBar:="returns raters standard error of Gwet's AC2 for rating table in rg based on the given weights and ratings",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KRIP_SER_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "weights: q x q range or array where q = largest value in rg or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(2) = "ratings: q x 1 or 1 x q range where q = largest value in rg or omitted (default) in which case values 1,...,q are used"
                      argDescription(3) = "rating population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="KRIP_SER", Description:="returns raters standard error of Krippendorff's alpha for rating table in rg based on the given weights and ratings",         category:="Reliability", StatusBar:="returns raters standard error of Krippendorff's alpha for rating table in rg based on the given weights and ratings",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GWET_SES_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric range or array (agreement table) containing counts (non-negative integer values) where rows = subjects and columns = rating categories"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "weights: q x q range or array where q = # of columns in array1 or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(3) = "ratings: q x 1 or 1 x q range where q = # of columns in array1 or omitted (default) in which case values 1,...,q are used"
                      argDescription(4) = "numeric value; significance level, default is .05"
                      argDescription(5) = "subject population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="GWET_SES", Description:="returns an array with Gwet's AC2, subject standard error for AC2 and 1 - alpha confidence interval (lower and upper)",         category:="Reliability", StatusBar:="returns an array with Gwet's AC2, subject standard error for AC2 and 1 - alpha confidence interval (lower and upper)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KRIP_SES_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "numeric range or array (agreement table) containing counts (non-negative integer values) where rows = subjects and columns = rating categories"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "weights: q x q range or array where q = # of columns in array1 or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(3) = "ratings: q x 1 or 1 x q range where q = # of columns in array1 or omitted (default) in which case values 1,...,q are used"
                      argDescription(4) = "numeric value; significance level, default is .05"
                      argDescription(5) = "subject population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="KRIP_SES", Description:="returns an array with Krippendorff's alpha, subject standard error for kalpha and 1 - alpha confidence interval (lower and upper)",         category:="Reliability", StatusBar:="returns an array with Krippendorff's alpha, subject standard error for kalpha and 1 - alpha confidence interval (lower and upper)",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GWET_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "weights: q x q range or array where q = largest value in rg or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(3) = "ratings: q x 1 or 1 x q range where q = largest value in rg or omitted (default) in which case values 1,...,q are used"
                      argDescription(4) = "numeric value; significance level, default is .05"
                      argDescription(5) = "subject population correction factor (numberic value between 0 and 1; default = 0)"
                      argDescription(6) = "rater population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="GWET", Description:="returns an array with Gwet's AC2, subject standard error for AC2, 1 - alpha confidence interval (lower and upper), rater + subject standard error for AC2 and corresponding 1 - alpha confidence interval",         category:="Reliability", StatusBar:="returns an array with Gwet's AC2, subject standard error for AC2, 1 - alpha confidence interval (lower and upper), rater + subject standard error for AC2 and corresponding 1 - alpha confidence interval",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KRIP_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "numeric range (rating table) containing rating values 1,..,q or blank (missing data), rows = subjects, columns = raters"
                      argDescription(1) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(2) = "weights: q x q range or array where q = largest value in rg or number 0 to 3 corresponding categorical (default), ordinal, interval, ratio"
                      argDescription(3) = "ratings: q x 1 or 1 x q range where q = largest value in rg or omitted (default) in which case values 1,...,q are used"
                      argDescription(4) = "numeric value; significance level, default is .05"
                      argDescription(5) = "subject population correction factor (numberic value between 0 and 1; default = 0)"
                      argDescription(6) = "rater population correction factor (numberic value between 0 and 1; default = 0)"
                      Application.MacroOptions Macro:="KRIP", Description:="returns an array with Krippendorff's alpha, subject standard error for kalpha and 1 - alpha confidence interval (lower and upper), rater + subject standard error for AC2 and corresponding 1 - alpha confidence interval",         category:="Reliability", StatusBar:="returns an array with Krippendorff's alpha, subject standard error for kalpha and 1 - alpha confidence interval (lower and upper), rater + subject standard error for AC2 and corresponding 1 - alpha confidence interval",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub GUTTMAN_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric range or array"
                      argDescription(1) = "integer; if 0 (default) an exact value is returned; if iter > 0 an approx. value is returned based on iter random splits; if iter < 0 an approx. value is returned that maximizes the covariance of -iter many random splits"
                      Application.MacroOptions Macro:="GUTTMAN", Description:="returns Guttman's reliability for the data in array1",         category:="Reliability", StatusBar:="returns Guttman's reliability for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CRONALPHA_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "non-negative integer; if zero (default), then Cronbach's alpha for all the data in array1 is returned; otherwise Cronbach's alpha is returned for all the data in array1 omitting the kth column"
                      Application.MacroOptions Macro:="CRONALPHA", Description:="returns Cronbach's alpha for the data in array1",         category:="Reliability", StatusBar:="returns Cronbach's alpha for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CALPHA_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric array or range"
                      Application.MacroOptions Macro:="CALPHA", Description:="returns a row array with the Cronbach's alpha for the data in array1 with each one of the columns removed",         category:="Reliability", StatusBar:="returns a row array with the Cronbach's alpha for the data in array1 with each one of the columns removed",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ICC_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "ICC class: 1, 2 (default) or 3"
                      argDescription(2) = "ICC type: 1 (default) or k where k = # of columns in array1"
                      argDescription(3) = "TRUE if first column of output consists of labels and FALSE (default) otherwise"
                      argDescription(4) = "numeric value; significance level, default is .05"
                      Application.MacroOptions Macro:="ICC", Description:="returns an array with ICC for data in rg, plus confidence interval limits",         category:="Reliability", StatusBar:="returns an array with ICC for data in rg, plus confidence interval limits",         ArgumentDescriptions:=argDescription
                  End Sub
                   
                  Sub SPLIT_HALF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "numeric array or range"
                      Application.MacroOptions Macro:="SPLIT_HALF", Description:="returns split half coefficient for the data split between array1 and array2",         category:="Reliability", StatusBar:="returns split half coefficient for the data split between array1 and array2",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SPLITHALF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "0 or 1; 0 if odd/even split (default) and 1 if first half split from second half of data in array1"
                      Application.MacroOptions Macro:="SPLITHALF", Description:="returns split half coefficient for the data in array1",         category:="Reliability", StatusBar:="returns split half coefficient for the data in array1",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KUDER_Descriptor()
                      Dim argDescription(0) As String
                      argDescription(0) = "numeric range"
                      Application.MacroOptions Macro:="KUDER", Description:="returns Kuder-Richardson 20 coefficient for the data in rg",         category:="Reliability", StatusBar:="returns Kuder-Richardson 20 coefficient for the data in rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub WKAPPA_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "numeric array or range containing data"
                      argDescription(1) = "case 1: numeric array or range of same dimensions as array1 conatining weights; case 2: 0 for no weights (default), 1 for linear weights, 2 for quadratic weights"
                      argDescription(2) = "TRUE if a column of labels is appended to output (default FALSE)"
                      argDescription(3) = "significance level (default .05)"
                      Application.MacroOptions Macro:="WKAPPA", Description:="returns a column array with weighted kappa, std error, lower and upper limits of the 1-alpha confidence interval",         category:="Reliability", StatusBar:="returns a column array with weighted kappa, std error, lower and upper limits of the 1-alpha confidence interval",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub COV_SPLIT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "string consisting of zeros and ones of length equal to the number of columns in array1"
                      Application.MacroOptions Macro:="COV_SPLIT", Description:="returns the covariance of the data in array1 based on the split half defined by s",         category:="Reliability", StatusBar:="returns the covariance of the data in array1 based on the split half defined by s",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub CORR_SPLIT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "string consisting of zeros and ones of length equal to the number of columns in array1"
                      Application.MacroOptions Macro:="CORR_SPLIT", Description:="returns the correlation coefficient for the data in array1 based on the split half defined by s",         category:="Reliability", StatusBar:="returns the correlation coefficient for the data in array1 based on the split half defined by s",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub SB_SPLIT_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "numeric array or range"
                      argDescription(1) = "string consisting of zeros and ones of length equal to the number of columns in array1"
                      Application.MacroOptions Macro:="SB_SPLIT", Description:="returns the Spearman-Brown correction for the data in array1 based on the split ha

                  General
                  Stream Path:VBA/DescriptorTimeSeries
                  VBA File Name:DescriptorTimeSeries
                  Stream Size:80479
                  Data ASCII:. . . . . . . . 2 z . . . . . . . . z . . . . . . . . . . . . . . C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . . . . . . L . . . . . L . . . . . . . . . . . . . . . . . . w . . . . \\ . X . . . . . . ` .
                  Data Raw:01 16 03 00 06 f0 00 00 00 32 7a 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 9f 7a 00 00 f3 0a 01 00 00 00 00 00 01 00 00 00 d4 1f ff 43 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "DescriptorTimeSeries"
                  Sub TimeSeries_Descriptors()
                      Call ACF_Descriptor
                      Call ACVF_Descriptor
                      Call PACF_Descriptor
                      Call ACOV_Descriptor
                      Call ACORR_Descriptor
                      Call PIERCE_Descriptor
                      Call LJUNG_Descriptor
                      Call BPTEST_Descriptor
                      Call LBTEST_Descriptor
                      Call BARTEST_Descriptor
                      Call KPSSTEST_Descriptor
                      Call PPTEST_Descriptor
                      Call ADFTEST_Descriptor
                      Call ADIFF_Descriptor
                      Call ADFCRIT_Descriptor
                      Call ADFPROB_Descriptor
                      Call ARMap_Descriptor
                      Call ARIMA_Coeff_Descriptor
                      Call ARIMA_Stats_Descriptor
                      Call ARRoots_Descriptor
                      Call MARoots_Descriptor
                      Call PESARAN_Descriptor
                      Call PTTEST_Descriptor
                      Call ForecastError_Descriptor
                      Call Forecast_Error_Descriptor
                      Call DIEBOLD_Descriptor
                      Call DMTEST_Descriptor
                      Call HLN_Descriptor
                      Call HLNTEST_Descriptor
                      Call LossDiff_Descriptor
                      Call SARMA_RES_Descriptor
                      Call SARMA_PRED_Descriptor
                      Call SARIMA_PRED_Descriptor
                      Call EGTEST_Descriptor
                      Call EGCRIT_Descriptor
                      Call EGPROB_Descriptor
                      Call GRANGER_Descriptor
                      Call GRANGER_TEST_Descriptor
                      Call TSImputed_Descriptor
                      Call SARIMA_COEFF_Descriptor
                      Call SARIMA_PARAM_Descriptor
                      Call PSICoeff_Descriptor
                      Call PANEL_REM_Descriptor
                      Call PANEL_DIFF_Descriptor
                      Call PANEL_DVM_Descriptor
                      Call PANEL_DEMEAN_Descriptor
                      Call PANEL_MEANS_Descriptor
                      Call REM_PARAM_Descriptor
                  End Sub
                  
                  Sub ACF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "positive integer value"
                      Application.MacroOptions Macro:="ACF", Description:="returns the autocorrelation function at lag k, ACF(k), for the time series in range rg",         category:="Time Series", StatusBar:="returns ACF(k) value for the time series in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ACVF_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "positive integer value"
                      Application.MacroOptions Macro:="ACVF", Description:="returns the autocovariance function at lag k, ACVF(k), for the time series in range rg",         category:="Time Series", StatusBar:="returns ACVF(k) value for the time series in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PACF_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "positive integer value"
                      argDescription(2) = "positive integer value; if omitted this value defaults to the second argument i"
                      Application.MacroOptions Macro:="PACF", Description:="returns the partial autocorrelation function at lag k, PACF(i, k), for the time series in range rg",         category:="Time Series", StatusBar:="returns PACF(i, k) value for the time series in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ACOV_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "positive integer value; if omitted defaults to # of rows in highlighted range"
                      Application.MacroOptions Macro:="ACOV", Description:="returns the k x k autocovariance matrix for the time series in range rg",         category:="Time Series", StatusBar:="returns the k x k autocovariance matrix for the time series in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ACORR_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "positive integer value; if omitted defaults to # of rows in highlighted range"
                      Application.MacroOptions Macro:="ACORR", Description:="returns the k x k autocorrelation matrix for the time series in range rg",         category:="Time Series", StatusBar:="returns the k x k autocorrelation matrix for the time series in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PIERCE_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "if 1, then use PACF; otherwise use ACF (default)"
                      argDescription(2) = "positive integer value; if omitted this value defaults to 1"
                      Application.MacroOptions Macro:="PIERCE", Description:="returns the Box-Pierce Q statistic for the data in range rg at the specified lag",         category:="Time Series", StatusBar:="returns the Box-Pierce Q statistic for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BPTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "if 1, then use PACF; otherwise use ACF (default)"
                      argDescription(2) = "positive integer value; if omitted this value defaults to 1"
                      Application.MacroOptions Macro:="BPTEST", Description:="returns the p-value for the Box-Pierce test for the data in range rg at the specified lag",         category:="Time Series", StatusBar:="returns the p-value of the Box-Pierce Q test for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LJUNG_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "if 1, then use PACF; otherwise use ACF (default)"
                      argDescription(2) = "positive integer value; if omitted this value defaults to 1"
                      Application.MacroOptions Macro:="LJUNG", Description:="returns the Ljung-Box statistic for the data in range rg at the specified lag",         category:="Time Series", StatusBar:="returns the Ljung-Box statistic for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LBTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column array or range with numeric data"
                      argDescription(1) = "if 1, then use PACF; otherwise use ACF (default)"
                      argDescription(2) = "positive integer value; if omitted this value defaults to 1"
                      Application.MacroOptions Macro:="LBTEST", Description:="returns the p-value for the Ljung-Box test for the data in range rg at the specified lag",         category:="Time Series", StatusBar:="returns the p-value of the Ljung-Box test for the data in range rg",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub BARTEST_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "version 1: column range with numeric data; version 2: autocorrelation correlation for a time series"
                      argDescription(1) = "version 1: if 1, then use PACF; otherwise use ACF (default); version 2: size of a time series"
                      argDescription(2) = "lag (positive integer value); if omitted this value defaults to 1"
                      Application.MacroOptions Macro:="BARTEST", Description:="returns the p-value for Bartlett's test",         category:="Time Series", StatusBar:="returns the p-value for Bartlett's test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub KPSSTEST_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "if TRUE then append a column with labels (default is FALSE)"
                      argDescription(2) = "positive integer value or ""short"" (default) or ""long"""
                      argDescription(3) = "0 if no trend, no intercept; 1 if intercept, no trend (default); 2 if trend"
                      argDescription(4) = "significance level (default .05)"
                      Application.MacroOptions Macro:="KPSSTEST", Description:="returns a column array with test-stat, crit-value, stationary (yes/no), lags and p-value for KPSS test",         category:="Time Series", StatusBar:="returns a column array with test-stat, crit-value, stationary (yes/no), lags and p-value for the KPSS test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PPTEST_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "if TRUE then append a column with labels (default is FALSE)"
                      argDescription(2) = "positive integer value or ""short"" (default) or ""long"""
                      argDescription(3) = "0 if no trend, no intercept; 1 if intercept, no trend (default); 2 if trend"
                      argDescription(4) = "significance level (default .05)"
                      Application.MacroOptions Macro:="PPTEST", Description:="returns a column array with tau-stat, crit-value, stationary (yes/no), lag, p-value and autoregression coefficient for the Phillips-Perron test",         category:="Time Series", StatusBar:="returns a column array with tau-stat, crit-value, stationary (yes/no), lags, p-value and coefficient for the Phillips-Perron test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ADFTEST_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "if TRUE then append a column with labels (default is FALSE)"
                      argDescription(2) = "positive integer value or ""short"" (default) or ""long"""
                      argDescription(3) = "choose ""aic"", ""bic"", ""schwert"" or ""none"" (default)"
                      argDescription(4) = "0 if no trend, no intercept; 1 if intercept, no trend (default); 2 if trend"
                      argDescription(5) = "significance level (default .05)"
                      Application.MacroOptions Macro:="ADFTEST", Description:="returns a column array with tau-stat, crit-value, stationary (yes/no), AIC, BIC, lags, autoregression coefficient and p-value for Augmented Dickey-Fuller test",         category:="Time Series", StatusBar:="returns a column array with tau-stat, crit-value, stationary (yes/no), AIC, BIC, lags, coefficient and p-value for the ADF test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ADIFF_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "non-negative integer; default 1 (amount of ordinary differencing)"
                      argDescription(2) = "non-negative integer; default 0 (amount of seasonal differencing)"
                      argDescription(3) = "non-negative integer; default 12 (seasonality); ignored if dd = 0"
                      Application.MacroOptions Macro:="ADIFF", Description:="returns the time series in range rg differenced d times and seasonally differenced dd times",         category:="Time Series", StatusBar:="returns the time series in range rg differenced d times and seasonally differenced dd times",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ADFCRIT_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "size of a time series; positive integer"
                      argDescription(1) = "significance level; default .05"
                      argDescription(2) = "0 if no trend, no intercept; 1 if intercept, no trend (default); 2 if trend"
                      Application.MacroOptions Macro:="ADFCRIT", Description:="returns the Augmented Dickey-Fuller critical value",         category:="Time Series", StatusBar:="returns the Augmented Dickey-Fuller critical value",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ADFPROB_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "numeric value"
                      argDescription(1) = "size of a time series; positive integer"
                      argDescription(2) = "0 if no trend, no intercept; 1 if intercept, no trend (default); 2 if trend"
                      Application.MacroOptions Macro:="ADFPROB", Description:="returns the approximate ADF p-value for a time series of size n at x",         category:="Time Series", StatusBar:="returns the approximate ADF p-value for a time series of size n at x",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ARMap_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column range with numeric data"
                      argDescription(1) = "positive integer value"
                      Application.MacroOptions Macro:="ARMap", Description:="maps the time series in range rg into a range that can be used to create a linear regression AR(p) model for the data",         category:="Time Series", StatusBar:="maps the time series in range rg into a range that can be used to create a linear regression AR(p) model for the data",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ARIMA_Coeff_Descriptor()
                      Dim argDescription(5) As String
                      argDescription(0) = "time series column range (numeric values)"
                      argDescription(1) = "# of phi (AR) coefficients (non-negative integer)"
                      argDescription(2) = "# of theta (MA) coefficients (non-negative integer)"
                      argDescription(3) = "# of differencings (non-negative integer), default = 0"
                      argDescription(4) = "if TRUE (default) then constant term is included in the model; see documentation for other possible values"
                      argDescription(5) = "if TRUE then append a column with labels (default is FALSE)"
                      Application.MacroOptions Macro:="ARIMA_Coeff", Description:="returns a column with the coefficient, standard error, t-statistic and p-value for each model coefficient",         category:="Time Series", StatusBar:="returns the coefficient, standard error, t-statistic and p-value for each model coefficient",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ARIMA_Stats_Descriptor()
                      Dim argDescription(6) As String
                      argDescription(0) = "time series column range (numeric values)"
                      argDescription(1) = "column array with ARIMA model coefficients: constant, followed by AR coefficients followed by MA coefficients"
                      argDescription(2) = "# of psi (AR) coefficients (non-negative integer)"
                      argDescription(3) = "# of theta (MA) coefficients (non-negative integer)"
                      argDescription(4) = "# of differencings (non-negative integer), default = 0"
                      argDescription(5) = "if TRUE (default) then constant term is included in the model"
                      argDescription(6) = "if TRUE then append a column with labels (default is FALSE)"
                      Application.MacroOptions Macro:="ARIMA_Stats", Description:="returns a column with LL, SS, MSE, AIC, BIC, AIC augmented, BIC augmented",         category:="Time Series", StatusBar:="returns a column with LL, SS, MSE, AIC, BIC, AIC augmented, BIC augmented",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ARRoots_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "p x 1 column array with phi (AR) coefficients of an ARIMA model (numeric values)"
                      argDescription(1) = "precision (default 0.00000001) of Bairstow's algorithm used to find the roots of the characteristic equation"
                      argDescription(2) = "# of iterations (default 50) of Bairstow's algorithm"
                      argDescription(3) = "initial r value for Bairstow's algorithm (default 0)"
                      argDescription(4) = "initial s value for Bairstow's algorithm (default 0)"
                      Application.MacroOptions Macro:="ARRoots", Description:="returns a p x 3 array where each row contains the real and imaginary parts of the root corresponding to that phi coefficient, plus the absolute value of the root",         category:="Time Series", StatusBar:="returns a p x 3 array where each row contains the real and imaginary parts of the root corresponding to that phi coefficient, plus the absolute value of the root",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub MARoots_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "q x 1 column array with theta (MA) coefficients of an ARIMA model (numeric values)"
                      argDescription(1) = "precision (default 0.00000001) of Bairstow's algorithm used to find the roots of the characteristic equation"
                      argDescription(2) = "# of iterations (default 50) of Bairstow's algorithm"
                      argDescription(3) = "initial r value for Bairstow's algorithm (default 0)"
                      argDescription(4) = "initial s value for Bairstow's algorithm (default 0)"
                      Application.MacroOptions Macro:="MARoots", Description:="returns a q x 3 array where each row contains the real and imaginary parts of the root corresponding to that theta coefficient, plus the absolute value of the root",         category:="Time Series", StatusBar:="returns a q x 3 array where each row contains the real and imaginary parts of the root corresponding to that theta coefficient, plus the absolute value of the root",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PESARAN_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (forecast data) with same number of rows as yarray"
                      Application.MacroOptions Macro:="PESARAN", Description:="returns test statistic for Pesaran-Timmermann test",         category:="Time Series", StatusBar:="returns test statistic for Pesaran-Timmermann test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub PTTEST_Descriptor()
                      Dim argDescription(1) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (forecast data) with same number of rows as yarray"
                      Application.MacroOptions Macro:="PTTEST", Description:="returns p-value for Pesaran-Timmermann test",         category:="Time Series", StatusBar:="returns p-value for Pesaran-Timmermann test",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub ForecastError_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (forecast data) with same number of rows as yarray"
                      argDescription(2) = "error type; string with value mse, u1, u2, mpe, mape, mae, me, rmse"
                      Application.MacroOptions Macro:="ForecastError", Description:="returns error of the forecast in farray on the data in yarray",         category:="Time Series", StatusBar:="returns error of the forecast in farray on the data in yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub Forecast_Error_Descriptor()
                      Dim argDescription(2) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (forecast data) with same number of rows as yarray"
                      argDescription(2) = "if TRUE then append a column with labels (default is FALSE)"
                      Application.MacroOptions Macro:="Forecast_Error", Description:="returns array of error measurements (me, mse, rmse, mae, mpe, mape, smape, u1, u2) for the forecast in farray on the data in yarray",         category:="Time Series", StatusBar:="returns array of error measurements (me, mse, rmse, mae, mpe, mape, smape, u1, u2) for the forecast in farray on the data in yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub LossDiff_Descriptor()
                      Dim argDescription(3) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (first forecast data) with same number of rows as yarray"
                      argDescription(2) = "column range with numeric data (second forecast data) with same number of rows as yarray"
                      argDescription(3) = "if 0 (default) then use squared errors for loss function; if 1 use absolute value of the errors"
                      Application.MacroOptions Macro:="LossDiff", Description:="returns the loss differential time series for forecasts farray1 and farray2 based on the data in yarray",         category:="Time Series", StatusBar:="returns the loss differential time series for forecasts farray1 and farray2 based on the data in yarray",         ArgumentDescriptions:=argDescription
                  End Sub
                  
                  Sub HLN_Descriptor()
                      Dim argDescription(4) As String
                      argDescription(0) = "column range with numeric data (input data)"
                      argDescription(1) = "column range with numeric data (first forecast data) with same number of rows as yarray"
                      argDescription(2) = "column range with numeric data (second forecast data) with same number of rows as yarray"
                      argDescription(3) = "non-negative integer; forecast errors have zero autocorrelations at order h and higher; if h = 0 (default) then h is reset to the cube root of the number of elements in yarray"
                      argDescription(4) = "if 0 (default) then use squared errors for loss function; if 1 use absolute value of the errors"
                      Application.MacroOptions Macro:="HLN", De

                  General
                  Stream Path:VBA/Distribution
                  VBA File Name:Distribution
                  Stream Size:167775
                  Data ASCII:. . . . . 0 . . . * . . . . . . . . . X . . . . d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H . . . 8 . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . . f . i . c . e . / . . . p . r . e . a . d . s . h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0 . . . . . . . . . . . . . . . . . . . . . . .
                  Data Raw:01 16 03 00 06 30 02 00 00 2a a0 00 00 14 02 00 00 f0 02 00 00 ff ff ff ff 58 a0 00 00 88 fe 01 00 64 00 00 00 01 00 00 00 d4 1f fd 08 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 04 00 08 00 10 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Distribution"
                  ' t distribution
                  
                  Private Function TPDF(x As Double, df As Double) As Double
                  ' return the pdf of the t distribution with df degrees of freedom at x
                      Dim k As Double
                      k = (df + 1) / 2
                      Dim c As Double     ' natural log of the constant
                      c = Exp(Application.WorksheetFunction.GammaLn(k) -         0.5 * (Log(PI()) + Log(df)) - Application.WorksheetFunction.GammaLn(df / 2))
                      TPDF = c / (1 + x ^ 2 / df) ^ k
                  End Function
                  
                  Function T_DIST_2T(x As Variant, df As Variant) As Double
                  Attribute T_DIST_2T.VB_Description = "returns two-tailed Student's t distribution value"
                  Attribute T_DIST_2T.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to T.DIST function, except that df can be a decimal
                      T_DIST_2T = 1 - F_DIST(x ^ 2, 1, df, True)
                  End Function
                  
                  Function T_DIST(x As Double, df As Double, cum As Boolean) As Double
                  Attribute T_DIST.VB_Description = "returns Student's t distribution value"
                  Attribute T_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to T.DIST function, except that df can be a decimal
                      If cum Then
                          If x >= 0 Then
                              T_DIST = (1 + F_DIST(x ^ 2, 1, df, True)) / 2
                          Else
                              T_DIST = (1 - F_DIST(x ^ 2, 1, df, True)) / 2
                          End If
                      Else
                          T_DIST = TPDF(x, df)
                      End If
                  End Function
                  
                  Function T_DIST_RT(x As Double, df As Double) As Double
                  Attribute T_DIST_RT.VB_Description = "returns right-tailed Student's t distribution value"
                  Attribute T_DIST_RT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to T.DIST.RT function, except that df can be a decimal
                      If x >= 0 Then
                          T_DIST_RT = (1 - F_DIST(x ^ 2, 1, df, True)) / 2
                      Else
                          T_DIST_RT = (1 + F_DIST(x ^ 2, 1, df, True)) / 2
                      End If
                  End Function
                  
                  Function T_INV_2T(p As Variant, df As Variant) As Double
                  Attribute T_INV_2T.VB_Description = "returns the inverse of the two-tailed Student's t distribution"
                  Attribute T_INV_2T.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to T.INV.2T function, except that df can be a decimal
                      T_INV_2T = Sqr(F_INV(1 - p, 1, df))
                  End Function
                  
                  Function T_INV(p As Double, df As Double) As Double
                  Attribute T_INV.VB_Description = "returns the inverse of the Student's t distribution"
                  Attribute T_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to T.INV function, except that df can be a decimal
                      If p < 0.5 Then
                          T_INV = -Sqr(F_INV(1 - 2 * p, 1, df))
                      ElseIf p > 0.5 Then
                          T_INV = Sqr(F_INV(2 * p - 1, 1, df))
                      Else
                          T_INV = 0#
                      End If
                  End Function
                  
                  Function T3_DIST(x As Double, df As Double, mu As Double, sigma As Double, cum As Boolean) As Double
                  Attribute T3_DIST.VB_Description = "returns the three-parameter t distribution at x"
                  Attribute T3_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' 3-parameter t distribution
                      If cum = True Then
                          T3_DIST = T_DIST((x - mu) / sigma, df, True)
                      Else
                          T3_DIST = T_DIST((x - mu) / sigma, df, False) / sigma
                      End If
                  End Function
                  
                  Function T3_INV(p As Double, df As Double, mu As Double, sigma As Double) As Double
                  Attribute T3_INV.VB_Description = "returns the inverse of the three-parameter t distribution at p"
                  Attribute T3_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                      T3_INV = sigma * T_INV(p, df) + mu
                  End Function
                  
                  ' chi-square
                  
                  Function CHISQ_DIST(x As Variant, df As Variant, cum As Boolean) As Double
                  Attribute CHISQ_DIST.VB_Description = "returns chi-square distribution value"
                  Attribute CHISQ_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to CHISQ.DIST function, but with exact values for non-integer df
                      CHISQ_DIST = Application.WorksheetFunction.GAMMA_DIST(x, df / 2, 2, cum)
                  End Function
                  
                  Function CHISQ_DIST_RT(x As Variant, df As Variant) As Double
                  Attribute CHISQ_DIST_RT.VB_Description = "returns right-tailed chi-square distribution value"
                  Attribute CHISQ_DIST_RT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to CHISQ.DIST.RT function, but with exact values for non-integer df
                      CHISQ_DIST_RT = 1 - Application.WorksheetFunction.GAMMA_DIST(x, df / 2, 2, True)
                  End Function
                  
                  Function CHISQ_INV(p As Double, df As Double) As Double
                  Attribute CHISQ_INV.VB_Description = "returns the inverse of the chi-square distribution"
                  Attribute CHISQ_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to CHISQ.INV function, but with exact values for non-integer df
                      CHISQ_INV = Application.WorksheetFunction.GAMMA_INV(p, df / 2, 2)
                  End Function
                  
                  Function CHISQ_INV_RT(p As Variant, df As Variant) As Double
                  Attribute CHISQ_INV_RT.VB_Description = "returns the inverse of the right-tailed chi-square distribution"
                  Attribute CHISQ_INV_RT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to CHISQ.INV.RT function, but with exact values for non-integer df
                      CHISQ_INV_RT = Application.WorksheetFunction.GAMMA_INV(1 - p, df / 2, 2)
                  End Function
                  
                  ' F distribution
                  
                  Function F_DIST(x As Double, df1 As Variant, df2 As Variant, cum As Boolean) As Double
                  Attribute F_DIST.VB_Description = "returns F distribution value"
                  Attribute F_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                      Dim b As Double
                      If cum Then
                          F_DIST = Application.WorksheetFunction.Beta_Dist((x * df1 / df2) / (1 + x * df1 / df2), df1 / 2, df2 / 2, True)
                      Else
                          b = BETA(df1 / 2, df2 / 2)
                          F_DIST = 1 / b * (df1 / df2) ^ (df1 / 2) * x ^ (df1 / 2 - 1) / (1 + df1 / df2 * x) ^ ((df1 + df2) / 2)
                      End If
                  End Function
                  
                  Function F_DIST_RT(x As Variant, df1 As Variant, df2 As Variant) As Double
                  Attribute F_DIST_RT.VB_Description = "returns right-tailed F distribution value"
                  Attribute F_DIST_RT.VB_ProcData.VB_Invoke_Func = " \n20"
                      F_DIST_RT = 1 - Application.WorksheetFunction.Beta_Dist(x * df1 / (x * df1 + df2), df1 / 2, df2 / 2, True)
                  End Function
                  
                  Function F_INV(p As Double, df1 As Double, df2 As Variant) As Double
                  Attribute F_INV.VB_Description = "returns the inverse of the F distribution"
                  Attribute F_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to F.INV function, but with exact values for non-integer df
                      Dim x As Double
                      x = Application.WorksheetFunction.Beta_Inv(p, df1 / 2, df2 / 2)
                      F_INV = x * df2 / (df1 * (1 - x))
                  End Function
                  
                  Function F_INV_RT(p As Variant, df1 As Variant, df2 As Variant) As Double
                  Attribute F_INV_RT.VB_Description = "returns the inverse of the right-tailed F distribution"
                  Attribute F_INV_RT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' similar to F.INV.RT function, but with exact values for non-integer df
                      Dim x As Double
                      x = Application.WorksheetFunction.Beta_Inv(1 - p, df1 / 2, df2 / 2)
                      F_INV_RT = x * df2 / (df1 * (1 - x))
                  End Function
                  
                  ' misc
                  
                  Function GEOM_DIST(x As Double, p As Double, cum As Boolean) As Double
                  Attribute GEOM_DIST.VB_Description = "returns the geometric distribution value"
                  Attribute GEOM_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' pdf/cdf for geometric distribution
                      GEOM_DIST = WorksheetFunction.NegBinom_Dist(x, 1, p, cum)
                  End Function
                  
                  Function GEOM_INV(p As Double, pp As Double) As Double
                  Attribute GEOM_INV.VB_Description = "returns the inverse of the geometric distribution"
                  Attribute GEOM_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' inverse for geometric distribution
                      GEOM_INV = NEGBINOM_INV(p, 1, pp)
                  End Function
                  
                  Function MULTINOMDIST(narray As Variant, parray As Variant) As Double
                  Attribute MULTINOMDIST.VB_Description = "returns multinomial distribution (pdf)"
                  Attribute MULTINOMDIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return value of multinomial distribution where narray are the number of successes and
                  ' parray are the probabilities of success; assumes narray and parray have the same shape
                      Dim tot As Double
                      tot = Application.WorksheetFunction.MultiNomial(narray)
                      Dim i As Integer
                      Dim n As Integer
                      Dim arr1 As Variant
                      Dim arr2 As Variant
                      arr1 = narray
                      arr2 = parray
                      n = UBound(arr1, 1)
                      If n = 1 Then
                      ' row vector case
                          n = UBound(arr1, 2)
                          For i = 1 To n
                              tot = tot * arr2(1, i) ^ arr1(1, i)
                          Next
                      Else
                      ' column vector case
                          For i = 1 To n
                              tot = tot * arr2(i, 1) ^ arr1(i, 1)
                          Next
                      End If
                      MULTINOMDIST = tot
                  End Function
                  
                  Function UNIFORM_DIST(x As Double, a As Double, b As Double, cum As Boolean) As Double
                  Attribute UNIFORM_DIST.VB_Description = "returns uniform distribution value"
                  Attribute UNIFORM_DIST.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return pdf of uniform distribution for x if cum = FALSE and cummulative distribution function at x if cum = TRUE
                      If cum Then     ' cumulative distribution function
                          If x <= a Then
                              UNIFORM_DIST = 0#
                          ElseIf x >= b Then
                              UNIFORM_DIST = 1#
                          Else
                              UNIFORM_DIST = (x - a) / (b - a)
                          End If
                      Else            ' pdf
                          If x < a Or x > b Then
                              UNIFORM_DIST = 0
                          Else
                              UNIFORM_DIST = 1 / (b - a)
                          End If
                      End If
                  End Function
                  
                  Function UNIFORM_INV(p As Double, a As Double, b As Double) As Double
                  Attribute UNIFORM_INV.VB_Description = "returns the inverse of the uniform distribution"
                  Attribute UNIFORM_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of uniform distribution at p
                      UNIFORM_INV = a + p * (b - a)
                  End Function
                  
                  Function WEIBULL_INV(p As Double, b As Double, a As Double) As Double
                  Attribute WEIBULL_INV.VB_Description = "returns the inverse of the Weibull distribution"
                  Attribute WEIBULL_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of Weibull distribution at p
                      WEIBULL_INV = a * (-Log(1 - p)) ^ (1 / b)
                  End Function
                  
                  Function EXPON_INV(p As Double, lambda As Double) As Double
                  Attribute EXPON_INV.VB_Description = "returns the inverse of the exponential distribution at p"
                  Attribute EXPON_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of Exponential distribution at p
                      EXPON_INV = -Log(1 - p) / lambda
                  End Function
                  
                  Function POISSON_INV(p As Double, lambda As Double) As Double
                  Attribute POISSON_INV.VB_Description = "returns the inverse of the Poisson distribution"
                  Attribute POISSON_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of the Poisson distribution at p
                  
                      Dim w As Double
                      Dim x As Double
                      Dim n As Double
                      Dim q As Double
                      
                      w = WorksheetFunction.Norm_S_Inv(p)
                      x = lambda + Sqr(lambda) * w + (w ^ 2 + 2) / 6 - (w ^ 3 + 2 * w) / (72 * Sqr(lambda))
                      n = Int(x)
                      If n < 0 Then n = 0
                      q = WorksheetFunction.Poisson_Dist(n, lambda, True)
                      If q < p Then
                          n = n + 1
                      ElseIf n > 0 Then
                          If WorksheetFunction.Poisson_Dist(n - 1, lambda, True) >= p Then n = n - 1
                      End If
                      
                      POISSON_INV = n
                      
                  End Function
                  
                  Function NEGBINOM_INV(p As Double, k As Double, pp As Double) As Double
                  Attribute NEGBINOM_INV.VB_Description = "returns the inverse of the negative binomial distribution; i.e. the smallest integer x such that NEGBINOM.DIST(x,k,pp,TRUE)>=p"
                  Attribute NEGBINOM_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of the negative binomial distribution at p                 *** remove for Excel 2007
                  
                      Dim x0 As Double        ' low end
                      Dim x1 As Double        ' high end
                      Dim x As Double         ' middle
                      Dim i As Long           ' index
                      Dim iter As Long        ' # of iterations
                      iter = 32
                      x0 = 0#
                      x1 = 1024000000#
                      For i = 1 To iter
                          x = (x1 + x0) / 2
                          If Application.WorksheetFunction.NegBinom_Dist(x, k, pp, True) >= p Then
                              x1 = x
                          Else
                              x0 = x
                          End If
                      Next
                      x = Int(x1)
                      If Application.WorksheetFunction.NegBinom_Dist(x, k, pp, True) >= p Then
                          NEGBINOM_INV = x
                      Else
                          NEGBINOM_INV = x + 1
                      End If
                      
                  End Function
                  
                  Function HYPGEOM_INV(p As Double, n As Double, k As Double, m As Double) As Double
                  Attribute HYPGEOM_INV.VB_Description = "returns the inverse of the hypergeometric distribution; i.e. the smallest integer x such that HYPGEOM.DIST(x,n,k,m,TRUE)>=p"
                  Attribute HYPGEOM_INV.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return the inverse of the hypegeometric distribution at p          *** remove for Excel 2007
                  
                      Dim x0 As Double        ' low end
                      Dim x1 As Double        ' high end
                      Dim x As Double         ' middle
                      Dim i As Long           ' index
                      Dim iter As Long        ' # of iterations
                      iter = Application.WorksheetFunction.RoundUp(Log(n) / Log(2), 0)
                      x0 = 0#
                      x1 = n
                      For i = 1 To iter
                          x = (x1 + x0) / 2
                          If Application.WorksheetFunction.HypGeom_Dist(x, n, k, m, True) >= p Then
                              x1 = x
                          Else
                              x0 = x
                          End If
                      Next
                      x = Int(x1)
                      If Application.WorksheetFunction.HypGeom_Dist(x, n, k, m, True) >= p Then
                          HYPGEOM_INV = x
                      Else
                          HYPGEOM_INV = x + 1
                      End If
                      
                  End Function
                  
                  Function BINOM_CRIT(n As Long, p As Double, alpha As Double) As Double
                  Attribute BINOM_CRIT.VB_Description = "returns the critical value for the binomial distribution"
                  Attribute BINOM_CRIT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return critical value for binomial distribution
                  
                      Dim c As Double     ' output
                      c = Application.WorksheetFunction.Binom_Inv(n, p, alpha)
                      If alpha < 0.5 And Application.WorksheetFunction.Binom_Dist(c, n, p, True) <> alpha Then c = c - 1
                      BINOM_CRIT = c
                  
                  End Function
                  
                  ' Studentized q range
                  
                  Private Function PI() As Double
                  ' return pi
                      PI = 4 * Atn(1)
                  End Function
                  
                  Private Function lngamma(x) As Double
                      lngamma = Application.WorksheetFunction.GammaLn(x)
                  End Function
                  
                  Private Function apnorm(z As Double) As Double
                      apnorm = Application.WorksheetFunction.Norm_S_Dist(z, True)
                  End Function
                  
                  Private Function apnorminv(p) As Double
                      apnorminv = Application.WorksheetFunction.Norm_S_Inv(p)
                  End Function
                  
                  Private Function fint(w As Double, yii As Double, aii As Double, bii As Double, r As Double) As Double
                      Dim yyi As Double
                      Dim temp As Double
                      temp = 0#
                      yyi = (bii - aii) * yii + bii + aii
                      temp = (Exp(1) ^ (-yyi * yyi / 8#)) * (apnorm(yyi / 2#) - apnorm((yyi - 2 * w) / 2)) ^ (r - 1#)
                      fint = temp
                  End Function
                  
                  Private Function gausslegendrequadrature(w As Double, yii As Double, aii As Double, bii As Double,     r As Double, a As Double, b As Double, n As Long) As Double
                  
                      ' adapted from: Ferreira et al. (2007)
                      
                      Static root(1 To 20) As Double
                      Static weight(1 To 20) As Double
                      
                      root(1) = 0.993128599185095
                      root(2) = 0.963971927277914
                      root(3) = 0.912234428251326
                      root(4) = 0.839116971822219
                      root(5) = 0.746331906460151
                      root(6) = 0.636053680726515
                      root(7) = 0.510867001950827
                      root(8) = 0.37370608871542
                      root(9) = 0.227785851141645
                      root(10) = 7.65265211334973E-02
                      root(11) = -7.65265211334973E-02
                      root(12) = -0.227785851141645
                      root(13) = -0.37370608871542
                      root(14) = -0.510867001950827
                      root(15) = -0.636053680726515
                      root(16) = -0.746331906460151
                      root(17) = -0.839116971822219
                      root(18) = -0.912234428251326
                      root(19) = -0.963971927277914
                      root(20) = -0.993128599185095
                      
                      weight(1) = 1.76140071391521E-02
                      weight(2) = 4.06014298003869E-02
                      weight(3) = 6.26720483341091E-02
                      weight(4) = 8.32767415767048E-02
                      weight(5) = 0.10193011981724
                      weight(6) = 0.118194531961518
                      weight(7) = 0.131688638449177
                      weight(8) = 0.142096109318382
                      weight(9) = 0.149172986472604
                      weight(10) = 0.152753387130726
                      weight(11) = 0.152753387130726
                      weight(12) = 0.149172986472604
                      weight(13) = 0.142096109318382
                      weight(14) = 0.131688638449177
                      weight(15) = 0.118194531961518
                      weight(16) = 0.10193011981724
                      weight(17) = 8.32767415767048E-02
                      weight(18) = 6.26720483341091E-02
                      weight(19) = 4.06014298003869E-02
                      weight(20) = 1.76140071391521E-02
                      
                      Dim c As Double
                      Dim d As Double
                      Dim sum1 As Double
                      Dim temp As Double
                      Dim j As Long
                      Dim jfirst As Long
                      Dim jlast As Long
                          
                      jfirst = 1
                      jlast = n
                      c = (b - a) / 2#
                      d = (b + a) / 2#
                      sum1 = 0#
                  
                      For j = jfirst To jlast
                          If root(j) = 0# Then
                              sum1 = sum1 + weight(j) * fint(w, d, aii, bii, r)
                          Else
                              sum1 = sum1 + weight(j) * (fint(w, root(j) * c + d, aii, bii, r))
                          End If
                      Next
                      temp = c * sum1
                  
                      gausslegendrequadrature = temp
                  
                  End Function
                  
                  Private Function prange_v_inf(w As Double, r As Double) As Double
                  
                  ' adapted from: Ferreira et al. (2007)
                  
                      Dim k As Double
                      Dim ai As Double
                      Dim bi As Double
                      Dim soma As Double
                      Dim ii As Double
                      Dim temp As Double
                      Dim i As Long
                  
                      If w <= 0 Then
                          temp = 0#
                          prange_v_inf = temp
                          Exit Function
                      End If
                  
                      If w <= 3 Then
                          k = 3#
                      Else
                          k = 2#
                      End If
                  
                      ' initialize value of ai p/ i=1
                  
                      ai = w / 2#
                      ii = 1#
                      bi = ((k - ii) * (w / 2#) + 8# * ii) / k
                      soma = 0#
                  
                      For i = 1 To Int(k)
                          ii = i
                          soma = soma + ((bi - ai) / 2#) * gausslegendrequadrature(w, 0#, ai, bi, r, -1#, 1#, 20)
                          ai = bi
                          If (i + 1) = Int(k) Then
                              bi = 8#
                          Else
                              bi = ((k - ii - 1#) * (w / 2#) + 8# * (ii + 1#)) / k
                          End If
                      Next
                      
                      soma = soma * 2# * r / Sqr(2# * PI())
                      soma = soma + Exp(1#) ^ (r * Log(2# * apnorm(w / 2#) - 1#))
                      temp = soma
                      prange_v_inf = temp
                          
                  End Function
                  
                  Private Function f26(q As Double, za As Double, aii As Double, c As Double, r As Double, v As Double, L As Double) As Double
                  
                      ' adapted from: Ferreira et al. (2007)
                  
                      Dim yyi As Double
                      Dim aux As Double
                      Dim aux1 As Double
                  
                      yyi = (za * L + 2# * aii * L + L)
                      aux1 = prange_v_inf(Sqr(yyi / 2#) * q, r)
                  
                      If aux1 = 0# Then aux1 = 1E-37
                  
                      aux = c * Log(aux1) + Log(L) + (v / 2#) * Log(v) + (-yyi * v / 4#) + (v / 2# - 1#) * Log(yyi) - (v * Log(2#) + lngamma(v / 2#))
                  
                      Dim temp As Double
                      If Abs(aux) >= 1E+30 Then
                          temp = 0#
                      Else
                          temp = Exp(aux)
                      End If
                  
                      f26 = temp
                  
                  End Function
                  
                  Private Function gausslegdquad(q As Double, yii As Double, aii As Double, r As Double, ci As Double, a As Double, b As Double,     v As Double, L As Double, n As Long) As Double
                  
                      ' adapted from Ferreira et al. (2007)
                  
                      Static root(1 To 20) As Double
                      Static weight(1 To 20) As Double
                      
                      root(1) = 0.993128599185095
                      root(2) = 0.963971927277914
                      root(3) = 0.912234428251326
                      root(4) = 0.839116971822219
                      root(5) = 0.746331906460151
                      root(6) = 0.636053680726515
                      root(7) = 0.510867001950827
                      root(8) = 0.37370608871542
                      root(9) = 0.227785851141645
                      root(10) = 7.65265211334973E-02
                      root(11) = -7.65265211334973E-02
                      root(12) = -0.227785851141645
                      root(13) = -0.37370608871542
                      root(14) = -0.510867001950827
                      root(15) = -0.636053680726515
                      root(16) = -0.746331906460151
                      root(17) = -0.839116971822219
                      root(18) = -0.912234428251326
                      root(19) = -0.963971927277914
                      root(20) = -0.993128599185095
                      
                      weight(1) = 1.76140071391521E-02
                      weight(2) = 4.06014298003869E-02
                      weight(3) = 6.26720483341091E-02
                      weight(4) = 8.32767415767048E-02
                      weight(5) = 0.10193011981724
                      weight(6) = 0.118194531961518
                      weight(7) = 0.131688638449177
                      weight(8) = 0.142096109318382
                      weight(9) = 0.149172986472604
                      weight(10) = 0.152753387130726
                      weight(11) = 0.152753387130726
                      weight(12) = 0.149172986472604
                      weight(13) = 0.142096109318382
                      weight(14) = 0.131688638449177
                      weight(15) = 0.118194531961518
                      weight(16) = 0.10193011981724
                      weight(17) = 8.32767415767048E-02
                      weight(18) = 6.26720483341091E-02
                      weight(19) = 4.06014298003869E-02
                      weight(20) = 1.76140071391521E-02
                  
                      Dim cmm As Double
                      Dim d As Double
                      Dim sum1 As Double
                      Dim temp As Double
                      Dim j As Long
                      Dim jfirst As Long
                      Dim jlast As Long
                  
                      jfirst = 1
                      jlast = n
                      cmm = (b - a) / 2#
                      d = (b + a) / 2#
                      sum1 = 0#
                  
                      For j = jfirst To jlast
                          If root(j) = 0# Then
                              sum1 = sum1 + weight(j) * f26(q,

                  General
                  Stream Path:VBA/Eigen
                  VBA File Name:Eigen
                  Stream Size:122277
                  Data ASCII:. . . . . . . . . m . . . . . . . . H m . . z . . . . . . . . . . . { . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . j . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 1a 6d 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 48 6d 00 00 d4 7a 01 00 2e 00 00 00 01 00 00 00 d4 1f d1 7b 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Eigen"
                  Option Explicit
                  Option Base 0
                  DefLng I-N
                  DefDbl A-H, O-Z
                  Const RADIX = 2#
                  
                  ' LU decomposition
                  
                  Sub ludcmp(n, d, a(), indx(), iflag)
                  ' input: square n x n matrix A
                  ' output: A now contains LU decomposition, indx is a vector specifying row permutations
                  ' if iflag = 1, A is a singular matrix (no LU decomposition); = 0 success
                  ' if d = 1, even # of row permuations; = -1 odd number of row permuations
                  ' d is used by lubksb to solve linear equations or invert a matrix
                  
                      Dim i, amax, j, tot, k, dum, imax
                      ReDim v(n)
                      Const tiny = 1E-20
                      
                      iflag = 0
                      
                      d = 1#
                      
                      For i = 1 To n
                          amax = 0#
                          For j = 1 To n
                              If Abs(a(i, j)) > amax Then amax = Abs(a(i, j))
                          Next j
                          If amax = 0# Then
                              iflag = 1
                              a(i, i) = tiny
                              amax = tiny
                          End If
                               
                          v(i) = 1# / amax
                      Next i
                      
                      For j = 1 To n
                          For i = 1 To j - 1
                              tot = a(i, j)
                              For k = 1 To i - 1
                                  tot = tot - a(i, k) * a(k, j)
                              Next k
                              a(i, j) = tot
                          Next i
                          amax = 0#
                          For i = j To n
                              tot = a(i, j)
                              For k = 1 To j - 1
                                  tot = tot - a(i, k) * a(k, j)
                              Next k
                              a(i, j) = tot
                              dum = v(i) * Abs(tot)
                              If dum >= amax Then
                                  imax = i
                                  amax = dum
                              End If
                          Next i
                          If j <> imax Then
                              For k = 1 To n
                                  Swap a(imax, k), a(j, k)
                              Next k
                              d = -d
                              v(imax) = v(j)
                          End If
                          indx(j) = imax
                          If a(j, j) = 0# Then
                              a(j, j) = tiny
                              iflag = 1
                          End If
                          If j <> n Then
                              dum = 1# / a(j, j)
                              For i = j + 1 To n
                                  a(i, j) = a(i, j) * dum
                              Next i
                          End If
                      Next j
                      
                  End Sub
                  
                  Function LUPFactor(array1 As Variant) As Variant
                  Attribute LUPFactor.VB_Description = "returns a 2n+1 x n array whose first and second n rows consist of the L and U matrices and whose last row specifies the P matrix, where A = P'LU is the LU factorization of A = array1, an n x n matrix"
                  Attribute LUPFactor.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' output the LUP decomposition of the square array in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      ReDim barr(1 To n, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To n
                          For j = 1 To n
                              barr(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, barr(), indx(), iflag)
                      
                      If iflag = 1 Then
                          LUPFactor = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      ' get real permutations
                      ReDim pindx(1 To n) As Long
                      Dim temp As Long
                      For i = 1 To n
                          pindx(i) = i
                      Next
                      For i = 1 To n
                          If indx(i) > i Then
                              temp = pindx(i)
                              pindx(i) = pindx(indx(i))
                              pindx(indx(i)) = temp
                          End If
                      Next
                      
                      ' prepare output
                      ReDim outp(1 To n + n + 1, 1 To n)
                      For j = 1 To n
                          ' upper triangular
                          For i = 1 To j - 1
                              outp(i, j) = 0#
                          Next
                          outp(i, i) = 1#
                          For i = j + 1 To n
                              outp(i, j) = barr(i, j)
                          Next
                          ' lower triangular
                          For i = 1 To j
                              outp(i + n, j) = barr(i, j)
                          Next
                          For i = j + 1 To n
                              outp(i + n, j) = 0#
                          Next
                          outp(n + n + 1, j) = pindx(j)
                      Next
                      
                      LUPFactor = outp
                            
                  End Function
                  
                  Function LUPFactorU(array1 As Variant) As Variant
                  Attribute LUPFactorU.VB_Description = "returns the n x n upper triangular matrix U where A = P'LU is the LU factorization of A = array1, an n x n matrix"
                  Attribute LUPFactorU.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' output the U of the LUP decomposition of the square array in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      ReDim barr(1 To n, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To n
                          For j = 1 To n
                              barr(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, barr(), indx(), iflag)
                      
                      If iflag = 1 Then
                          LUPFactorU = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      ' prepare output
                      ReDim outp(1 To n, 1 To n)
                      For j = 1 To n
                          ' upper triangular
                          For i = 1 To j
                              outp(i, j) = barr(i, j)
                          Next
                          For i = j + 1 To n
                              outp(i, j) = 0#
                          Next
                      Next
                      
                      LUPFactorU = outp
                            
                  End Function
                  
                  Function LUPFactorL(array1 As Variant) As Variant
                  Attribute LUPFactorL.VB_Description = "returns the n x n lower triangular matrix L where A = P'LU is the LU factorization of A = array1, an n x n matrix"
                  Attribute LUPFactorL.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' output the L of the LUP decomposition of the square array in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      ReDim barr(1 To n, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To n
                          For j = 1 To n
                              barr(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, barr(), indx(), iflag)
                      
                      If iflag = 1 Then
                          LUPFactorL = CVErr(xlErrNA)
                          Exit Function
                      End If
                          
                      ' prepare output
                      ReDim outp(1 To n, 1 To n)
                      For j = 1 To n
                          For i = 1 To j - 1
                              outp(i, j) = 0#
                          Next
                          outp(i, i) = 1#
                          For i = j + 1 To n
                              outp(i, j) = barr(i, j)
                          Next
                      Next
                      
                      LUPFactorL = outp
                            
                  End Function
                  
                  Function LUPFactorP(array1 As Variant) As Variant
                  Attribute LUPFactorP.VB_Description = "returns the n x n permutation matrix P where A = P'LU is the LU factorization of A = array1, an n x n matrix"
                  Attribute LUPFactorP.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' output the P of the LUP decomposition of the square array in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      ReDim barr(1 To n, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To n
                          For j = 1 To n
                              barr(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, barr(), indx(), iflag)
                      
                      If iflag = 1 Then
                          LUPFactorP = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      ' get real permutations
                      ReDim pindx(1 To 1, 1 To n) As Long
                      Dim temp As Long
                      For i = 1 To n
                          pindx(1, i) = i
                      Next
                      For i = 1 To n
                          If indx(i) > i Then
                              temp = pindx(1, i)
                              pindx(1, i) = pindx(1, indx(i))
                              pindx(1, indx(i)) = temp
                          End If
                      Next
                      
                      ' prepare output
                      ReDim outp(1 To n, 1 To n)
                      outp = MPERM(pindx)
                      LUPFactorP = outp
                            
                  End Function
                  
                  Function MPERM(vect As Variant) As Variant
                  Attribute MPERM.VB_Description = "returns the permutation matrix corresponding to vect"
                  Attribute MPERM.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' return permutation matrix for row vector vect
                  
                      Dim v As Variant
                      v = vect
                      Dim n As Long
                      n = UBound(v, 2)
                      Dim i As Long
                      Dim j As Long
                      ReDim outp(1 To n, 1 To n)
                      
                      For i = 1 To n
                          For j = 1 To n
                              outp(i, j) = 0#
                          Next
                          outp(i, vect(1, i)) = 1#
                      Next
                      MPERM = outp
                      
                  End Function
                  
                  ' Solving linear equations via backwards substitution
                  
                  Sub lubksb(n, aLU(), indx(), b())
                  ' input: square n x n matrix LU, which is the LU decomposition matrix output by ludcmp for some matrix A
                  ' indx is the permutation vector output by ludcmp for A. B is a vector of size n
                  ' output: B now contains the solution X to the equation AX = B
                  
                      Dim ii, i, k, tot, j
                      ii = 0
                      
                      For i = 1 To n
                          k = indx(i)
                          tot = b(k)
                          b(k) = b(i)
                          If ii <> 0 Then
                              For j = ii To i - 1
                                  tot = tot - aLU(i, j) * b(j)
                              Next j
                          ElseIf tot <> 0# Then
                              ii = i
                          End If
                          b(i) = tot
                      Next i
                      
                      For i = n To 1 Step -1
                          tot = b(i)
                          For j = i + 1 To n
                              tot = tot - aLU(i, j) * b(j)
                          Next j
                          b(i) = tot / aLU(i, i)
                      Next i
                  
                  End Sub
                  
                  Function LUSolve(aarray As Variant, carray As Variant) As Variant
                  Attribute LUSolve.VB_Description = "returns a column array with the solution to AX = C where A = aarray and C = carray using a LU factorization"
                  Attribute LUSolve.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' returns a column vector with the solution to AX = C where A = aarray and C = carray
                  
                      Dim barr As Variant
                      barr = carray
                      Dim n As Long
                      n = UBound(barr, 1)
                      Dim arr As Variant
                      arr = aarray
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      ReDim arra(1 To n, 1 To n)
                      ReDim arrb(1 To n)
                      For i = 1 To n
                          For j = 1 To n
                              arra(i, j) = arr(i, j)
                          Next
                          arrb(i) = barr(i, 1)
                      Next
                      
                      Call ludcmp(n, d, arra(), indx(), iflag)
                  
                      If iflag = 1 Then
                          LUSolve = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      Call lubksb(n, arra(), indx(), arrb())
                      
                      ReDim outp(1 To n, 1 To 1)
                      For i = 1 To n
                          outp(i, 1) = arrb(i)
                      Next
                  
                      LUSolve = outp
                      
                  End Function
                  
                  Function LUInverse(array1 As Variant) As Variant
                  Attribute LUInverse.VB_Description = "returns the inverse of array1 using a LU factorization"
                  Attribute LUInverse.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' returns the inverse of array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      ReDim a(1 To n, 1 To n)
                      For i = 1 To n
                          For j = 1 To n
                              a(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, a(), indx(), iflag)
                  
                      If iflag = 1 Then
                          LUInverse = CVErr(xlErrNA)
                          Exit Function
                      End If
                      
                      ReDim b(n)
                      ReDim outp(1 To n, 1 To n)
                      For j = 1 To n
                          For i = 1 To n
                              b(i) = 0#
                          Next
                          b(j) = 1#
                          Call lubksb(n, a(), indx(), b())
                          For i = 1 To n
                              outp(i, j) = b(i)
                          Next
                      Next
                  
                      LUInverse = outp
                      
                  End Function
                  
                  Function LUDet(array1 As Variant) As Double
                  Attribute LUDet.VB_Description = "returns the determinant of array1 using a LU factorization"
                  Attribute LUDet.VB_ProcData.VB_Invoke_Func = " \n23"
                  ' return the determinant of array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      
                      Dim d As Double
                      Dim iflag As Long
                      ReDim indx(1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      ReDim a(1 To n, 1 To n)
                      For i = 1 To n
                          For j = 1 To n
                              a(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call ludcmp(n, d, a(), indx(), iflag)
                  
                      If iflag = 1 Then
                          LUDet = 0#
                          Exit Function
                      End If
                      
                      For j = 1 To n
                          d = d * a(j, j)
                      Next
                      
                      LUDet = d
                  
                  End Function
                  
                  ' Hessenberg decomposition
                  
                  Function HESS(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  Attribute HESS.VB_Description = "returns the 2n x n array consisting of H over Q where A = QHQ' is the Hessenberg factorization of A = array1, an n x n matrix"
                  Attribute HESS.VB_ProcData.VB_Invoke_Func = " \n23"
                  
                      Dim arr As Variant
                      arr = array1
                      Dim k As Long
                      Dim j As Long
                      Dim n As Long
                      n = UBound(arr, 1)
                      Dim p As Variant
                      ReDim q(1 To n, 1 To n) As Variant
                      q = IDENTITY(n)
                      
                      For k = 1 To n - 2
                          Call sHess(arr, n, k, q, prec)
                      Next
                      
                      Dim outp As Variant
                      ReDim outp(1 To 2 * n, 1 To n)
                      For k = 1 To n
                          For j = 1 To n
                              outp(k, j) = arr(k, j)
                              outp(k + n, j) = q(k, j)
                          Next
                      Next
                      
                      HESS = outp
                      
                  End Function
                  
                  Sub sHess(a As Variant, n As Long, k As Long, q As Variant, prec As Double)
                  
                      Dim aerfa As Double
                      Dim r As Double
                      Dim i As Long
                      Dim j As Long
                      Dim tot As Double
                      ReDim v(1 To n) As Double
                      ReDim p(1 To n, 1 To n)
                      
                      tot = 0#
                      For i = k + 1 To n
                          tot = tot + a(i, k) ^ 2
                      Next
                      If tot <= prec Then Exit Sub
                      aerfa = Sqr(tot)
                      If a(k + 1, k) > 0 Then aerfa = -aerfa
                  '    aerfa = -Sgn(a(k + 1, k)) * Sqr(tot)
                      r = Sqr(0.5 * (aerfa ^ 2 - a(k + 1, k) * aerfa))
                      For i = 1 To k
                          v(i) = 0#
                      Next
                      v(k + 1) = (a(k + 1, k) - aerfa) / (2 * r)
                      For i = k + 2 To n
                          v(i) = a(i, k) / (2 * r)
                      Next
                      
                      For i = 1 To n
                          p(i, i) = 1# - 2 * v(i) ^ 2
                          For j = i + 1 To n
                              p(i, j) = -2 * v(i) * v(j)
                              p(j, i) = p(i, j)
                          Next
                      Next
                         
                      a = MPROD(p, a, p)
                      q = WorksheetFunction.MMult(q, p)
                      
                  End Sub
                  
                  Function HessH(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  Attribute HessH.VB_Description = "returns the n x n H array where A = QHQ' is the Hessenberg factorization of A = array1, an n x n matrix"
                  Attribute HessH.VB_ProcData.VB_Invoke_Func = " \n23"
                  
                      Dim arr As Variant
                      arr = array1
                      Dim k As Long
                      Dim j As Long
                      Dim n As Long
                      n = UBound(arr, 1)
                      Dim p As Variant
                      ReDim q(1 To n, 1 To n) As Variant
                      q = IDENTITY(n)
                      
                      For k = 1 To n - 2
                          Call sHessH(arr, n, k, prec)
                      Next
                      
                      HessH = arr
                      
                  End Function
                  
                  Sub sHessH(a As Variant, n As Long, k As Long, prec As Double)
                  
                      Dim aerfa As Double
                      Dim r As Double
                      Dim i As Long
                      Dim j As Long
                      Dim tot As Double
                      ReDim v(1 To n) As Double
                      ReDim p(1 To n, 1 To n)
                      
                      tot = 0#
                      For i = k + 1 To n
                          tot = tot + a(i, k) ^ 2
                      Next
                      If tot <= prec Then Exit Sub
                      aerfa = Sqr(tot)
                      If a(k + 1, k) > 0 Then aerfa = -aerfa
                  '    aerfa = -Sgn(a(k + 1, k)) * Sqr(tot)
                      r = Sqr(0.5 * (aerfa ^ 2 - a(k + 1, k) * aerfa))
                      For i = 1 To k
                          v(i) = 0#
                      Next
                      v(k + 1) = (a(k + 1, k) - aerfa) / (2 * r)
                      For i = k + 2 To n
                          v(i) = a(i, k) / (2 * r)
                      Next
                      
                      For i = 1 To n
                          p(i, i) = 1# - 2 * v(i) ^ 2
                          For j = i + 1 To n
                              p(i, j) = -2 * v(i) * v(j)
                              p(j, i) = p(i, j)
                          Next
                      Next
                         
                      a = MPROD(p, a, p)
                      
                  End Sub
                  
                  Function HessQ(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  Attribute HessQ.VB_Description = "returns the n x n Q array where A = QHQ' is the Hessenberg factorization of A = array1, an n x n matrix"
                  Attribute HessQ.VB_ProcData.VB_Invoke_Func = " \n23"
                  
                      Dim arr As Variant
                      arr = array1
                      Dim k As Long
                      Dim j As Long
                      Dim n As Long
                      n = UBound(arr, 1)
                      Dim p As Variant
                      ReDim q(1 To n, 1 To n) As Variant
                      q = IDENTITY(n)
                      
                      For k = 1 To n - 2
                          Call sHess(arr, n, k, q, prec)
                      Next
                      
                      HessQ = q
                      
                  End Function
                  
                  Sub elmhes(a(), n)
                  ' input: A is an n x n matrix
                  ' output: A has been converted to upper Hessenberg form
                  
                      Dim m, x, i, j, y
                      
                      For m = 2 To n - 1
                          x = 0#
                          i = m
                          For j = m To n
                              If Abs(a(j, m - 1)) > Abs(x) Then
                                  x = a(j, m - 1)
                                  i = j
                              End If
                          Next j
                      
                          If i <> m Then
                              For j = m - 1 To n
                                  Swap a(i, j), a(m, j)
                              Next j
                              For j = 1 To n
                                  Swap a(j, i), a(j, m)
                              Next j
                          End If
                      
                          If (x <> 0#) Then
                              For i = m + 1 To n
                                  y = a(i, m - 1)
                                  If y <> 0# Then
                                      y = y / x
                                      a(i, m - 1) = y
                                      For j = m To n
                                          a(i, j) = a(i, j) - y * a(m, j)
                                      Next j
                                      For j = 1 To n
                                          a(j, m) = a(j, m) + y * a(j, i)
                                      Next j
                                  End If
                              Next i
                          End If
                      Next m
                      
                  End Sub
                  
                  Private Function UpperHess(array1 As Variant) As Variant
                  ' output the upper Hessenberg form of array1
                  ' if array1 is symmetric, the output won't necessarily be tridiagonal
                  
                      Dim arr As Variant
                      arr = array1
                      Dim n As Long
                      n = UBound(arr, 1)
                      ReDim barr(1 To n, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      For i = 1 To n
                          For j = 1 To n
                              barr(i, j) = arr(i, j)
                          Next
                      Next
                      
                      Call elmhes(barr, n)
                          
                      For j = 1 To n - 2
                          For i = j + 2 To n
                              barr(i, j) = 0#
                          Next
                      Next
                      
                      UpperHess = barr
                      
                  End Function
                  
                  ' Eigenvalues
                  
                  Sub hqr(a(), n, wr(), wi())
                  ' input: A is an n x n upper Hessenberg matrix
                  ' output: wr contains real part of eigenvalues; wi contains imaginary part of eigenvalues; A is distroyed
                      
                      Dim anorm, i, j, k, nn, t, its, L, s, x
                      Dim y, p, q, z, r, m, u, v, w, mmin
                      
                      anorm = Abs(a(1, 1))
                      
                      For i = 2 To n
                          For j = i - 1 To n
                              anorm = anorm + Abs(a(i, j))
                          Next j
                      Next i
                      
                      nn = n
                      t = 0#
                      
                      While (nn >= 1)
                          its = 0
                          Do
                              For L = nn To 2 Step -1
                                  s = Abs(a(L - 1, L - 1)) + Abs(a(L, L))
                                  If s = 0# Then s = anorm
                                  If (Abs(a(L, L - 1)) + s) = s Then Exit For
                              Next L
                              x = a(nn, nn)
                              If L = nn Then
                                  wr(nn) = x + t
                                  nn = nn - 1
                                  wi(nn) = 0#
                              Else
                                  y = a(nn - 1, nn - 1)
                                  w = a(nn, nn - 1) * a(nn - 1, nn)
                                  If L = nn - 1 Then
                                      p = 0.5 * (y - x)
                                      q = p * p + w
                                      z = Sqr(Abs(q))
                                      x = x + t
                                      If q >= 0# Then
                                          z = p + ASign(z, p)
                                          wr(nn) = x + z
                                          wr(nn - 1) = wr(nn)
                                          If z <> 0# Then wr(nn) = x - w / z
                                          wi(nn) = 0#
                                          wi(nn - 1) = 0#
                                      Else
                                          wr(nn) = x + p
                                          wr(nn - 1) = wr(nn)
                                          wi(nn) = z
                                          wi(nn - 1) = -z
                                      End If
                                      nn = nn - 2
                                  Else
                                      If its = 30 Then
                                          'Print "Too many iterations in HQR"
                                          Stop
                                      End If
                                      If its = 10 Or its = 20 Then
                                          t = t + x
                                          For i = 1 To nn
                                              a(i, i) = a(i, i) - x
                                          Next i
                                          s = Abs(a(nn, nn - 1)) + Abs(a(nn - 1, nn - 2))
                                          x = 0.75 * s
                                          y = x
                                          w = -0.4375 * s * s
                                      End If
                                      its = its + 1
                                      For m = nn - 2 To 1 Step -1
                                          z = a(m, m)
                                          r = x - z
                                          s = y - z
                                          p = (r * s - w) / a(m + 1, m) + a(m, m + 1)
                                          q = a(m + 1, m + 1) - z - r - s
                                          r = a(m + 2, m + 1)
                                          s = Abs(p) + Abs(q) + Abs(r)
                                          p = p / s
                                          q = q / s
                                          r = r / s
                                          If m = 

                  General
                  Stream Path:VBA/EigenOld
                  VBA File Name:EigenOld
                  Stream Size:23168
                  Data ASCII:. . . . . . . . B . . . . . . . . . I . . . G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
                  Data Raw:01 16 03 00 01 f0 00 00 00 42 10 00 00 d4 00 00 00 88 01 00 00 ff ff ff ff 49 10 00 00 e1 47 00 00 00 00 00 00 01 00 00 00 d4 1f c2 81 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "EigenOld"
                  Private Sub kQR(q As Variant, r As Variant, a As Variant, Optional prec As Double = 0#)
                  ' find matrices q and r such that a = qr; assumes a is a square matrix
                  '    q = QRFactorQX(a, prec)
                  '    r = QRFactorRX(a, prec)
                      q = QRDecompQ(a, prec)
                      r = QRDecompR(a, prec)
                  End Sub
                  
                  Private Function fEigen(a As Variant, iter As Variant, order As Boolean, shiftval As Double, Optional check As Boolean = True) As Variant
                  ' return list of eigenvalues/vectors of matrix a using QR decomposition (row 1); assumes matrix a is square; used by eVECTOR
                  ' if order = TRUE, eigenvalues are in sorted order from highest in absolute value to lowest in absolute value
                  ' otherwise, eigenvalues are in sorted order from highest value to lowest value; add shftval to eigenvalues
                  ' also return list of the values det(A-cI) where c is any eigenvalue (second to last row)
                  ' also return list of maximum difference between the rows in AX and cX for any eigenvalue/vector pair c and X
                  
                      On Error GoTo ErrTrap
                      Dim ecode As Long       ' error code (makes sure that only an kQR error is handled)
                      ecode = 10
                  
                      Dim i As Long           ' index
                      Dim j As Long           ' index
                      Dim n As Long           ' # of columns in a
                      n = UBound(a, 2)
                      Dim q As Variant        ' Q in QR factorization of A
                      ReDim q(1 To n, 1 To n)
                      Dim r As Variant        ' R in QR factorization of A
                      ReDim r(1 To n, 1 To n)
                      Dim vector As Variant   ' used to sort eigenvalues; really a matrix
                      ReDim vector(1 To n, 1 To n + 2)
                      Dim matrix As Variant   ' output
                      ReDim matrix(1 To n + 3, 1 To n)
                      
                      Dim aa As Variant       ' copy of a
                      ReDim aa(1 To n, 1 To n)
                      For i = 1 To n
                          For j = 1 To n
                              aa(i, j) = a(i, j)
                          Next
                          aa(i, i) = a(i, i) + shiftval
                      Next
                      
                      ' initiate qq as identity matrix
                      Dim qq As Variant
                      ReDim qq(1 To n, 1 To n)
                      For i = 1 To n
                          For j = 1 To n
                              qq(i, j) = 0
                          Next
                          qq(i, i) = 1
                      Next
                          
                      ' iteration
                      ecode = 0
                  '    Dim shft As Double
                      For i = 1 To iter
                  '        shft = aa(n, n)
                  '        For j = 1 To n
                  '            aa(j, j) = aa(j, j) - shft
                  '        Next
                          Call kQR(q, r, aa)
                          ecode = 10
                          aa = Application.WorksheetFunction.MMult(r, q)
                          qq = Application.WorksheetFunction.MMult(qq, q)
                  '        For j = 1 To n
                  '            aa(j, j) = aa(j, j) + shft
                  '        Next
                      Next
                      
                      ' get first row of output
                      If order Then
                          For i = 1 To n
                              vector(i, 1) = -Abs(aa(i, i) - shiftval)
                              vector(i, 2) = aa(i, i) - shiftval
                              For j = 1 To n
                                  vector(i, j + 2) = qq(j, i)
                              Next
                          Next
                      Else
                          For i = 1 To n
                              vector(i, 1) = -aa(i, i)    ' not necessary to subtract shiftval (doesn't change order)
                              vector(i, 2) = aa(i, i) - shiftval
                              For j = 1 To n
                                  vector(i, j + 2) = qq(j, i)
                              Next
                          Next
                      End If
                      
                      Call sQSortRows(vector, 1)
                      
                      ' create first n+1 rows of output and put A-cI in aa
                      For j = 1 To n
                          matrix(1, j) = vector(j, 2)
                          For i = 1 To n
                              aa(i, j) = a(i, j)   ' reuse aa to be A-cI
                              qq(i, j) = vector(j, i + 2)
                              matrix(i + 1, j) = qq(i, j)
                          Next
                      Next
                  
                      If check Then   ' skip if check = False
                      
                      ' get second to last row of output (with determinants)
                      For j = 1 To n
                          For i = 1 To n
                              aa(i, i) = a(i, i) - vector(j, 2)
                          Next
                          matrix(n + 2, j) = Application.WorksheetFunction.MDeterm(aa)
                      Next
                      
                      ' get last row of output (reuse aa as AX)
                      aa = Application.WorksheetFunction.MMult(a, qq)
                      Dim temp As Double
                      Dim temp1 As Double
                      For j = 1 To n
                          temp = 0#
                          For i = 1 To n
                              temp1 = Abs(aa(i, j) - matrix(1, j) * qq(i, j))
                              If temp1 > temp Then temp = temp1
                          Next
                          matrix(n + 3, j) = temp
                      Next
                      
                      End If
                              
                      fEigen = matrix
                      
                  Exit Function
                  
                  ErrTrap:
                      If ecode <= 2 Then      ' only corrects a kQR error (3 chances to do so)
                          shft = shft + 1
                          ecode = ecode + 1
                          For j = 1 To n
                              aa(j, j) = aa(j, j) - 1
                          Next
                          Resume
                      End If
                   
                  End Function
                  
                  Private Function eVECTOR(array1 As Variant, Optional iter As Variant = 500, Optional order As Boolean = True, Optional check As Boolean = True) As Variant
                  ' return a list eigenvalues of the square matrix in array1; below each eigenvalue is the corresponding unit eigenvector
                  ' if order = TRUE, eigenvalues are in sorted order from highest in absolute value to lowest in absolute value
                  ' otherwise, eigenvalues are in sorted order from highest value to lowest value
                  ' using QR method; if array1 is n x n the output is (n+3) x n
                  ' also check which gives a better answer A or A+bI where b = element with maximum abs value in A
                  ' if iter < 0 then use -iter number of iterations and don't use shifts
                  
                      Dim a As Variant
                      a = array1
                      Dim mx As Double    ' max value in a
                      Dim mn As Double    ' min value in a
                      Dim i As Long
                      Dim j As Long
                      Dim n As Long       ' # cols in array1 (= # of rows in array1)
                      Dim e1 As Variant   ' potential output 1
                      Dim e2 As Variant   ' potential output 2
                      Dim mx1 As Double   ' max of second row of e1
                      Dim mx2 As Double   ' max of second row of e2
                      Dim ecode As Long   ' used in case of error, 1 if e1 gives error, 2 if e2 gives error
                      
                      On Error GoTo ErrTrap
                      
                      ecode = 0
                      If iter < 0 Then
                          eVECTOR = fEigen(a, -iter, order, 0#, check)
                      Else
                          mx = Application.WorksheetFunction.Max(a)
                          mn = Application.WorksheetFunction.Min(a)
                          If -mn > mx Then mx = mn
                          n = UBound(a, 2)
                          ReDim e1(1 To n + 3, 1 To n)
                          ReDim e2(1 To n + 3, 1 To n)
                          ecode = 1
                          e1 = fEigen(a, iter, order, 0#, check)
                          ecode = 2
                          e2 = fEigen(a, iter, order, mx, check)
                          mx1 = -1#
                          mx2 = -1#
                          For j = 1 To n
                              If e1(n + 2, j) > mx1 Then mx1 = e1(2, j)
                              If e2(n + 2, j) > mx2 Then mx2 = e2(2, j)
                          Next
                          If mx1 <= mx2 Then
                              eVECTOR = e1
                          Else
                              eVECTOR = e2
                          End If
                      End If
                      
                  Exit Function
                  ErrTrap:
                      If ecode = 0 Then
                          eVECTOR = CVErr(xlErrNA)
                      ElseIf ecode = 1 Then
                          e2 = fEigen(a, iter, order, mx, check)
                          ecode = 0
                          eVECTOR = e2
                      Else
                          ecode = 0
                          eVECTOR = e1
                      End If
                      
                  End Function
                  
                  Private Function QRDecompR(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  ' return R for a square matrix
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim jj As Long
                      Dim v As Variant
                      ReDim v(1 To m, 1 To 1)
                      Dim w As Variant
                      ReDim w(1 To m, 1 To 1)
                      Dim d As Double
                      Dim s As Double
                      Dim p As Variant
                      ReDim p(1 To m, 1 To n)
                      
                      With Application.WorksheetFunction
                      For j = 1 To n - 1
                          For i = 1 To m
                              v(i, 1) = arr(i, j)
                          Next
                          d = Sqr(.SumSq(v))
                          If d <= prec Then GoTo continue
                          For i = 1 To m
                              v(i, 1) = v(i, 1) / d
                          Next
                          d = 0#
                          For i = j To m
                              d = d + v(i, 1) ^ 2
                          Next
                          d = Sqr(d)
                          If d <= prec Then GoTo continue
                          If v(j, 1) > 0 Then d = -d
                          For i = 1 To j - 1
                              v(i, 1) = 0#
                              w(i, 1) = 0#
                          Next
                          v(j, 1) = Sqr((1 - v(j, 1) / d) / 2)
                          w(j, 1) = -2 * v(j, 1)
                          s = -2 * d * v(j, 1)
                          For i = j + 1 To m
                              v(i, 1) = v(i, 1) / s
                              w(i, 1) = -2 * v(i, 1)
                          Next
                          p = .MMult(w, .Transpose(v))
                          For i = 1 To n
                              p(i, i) = p(i, i) + 1#
                          Next
                          arr = .MMult(p, arr)
                  continue:
                      Next
                      End With
                      
                      QRDecompR = arr
                      
                  End Function
                  
                  Private Function QRDecompQ(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  ' return Q for a square matrix
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim jj As Long
                      Dim v As Variant
                      ReDim v(1 To m, 1 To 1)
                      Dim w As Variant
                      ReDim w(1 To m, 1 To 1)
                      Dim d As Double
                      Dim s As Double
                      Dim p As Variant
                      ReDim p(1 To m, 1 To n)
                      Dim q As Variant
                      ReDim q(1 To m, 1 To m)
                      q = IDENTITY(m)
                      
                      With Application.WorksheetFunction
                      For j = 1 To n - 1
                          For i = 1 To m
                              v(i, 1) = arr(i, j)
                          Next
                          d = Sqr(.SumSq(v))
                          If d <= prec Then GoTo continue
                          For i = 1 To m
                              v(i, 1) = v(i, 1) / d
                          Next
                          d = 0#
                          For i = j To m
                              d = d + v(i, 1) ^ 2
                          Next
                          d = Sqr(d)
                          If d <= prec Then GoTo continue
                          If v(j, 1) > 0 Then d = -d
                          For i = 1 To j - 1
                              v(i, 1) = 0#
                              w(i, 1) = 0#
                          Next
                          v(j, 1) = Sqr((1 - v(j, 1) / d) / 2)
                          w(j, 1) = -2 * v(j, 1)
                          s = -2 * d * v(j, 1)
                          For i = j + 1 To m
                              v(i, 1) = v(i, 1) / s
                              w(i, 1) = -2 * v(i, 1)
                          Next
                          p = .MMult(w, .Transpose(v))
                          For i = 1 To m
                              p(i, i) = p(i, i) + 1#
                          Next
                          arr = .MMult(p, arr)
                          q = .MMult(q, p)
                  continue:
                      Next
                      End With
                      
                      QRDecompQ = q
                      
                  End Function
                  
                  Private Function QRDecomp(array1 As Variant, Optional prec As Double = 0.000000000001) As Variant
                  ' return Q over R for a square matrix
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim jj As Long
                      Dim v As Variant
                      ReDim v(1 To m, 1 To 1)
                      Dim w As Variant
                      ReDim w(1 To m, 1 To 1)
                      Dim d As Double
                      Dim s As Double
                      Dim p As Variant
                      ReDim p(1 To m, 1 To n)
                      Dim q As Variant
                      ReDim q(1 To m, 1 To m)
                      q = IDENTITY(m)
                      
                      With Application.WorksheetFunction
                      For j = 1 To n - 1
                          For i = 1 To m
                              v(i, 1) = arr(i, j)
                          Next
                          d = Sqr(.SumSq(v))
                          If d <= prec Then GoTo continue
                          For i = 1 To m
                              v(i, 1) = v(i, 1) / d
                          Next
                          d = 0#
                          For i = j To m
                              d = d + v(i, 1) ^ 2
                          Next
                          d = Sqr(d)
                          If d <= prec Then GoTo continue
                          If v(j, 1) > 0 Then d = -d
                          For i = 1 To j - 1
                              v(i, 1) = 0#
                              w(i, 1) = 0#
                          Next
                          v(j, 1) = Sqr((1 - v(j, 1) / d) / 2)
                          w(j, 1) = -2 * v(j, 1)
                          s = -2 * d * v(j, 1)
                          For i = j + 1 To m
                              v(i, 1) = v(i, 1) / s
                              w(i, 1) = -2 * v(i, 1)
                          Next
                          p = .MMult(w, .Transpose(v))
                          For i = 1 To m
                              p(i, i) = p(i, i) + 1#
                          Next
                          arr = .MMult(p, arr)
                          q = .MMult(q, p)
                  continue:
                      Next
                      End With
                      
                      Dim outp As Variant
                      ReDim outp(1 To m, 1 To m + n)
                      For i = 1 To m
                          For j = 1 To m
                              outp(i, j) = q(i, j)
                          Next
                          For j = 1 To n
                              outp(i, j + m) = arr(i, j)
                          Next
                      Next
                      
                      QRDecomp = outp
                      
                  End Function
                  

                  General
                  Stream Path:VBA/FactorAnalysis
                  VBA File Name:FactorAnalysis
                  Stream Size:100166
                  Data ASCII:. . . . . . . . I . . . . . . . . I . . e / . . # . . . . . . . . } . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . h . . . . . P G . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 92 49 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff d5 49 00 00 65 2f 01 00 23 00 00 00 01 00 00 00 d4 1f c6 7d 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "FactorAnalysis"
                  ' Perform Factor Analysis
                  
                  Sub RunFactor(rg As Range, ce As Range, nFactors As Long, okPC As Boolean, okHeading As Boolean, okVarimax As Boolean,     nExtract As String, nVarimax As String, nEigen As String)
                  ' carry out factor analysis
                      If okPC Then
                          Call RunFactorPC(rg, ce, nFactors, okHeading, okVarimax, nVarimax, nEigen)
                      Else
                          Call RunFactorPA(rg, ce, nFactors, okHeading, okVarimax, nExtract, nVarimax, nEigen)
                      End If
                  End Sub
                  
                  ' Perform Factor Analysis - Principal Component Extraction
                  
                  Sub RunFactorPC(rg As Range, ce As Range, nFactors As Long, okHeading As Boolean, okVarimax As Boolean,     nVarimax As String, nEigen As String)
                  ' carry out factor analysis using principal component extraction
                      
                      Dim n As Long       ' number of factors
                      Dim ce0 As Range    ' initial location cell
                      Dim rg0 As Range    ' data range
                      Dim cex As Range    ' next location cell
                      
                      Dim rg1 As Range    ' correlation matrix
                      Dim rg2 As Range    ' eigen matrix
                      Dim rg3 As Range    ' full load matrix
                      Dim rg4 As Range    ' factor matrix (reduced load matrix)
                      Dim rg5 As Range    ' rotated factor matrix (Varimax)
                      Dim rg6 As Range    ' reproduced correlation matrix
                      Dim rg7 As Range    ' error matrix
                      
                      Dim rga As Range    ' inverse of correlation matrix
                      Dim rgb As Range    ' sqrt of diagonal of inverse of corr matrix
                      Dim rgc As Range    ' partial correlation matrix
                      Dim rgd As Range    ' KMO
                      Dim rge As Range    ' Factor score matrix
                      Dim rgf As Range    ' sum of squares of columns in partial correlation matrix
                      Dim rgg As Range    ' sum of squares of columns in correlation matrix
                      Dim rgh As Range    ' specific variance for factor matrix
                      
                      On Error GoTo errorHandler
                      
                      Set ce0 = ce
                      ce0.Value = "Factor Analysis - Principal Component Extraction"
                      Call DisplayDesc(rg, ce.Offset(2, 0), okHeading)
                      Call DisplayCorrMatrix(rg, ce.Offset(10, 0), okHeading, rg1, rgg, cex)
                      
                      Set ce0 = cex
                      Call DisplayInverseCorrMatrix(rg, rg1, ce0, okHeading, rga, rgb, cex)
                      
                      Set ce0 = cex
                      Call DisplayPartialCorrMatrix(rg, rga, rgb, ce0, okHeading, rgc, rgf, cex)
                      
                      Set ce0 = cex
                      Call DisplayKMO(rg, rgg, rgf, ce0, okHeading, rgd, cex)
                  
                      Set ce0 = cex
                      Call DisplayEigenMatrix(rg1, ce0, rg2, cex, nEigen)
                      
                      Call GetFactorCount(rg2, nFactors)
                      
                      Set ce0 = cex
                      Call DisplayLoadMatrix(rg, rg2, ce0, okHeading, rg3, cex)
                      
                      Set ce0 = cex
                      Call DisplayScree(rg2, ce0, cex)
                      
                      Set ce0 = cex
                      Call DisplayFactorMatrix(rg, rg3, ce0, nFactors, okHeading, rg4, rgh, cex)
                      
                      Set ce0 = cex
                      Call DisplayVarimax(rg, rg4, ce0, nFactors, okHeading, rg5, cex, nVarimax)
                      
                      Set ce0 = cex
                      Call DisplayReproducedCorrMatrix(rg, rg4, ce0, okHeading, rg6, cex)
                      
                      Set ce0 = cex
                      Call DisplayErrorMatrix(rg, rg1, rg6, ce0, okHeading, rg7, cex)
                      
                      Set ce0 = cex
                      If okVarimax Then
                          Call DisplayFScoreReg(rg, rg5, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreBart(rg, rg5, rgh, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreAR(rg, rg1, rg5, rgh, ce0, okHeading, rge, cex)
                      Else
                          Call DisplayFScoreReg(rg, rg4, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreBart(rg, rg4, rgh, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreAR(rg, rg1, rg4, rgh, ce0, okHeading, rge, cex)
                      End If
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                     
                  End Sub
                  
                  ' Perform Factor Analysis - Principal Axis Extraction
                  
                  Sub RunFactorPA(rg As Range, ce As Range, nFactors As Long, okHeading As Boolean, okVarimax As Boolean,     nExtract As String, nVarimax As String, nEigen As String)
                  ' carry out factor analysis using principal axis extraction
                      
                      Dim n As Long       ' number of factors
                      Dim ce0 As Range    ' initial location cell
                      Dim rg0 As Range    ' data range
                      Dim cex As Range    ' next location cell
                      
                      Dim rg1 As Range    ' correlation matrix
                      Dim rg2 As Range    ' eigen matrix
                      Dim rg3 As Range    ' full load matrix
                      Dim rg4 As Range    ' factor matrix (reduced load matrix)
                      Dim rg5 As Range    ' rotated factor matrix (Varimax)
                      Dim rg6 As Range    ' reproduced correlation matrix
                      Dim rg7 As Range    ' error matrix
                      
                      Dim rga As Range    ' inverse of correlation matrix
                      Dim rgb As Range    ' sqrt of diagonal of inverse of corr matrix
                      Dim rgc As Range    ' partial correlation matrix
                      Dim rgd As Range    ' KMO
                      Dim rge As Range    ' Factor score matrix
                      Dim rgf As Range    ' sum of squares of columns in partial correlation matrix
                      Dim rgg As Range    ' sum of squares of columns in correlation matrix
                      Dim rgh As Range    ' specific variance for factor matrix
                      
                      Dim rgi As Range    ' initial communalities
                      Dim rgj As Range    ' revised communalities (iterated)
                      Dim rgk As Range    ' revised correlation matrix
                      Dim rgm As Range    ' revised full load matrix
                      Dim rgn As Range    ' revised eigen matrix
                      
                      On Error GoTo errorHandler
                      
                      Set ce0 = ce
                      ce0.Value = "Factor Analysis - Principal Axis Extraction"
                      Call DisplayDesc(rg, ce.Offset(2, 0), okHeading)
                      Call DisplayCorrMatrix(rg, ce.Offset(10, 0), okHeading, rg1, rgg, cex)
                      
                      Set ce0 = cex
                      Call DisplayInverseCorrMatrix(rg, rg1, ce0, okHeading, rga, rgb, cex)
                      
                      Set ce0 = cex
                      Call DisplayPartialCorrMatrix(rg, rga, rgb, ce0, okHeading, rgc, rgf, cex)
                      
                      Set ce0 = cex
                      Call DisplayKMO(rg, rgg, rgf, ce0, okHeading, rgd, cex)
                      
                      Set ce0 = cex
                      Call DisplayEigenMatrix(rg1, ce0, rg2, cex, nEigen)
                      
                      Set ce0 = cex
                      Call DisplayLoadMatrix(rg, rg2, ce0, okHeading, rg3, cex)
                          
                      Set ce0 = cex
                      Call DisplayInitialCommunalities(rg, rga, ce0, okHeading, rgi, cex)
                      
                      Set ce0 = cex
                      Call DisplayCommunalities(rg, rg1, ce0, okHeading, rgj, cex, nExtract, nEigen)
                      
                      If IsError(rgj.Cells(1, 1).Value) Then
                          ce1.Offset(cex, 0).Value = "*** Extraction failed to converge...terminating analysis"
                          Exit Sub
                      End If
                      
                      Set ce0 = cex
                      Call DisplayRevisedCorrMatrix(rg, rg1, rgj, ce0, okHeading, rgk, cex)
                      
                      Set ce0 = cex
                      Call DisplayEigenMatrix(rgk, ce0, rgn, cex, nEigen)
                      
                      Call GetFactorCount(rg2, nFactors)
                      
                      Set ce0 = cex
                      Call DisplayLoadMatrix(rg, rgn, ce0, okHeading, rgm, cex)
                          
                      Set ce0 = cex
                      Call DisplayScree(rgn, ce0, cex)
                      
                      Set ce0 = cex
                      Call DisplayFactorMatrix(rg, rgm, ce0, nFactors, okHeading, rg4, rgh, cex)
                      
                      Set ce0 = cex
                      Call DisplayVarimax(rg, rg4, ce0, nFactors, okHeading, rg5, cex, nVarimax)
                      
                      Set ce0 = cex
                      Call DisplayReproducedCorrMatrix(rg, rg4, ce0, okHeading, rg6, cex)
                      
                      Set ce0 = cex
                      Call DisplayErrorMatrix(rg, rg1, rg6, ce0, okHeading, rg7, cex)
                      
                      Set ce0 = cex
                      If okVarimax Then
                          Call DisplayFScoreReg(rg, rg5, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreBart(rg, rg5, rgh, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreAR(rg, rg1, rg5, rgh, ce0, okHeading, rge, cex)
                      Else
                          Call DisplayFScoreReg(rg, rg4, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreBart(rg, rg4, rgh, ce0, okHeading, rge, cex)
                          Set ce0 = cex
                          Call DisplayFScoreAR(rg, rg1, rg4, rgh, ce0, okHeading, rge, cex)
                      End If
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                     
                  End Sub
                  
                  ' Display
                  
                  Sub DisplayDesc(rg As Range, ce As Range, okHeading As Boolean)
                  ' place some  derived from matrix rg at location ce; cend = next location
                  
                      On Error GoTo errorHandler
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                  
                      Dim m As Long
                      Dim n As Long
                      m = rg.Rows.Count
                      n = rg.Columns.Count
                  
                      ce.Value = ""
                      Dim ce1 As Range
                      Set ce1 = ce.Offset(2, 0)
                      
                      ' data matrix and headings
                      Dim rg0 As Range    ' first column of data sample
                      If okHeading Then
                          Call DisplayDataHeadings(rg, ce1, 1)
                          Set rg0 = rg.Cells(2, 1).Resize(m - 1, 1)
                      Else
                          Call SeqRow(ce1.Offset(0, 1), n)
                          Set rg0 = rg.Cells(1, 1).Resize(m, 1)
                      End If
                  
                      ' display descriptive stats
                      ce1.Offset(1, 0).Value = "Mean"
                      ce1.Offset(1, 1).Formula = "=AVERAGE(" & s & rg0.Address(False, False) & ")"
                      ce1.Offset(2, 0).Value = "Std dev"
                      ce1.Offset(2, 1).Formula = "=STDEV.S(" & s & rg0.Address(False, False) & ")"
                      ce1.Offset(3, 0).Value = "Skewness"
                      ce1.Offset(3, 1).Formula = "=SKEW(" & s & rg0.Address(False, False) & ")"
                      ce1.Offset(4, 0).Value = "Kurtosis"
                      ce1.Offset(4, 1).Formula = "=KURT(" & s & rg0.Address(False, False) & ")"
                      
                      Dim rg2 As Range    ' output
                      Set rg2 = ce1.Offset(1, 1).Resize(4, n)
                      If n > 1 Then rg2.FillRight
                      rg2.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      
                  End Sub
                  
                  ' Display headings (taken from data file)
                  
                  Sub DisplayDataHeadings(rg As Range, ce As Range, Optional b As Long = 0)
                  ' display headings taken from column heading of rg
                  ' if b < 0 only show vertical headings, if b > 0 only show horizontal headings, if b = 0 show both
                  
                      On Error GoTo errorHandler
                  
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                  
                      Dim n As Long
                      n = rg.Columns.Count
                          
                      ' data matrix and headings
                      Dim rg1 As Range    ' heading in input
                      Dim rg2 As Range    ' horizontal heading in output
                      Dim rg3 As Range    ' vertical heading in output
                      Set rg1 = rg.Cells(1, 1).Resize(1, n)
                  
                      If b >= 0 Then
                          Set rg2 = ce.Offset(0, 1).Resize(1, n)
                          rg2.FormulaArray = "=" & s & rg1.Address(False, False)
                      End If
                      
                      If b <= 0 Then
                          Set rg3 = ce.Offset(1, 0).Resize(n, 1)
                          rg3.FormulaArray = "=TRANSPOSE(" & s & rg1.Address(False, False) & ")"
                      End If
                          
                  Exit Sub
                  
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  ' Display correlation matrix
                  
                  Sub DisplayCorrMatrix(rg As Range, ce As Range, okHeading As Boolean, ByRef rgx As Range, ByRef rgy As Range, ByRef cex As Range)
                  ' place the correlation matrix derived from matrix rg at location ce; cex = next location
                  
                      On Error GoTo errorHandler
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                  
                      Dim m As Long
                      Dim n As Long
                      m = rg.Rows.Count
                      n = rg.Columns.Count
                      
                      ce.Value = "Correlation Matrix"
                      Dim ce1 As Range
                      Set ce1 = ce.Offset(2, 0)
                      
                      ' data matrix and headings
                      Dim rg0 As Range    ' data sample
                      If okHeading Then
                          Call DisplayDataHeadings(rg, ce1)
                          Set rg0 = rg.Cells(2, 1).Resize(m - 1, n)
                      Else
                          Call SeqRow(ce1.Offset(0, 1), n)
                          Call SeqColumn(ce1.Offset(1, 0), n)
                          Set rg0 = rg
                      End If
                          
                      ' display correlation matrix: n x n matrix where n = rg.Columns.Count, starting at ce.Offset(1,1)
                      Set rgx = ce1.Offset(1, 1).Resize(n, n)
                      rgx.FormulaArray = "=CORR(" & s & rg0.Address(False, False) & ")"
                      rgx.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      ' display sum of squares of columns
                      Dim rg1 As Range
                      Set rg1 = rgx.Cells(1, 1).Resize(n, 1)
                      Set rgy = ce1.Offset(n + 1, 1).Resize(1, n)
                      ce1.Offset(n + 1, 1).Formula = "=SUMSQ(" & rg1.Address(False, False) & ")-1"
                      If n > 1 Then rgy.FillRight
                      Call SetFormula(ce1.Offset(n + 1, n + 1), "SUM", rgy)
                      
                      Set cex = ce1.Offset(n + 3, 0)
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  ' Display eigenvalues and eigenvectors
                  
                  Sub DisplayEigenMatrix(rg As Range, ce As Range, ByRef rgx As Range, ByRef cex As Range, nEigen As String)
                  ' display eigenvalues and eigenvectors for rg starting at cell ce
                  
                      Dim rg1 As Range
                      Dim n As Long
                      
                      On Error GoTo errorHandler
                      
                      n = rg.Columns.Count
                      ce.Value = "Eigenvalues and eigenvectors"
                      Set rgx = ce.Offset(2, 1).Resize(n + 1, n)
                      rgx.FormulaArray = "=eVectors(" & rg.Address(False, False) & "," & nEigen & ",False)"
                      rgx.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Set rg1 = ce.Offset(2, 1).Resize(1, n)
                      rg1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Set cex = ce.Offset(n + 4, 0)
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  ' Determine number of factors
                  
                  Sub GetFactorCount(rg2 As Range, ByRef nFactors)
                  ' return number of factors to extract; if nFactors > 0 and nFactors > n where n = # of variables, then just use this amount,
                  ' otherwise use # of eigenvalues >= 1
                      Dim n As Long
                      n = rg2.Columns.Count
                      If nFactors <= 0 Or nFactors > n Then
                          nFactors = 0
                          For i = 1 To n
                              If rg2.Cells(1, i) >= 1 Then
                                  nFactors = nFactors + 1
                              Else
                                  Exit For
                              End If
                          Next
                      End If
                  End Sub
                  
                  ' Loading/factor matrix
                  
                  Private Function FactorMatrix(rg As Variant, Optional k As Long = 0) As Variant
                  ' return factor loading matrix for eigenvalues and eigenvectors found in rg
                  ' return at most k factors; if k is not positive, return laodings for all factors
                      Dim matrix As Variant
                      matrix = rg
                      Dim m As Long
                      Dim n As Long
                      m = UBound(matrix, 1)
                      n = UBound(matrix, 2)
                      Dim nn As Long
                      If k > n Or k <= 0 Then k = n
                      Dim matrix1 As Variant
                      ReDim matrix1(1 To m - 1, 1 To k)
                      Dim i As Long
                      Dim j As Long
                      Dim temp As Double
                      For j = 1 To k
                          temp = Sqr(matrix(1, j))
                          For i = 1 To m - 1
                              matrix1(i, j) = temp * matrix(i, j)
                          Next
                      Next
                      FactorMatrix = matrix1
                  End Function
                  
                  Sub DisplayLoadMatrix(rg0 As Range, rg As Range, ce As Range, okHeading As Boolean, ByRef rgx As Range, ByRef cex As Range)
                  ' display full loading matrix for rg (eigen values/vectors) starting at cell ce, rg0 contains original data and headings
                  
                      On Error GoTo errorHandler
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg0.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg0.Worksheet.Name & "'!"
                  
                      Dim rg1 As Range
                      Dim rg2 As Range
                      Dim rg3 As Range
                      Dim m As Long
                      m = rg.Rows.Count   ' m should be equal to n + 1
                      Dim n As Long
                      n = rg.Columns.Count
                      Set rg2 = rg.Cells(1, 1).Resize(1, n)
                      Set rg3 = rg.Cells(2, 1).Resize(m - 1, n)
                      
                      ce.Value = "Full Load Matrix"
                  
                      Call SeqRow(ce.Offset(2, 1), n)
                      ce.Offset(2, n + 2).Value = "Commun"
                      Set rgx = ce.Offset(3, 1).Resize(n, n)
                      rgx.FormulaArray = "=" & rg3.Address(False, False) & "*SQRT(ABS(" & rg2.Address(False, False) & "))"
                      rgx.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      
                      Dim rg6 As Range
                      Set rg1 = ce.Offset(3, n + 2).Resize(m - 1, 1)
                      Set rg6 = rgx.Cells(1, 1).Resize(1, n)
                      ce.Offset(3, n + 2).Formula = "=SUMSQ(" & rg6.Address(False, False) & ")"
                      If m > 2 Then rg1.FillDown
                      rg1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Set cex = ce.Offset(n + 4, 0)
                      
                      ' row headings
                      Dim rg5 As Range    ' heading in input
                      Dim rg4 As Range    ' vertical heading in output
                      If okHeading Then
                          Set rg5 = rg0.Cells(1, 1).Resize(1, n)
                          Set rg4 = ce.Offset(3, 0).Resize(n, 1)
                          rg4.FormulaArray = "=TRANSPOSE(" & s & rg5.Address(False, False) & ")"
                      End If
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  Sub DisplayFactorMatrix(rg0 As Range, rg As Range, ce As Range, nFactors As Long,     okHeading As Boolean, ByRef rgx As Range, ByRef rgy As Range, ByRef cex As Range)
                  ' display reduced loading matrix for rg (full load matrix) starting at cell ce
                  
                      On Error GoTo errorHandler
                  
                      Dim m As Long
                      m = rg.Rows.Count
                      Dim n As Long
                      n = rg.Columns.Count
                      
                      ce.Value = "Factor Matrix (unrotated)"
                      Dim ce1 As Range
                      Set ce1 = ce.Offset(2, 0)
                  
                      ' headings
                      Call SeqRow(ce1.Offset(0, 1), nFactors)
                      ce1.Offset(0, nFactors + 2).Value = "Commun"
                      ce1.Offset(0, nFactors + 3).Value = "Specific"
                      If okHeading Then Call DisplayDataHeadings(rg0, ce1, -1)
                      
                      ' display factor matrix
                      Dim rg2 As Range
                      Dim rg3 As Range
                      Dim rg4 As Range
                      Set rg2 = rg.Resize(m, nFactors)
                      Set rgx = ce1.Offset(1, 1).Resize(m, nFactors)
                      rgx.FormulaArray = "=" & rg2.Address(False, False)
                      rgx.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Set rg3 = rgx.Resize(m, 1)
                      Call SetFormula(ce1.Offset(m + 1, 1), "SUMSQ", rg3)
                      Set rg4 = ce1.Offset(m + 1, 1).Resize(1, nFactors)
                      If nFactors > 1 Then rg4.FillRight
                      
                      ' display communalities
                      Dim rg1 As Range
                      Dim rg6 As Range
                      Set rg1 = ce1.Offset(1, nFactors + 2).Resize(m, 1)
                      Set rg6 = rgx.Cells(1, 1).Resize(1, nFactors)
                      ce1.Offset(1, nFactors + 2).Formula = "=SUMSQ(" & rg6.Address(False, False) & ")"
                      If m > 1 Then rg1.FillDown
                      rg1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Call SetFormula(ce1.Offset(m + 1, nFactors + 2), "SUM", rg1)
                      
                      ' display specific variances
                      Set rgy = ce1.Offset(1, nFactors + 3).Resize(m, 1)
                      ce1.Offset(1, nFactors + 3).Formula = "=1-" & ce1.Offset(1, nFactors + 2).Address(False, False)
                      If m > 1 Then rgy.FillDown
                      rgy.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Call SetFormula(ce1.Offset(m + 1, nFactors + 3), "SUM", rgy)
                      
                      Set cex = ce1.Offset(n + 3, 0)
                          
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                  
                  End Sub
                  
                  ' Varimax
                  
                  Private Function fVarimax(matrix As Variant, Optional iter As Variant = 100, Optional prec As Variant = 0.00001) As Variant
                  ' return the Varimax rotation of matrix; used by VARIMAX
                  ' iter = maximum number of iterations, or stop iterating when sine of theta (angle of rotation) is less than prec
                  
                      Dim i As Long
                      Dim j As Long
                      Dim m As Long
                      Dim n As Long
                      m = UBound(matrix, 1)
                      n = UBound(matrix, 2)
                      
                      ' fill communities vector
                      Dim c As Variant    ' communities
                      ReDim c(1 To m)
                      For i = 1 To m
                          c(i) = 0#
                          For j = 1 To n
                              c(i) = c(i) + matrix(i, j) ^ 2
                          Next
                          c(i) = Sqr(c(i))
                      Next
                      
                      ' fill normalized matrix
                      Dim a As Variant
                      ReDim a(1 To m, 1 To n)
                      For i = 1 To m
                          For j = 1 To n
                              a(i, j) = matrix(i, j) / c(i)
                          Next
                      Next
                      
                      ' iteration
                      Dim k As Long
                      Dim p As Long
                      Dim u As Double
                      Dim v As Double
                      Dim temp1 As Double
                      Dim temp2 As Double
                      Dim temp3 As Double
                      Dim temp4 As Double
                      Dim temp As Double
                      Dim x As Double
                      Dim y As Double
                      Dim theta As Double
                      Dim s As Doub

                  General
                  Stream Path:VBA/Fisher
                  VBA File Name:Fisher
                  Stream Size:23709
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . . G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . > . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . ` . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 a2 13 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff d0 13 00 00 14 47 00 00 07 00 00 00 01 00 00 00 d4 1f af 18 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 68 01 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Fisher"
                  ' Fisher exact test
                  
                  Const MAXdf = 8
                  Const dimlogfacttable = 5000
                  Dim logfacttable(dimlogfacttable) As Double
                  Private tfix0 As Double, tvar1 As Double, tvar2 As Double, p_res As Double
                  Private lastg(MAXdf) As Long
                  Private rt(MAXdf) As Long, ct(MAXdf) As Long, dir(MAXdf) As Long, sta_ofs(MAXdf) As Long
                  Private mn(MAXdf) As Long, mx(MAXdf) As Long, a() As Long ' glob to module
                  
                  Private Function logfact(n As Long)
                  ' USE LOG FACTORIAL TO SPEED UP EVALUATION
                  ' STORE FIRST VALUES IN TABLE (logfacttable)
                  Dim r As Double
                  r = 0
                  If logfacttable(2) = 0 Then ' CREATE AT FIRST USE
                    For i = 1 To dimlogfacttable ' UBound(logfacttable) ' dimlogfacttable
                      logfacttable(i) = Log(i) + logfacttable(i - 1)
                    Next
                  End If
                  If n < dimlogfacttable Then ' UBound(logfacttable) Then
                    r = logfacttable(n)
                  Else
                    For i = 1 To n ' for exagerate
                      r = r + Log(i)
                    Next
                  End If
                  logfact = r
                  End Function
                  
                  ' as of feb 18 2016
                  
                  Private Function rtest3(df0 As Long) As Double
                  ' private used globals: a,dir,sa_ofs,tvar1,tvar2,tfix1,p_res
                  Dim r0 As Long, c0 As Long, rd As Long, cd As Long
                  Dim a1 As Long, b1 As Long, a2 As Long, b2 As Long
                  Dim dir0 As Long, i As Long, j As Long, k As Long, e As Long
                  Dim lgvx As Double, kmax As Integer
                  dir0 = dir(df0)
                  ofs0 = sta_ofs(df0) ' where to start. update at end of cycle for next iter
                  kmax = IIf(ofs0 > 0, ofs0 + ofs0, -ofs0 - ofs0) - 1
                  r0 = rt(df0): c0 = ct(df0)
                  rd = a(1, 0): cd = a(0, 1)   ' dipendent (non free) row/col
                  e = 0: k = 0
                  a1 = a(r0, c0): a2 = a(rd, c0): b1 = a(r0, cd): b2 = a(rd, cd)
                  Do While True
                    a(r0, c0) = a(r0, c0) + ofs0: a(rd, cd) = a(rd, cd) + ofs0 ' modify cell
                    a(r0, cd) = a(r0, cd) - ofs0: a(rd, c0) = a(rd, c0) - ofs0
                    If df0 = 1 Then ' last step:
                      e0 = 1
                      tvar2 = 0
                      For i = 1 To rd: For j = 1 To cd:
                        If a(i, j) < 0 Then e0 = 0 Else tvar2 = tvar2 + logfacttable(a(i, j))
                      Next: Next
                      If e0 = 1 Then
                        lgvx = tfix0 - tvar2
                        If tvar2 >= tvar1 Then p_res = p_res + Exp(lgvx) ' <= pivot
                      End If
                    Else ' deeper
                      e0 = rtest3(df0 - 1)
                    End If
                    a(r0, c0) = a(r0, c0) - ofs0: a(rd, cd) = a(rd, cd) - ofs0 ' restore
                    a(r0, cd) = a(r0, cd) + ofs0: a(rd, c0) = a(rd, c0) + ofs0
                    If e0 > 0 Then
                      lastg(df0) = ofs0
                      e = e + e0
                      ofs0 = ofs0 + dir0
                      k = kmax ' stop forwarding
                    Else
                      If k > kmax Then Exit Do
                      ofs0 = ofs0 + dir0
                    End If
                    k = k + 1
                  Loop
                  If e = 0 Then ' nothing here
                    a(r0, c0) = a1: a(rd, cd) = b2
                    a(r0, cd) = b1: a(rd, c0) = a2
                  Else
                    sta_ofs(df0) = dir0 ' first invalid now: first attempt next recursion
                    ofs0 = ofs0 - dir0 ' last good
                    For k = 1 To df0 - 1 ' can be made better
                      sta_ofs(k) = (-dir(k)) * (df0 + 1 - k) ' deeper levels broadening
                    Next
                    a(r0, c0) = a(r0, c0) + ofs0: a(rd, cd) = a(rd, cd) + ofs0
                    a(r0, cd) = a(r0, cd) - ofs0: a(rd, c0) = a(rd, c0) - ofs0
                    dir(df0) = -dir0 ' change sign eval new start attempt
                  End If
                  rtest3 = e
                  End Function
                  
                  Private Function FISHERTEST1(matrix As Variant, Optional tails As Long = 2) As Double
                  ' return p-value of Fisher exact test for the 2 x 2 contingency table in matrix
                  ' t = 1 (one tail test) or 2 (two tail test); assumes a 2 x 2 table
                  
                      Dim i As Long               ' row index
                      Dim j As Long               ' column index
                      Dim x As Double             ' min cell
                      Dim ntot As Double          ' grand total
                      Dim rtot As Double          ' row marginal total for x
                      Dim ctot As Double          ' column marginal total for x
                      Dim mi As Long              ' row index of min cell
                      Dim mj As Long              ' column index of min cell
                      Dim fprob As Double         ' Fisher p-value
                      Dim xprob As Double         ' prob for x
                      Dim hprob As Double         ' hypergeometric probability
                          
                       ntot = 0#
                       x = matrix(1, 1)
                       mi = 1
                       mj = 1
                       For i = 1 To 2
                           For j = 1 To 2
                               ntot = ntot + matrix(i, j)
                               If matrix(i, j) < x Then
                                   x = matrix(i, j)
                                   mi = i
                                   mj = j
                               End If
                           Next
                       Next
                       rtot = matrix(mi, 1) + matrix(mi, 2)
                       ctot = matrix(1, mj) + matrix(2, mj)
                       fprob = 0#
                       
                       With WorksheetFunction
                       
                       For i = 0 To x - 1
                           fprob = fprob + .HypGeom_Dist(i, rtot, ctot, ntot, False)
                       Next
                       xprob = .HypGeom_Dist(i, rtot, ctot, ntot, False)  ' i = integer version of x
                       If xprob + fprob <= 1 - fprob Then  ' left tail
                           fprob = fprob + xprob
                           If tails = 2 Then   ' two tail test
                               j = rtot
                               If rtot > ctot Then j = ctot
                               xprob = xprob * 1.000000001     ' needed to test equality of decimal numbers
                               For i = j To 0 Step -1
                                   hprob = .HypGeom_Dist(i, rtot, ctot, ntot, False)
                                   If hprob <= xprob Then
                                       fprob = fprob + hprob
                                   Else
                                       Exit For
                                   End If
                               Next
                               If fprob > 1 Then fprob = 1     ' in case left and right critical regions overlap
                           End If
                       Else
                           fprob = 1 - fprob
                           If tails = 2 Then   ' two tail test
                               xprob = xprob * 1.000000001     ' needed to test equality of decimal numbers
                               For i = 0 To rtot
                                   hprob = .HypGeom_Dist(i, rtot, ctot, ntot, False)
                                   If hprob <= xprob Then
                                       fprob = fprob + hprob
                                   Else
                                       Exit For
                                   End If
                               Next
                               If fprob > 1 Then fprob = 1     ' in case left and right critical regions overlap
                           End If
                       End If
                       
                       End With
                      
                       FISHERTEST1 = fprob
                      
                  End Function
                  
                  Private Function FISHERTEST2(mtx As Variant, r As Long, c As Long, slow As Double) As Variant
                    Dim df As Long, res As Long, maxt As Long
                    Dim mxd(MAXdf)
                    ' original limits: 20000,500,280,90,90,30,30,25
                    mxd(1) = dimlogfacttable: mxd(2) = 20000: mxd(3) = 1250: mxd(4) = 320: mxd(5) = 175: mxd(6) = 95: mxd(7) = 75: mxd(8) = 30
                    p_res = 0: tvar1 = 0: tfix0 = 0 ' global privates
                    res = 0
                    lgvx = logfact(8) ' dummy call to setup logfact table
                    df = (r - 1) * (c - 1)
                    If df > MAXdf Then FISHERTEST2 = "Exceed max df of " & MAXdf: Exit Function
                    If df < 1 Then FISHERTEST2 = "Can't have one row/col": Exit Function
                    If df = 4 And r <> 3 Then mxd(4) = 360
                    If df = 6 And (r <> 3 And c <> 3) Then mxd(6) = 110
                    If df = 8 And (r <> 3 And c <> 3) Then mxd(8) = 40
                    mxd(df) = Int(mxd(df) * slow)
                    ReDim a(r + 1, c + 1)
                    For i = 1 To r: For j = 1 To c ' get table from sheet. Check sign
                      a(i, j) = mtx(i, j)
                      If a(i, j) < 0 Then FISHERTEST2 = "Data error in [" & i & "," & j & "]: " & a(i, j): Exit Function
                    Next: Next
                    For i = 1 To r: For j = 1 To c ' eval totals and  pivot semi-value. Check max value
                      If a(i, j) > dimlogfacttable Then FISHERTEST2 = "Too big in [" & i & "," & j & "]: " & a(i, j): Exit Function
                      a(i, c + 1) = a(i, c + 1) + a(i, j)
                      a(r + 1, j) = a(r + 1, j) + a(i, j)
                      a(r + 1, c + 1) = a(r + 1, c + 1) + a(i, j)
                      tvar1 = tvar1 + logfacttable(a(i, j))
                    Next: Next
                    If a(r + 1, c + 1) > dimlogfacttable Then FISHERTEST2 = "Grand total > " & dimlogfacttable & " (" & a(i, j) & ")": Exit Function
                    For i = 1 To r: k = a(i, c + 1) ' eval fixed part
                      tfix0 = tfix0 + logfacttable(k): If k > maxt Then maxt = k
                    Next
                    For j = 1 To c: k = a(r + 1, j)
                      tfix0 = tfix0 + logfacttable(k): If k > maxt Then maxt = k
                    Next
                    tfix0 = tfix0 - logfacttable(a(r + 1, c + 1))
                    If a(r + 1, c + 1) = 0 Then FISHERTEST2 = "Empty matrix": Exit Function
                    If a(r + 1, c + 1) > mxd(df) Then FISHERTEST2 = "Grand total > " & mxd(df) & " (" & a(r + 1, c + 1) & ") for " & df & " df": Exit Function
                    k = 1
                    For i = 1 To r - 1: For j = c - 1 To 1 Step -1
                      rt(k) = i: ct(k) = j: k = k + 1 ' df lookup position
                    Next: Next
                    rt(0) = r: ct(0) = c ' store matrix infos in 0th row col
                    a(0, 0) = df: a(0, 1) = c: a(1, 0) = r
                    
                    For k = 1 To df:  dir(k) = 1: sta_ofs(k) = 0: Next
                    res = res + rtest3(df)
                   
                    For i = 1 To r: For j = 1 To c: a(i, j) = mtx(i, j): Next: Next
                    For k = 1 To df: dir(k) = -1: sta_ofs(k) = 0: Next
                    res = res + rtest3(df) ' warn: start pivot duplicated
                  
                    lgvx = tfix0 - tvar1
                    FISHERTEST2 = p_res - Exp(lgvx)
                  
                  End Function
                  
                  Function FISHERTEST(array1 As Variant, Optional tails As Long = 2, Optional slow As Double = 1#) As Variant
                  Attribute FISHERTEST.VB_Description = "returns p-value for Fisher exact test"
                  Attribute FISHERTEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return p-value of Fisher exact test for the 2x2, 2x3, 2x4 or 3x3 contingency table in range rg
                  ' tails = 1 (one tail test) or 2 (two tail test); only used for 2 x 2 tables
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      Dim n As Long
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      
                      If m = 2 And n = 2 Then
                          FISHERTEST = FISHERTEST1(arr, tails)
                      Else
                          FISHERTEST = FISHERTEST2(arr, m, n, slow)
                      End If
                      
                  End Function
                  
                  Function FISHER_TEST(array1 As Variant, Optional lab As Boolean = False, Optional slow As Double = 1#) As Variant
                  Attribute FISHER_TEST.VB_Description = "returns array with p-value, cell total, df, chi-sq, V effect and w effect for two-tailed Fisher exact test"
                  Attribute FISHER_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return p-value and effect sizes of 2-tailed Fisher exact test for the 2x2, 2x3, 2x4 or 3x3 contingency table in range rg
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      Dim n As Long
                      m = UBound(arr, 1)
                      n = UBound(arr, 2)
                      
                      Dim h As Long
                      h = 1
                      If lab Then h = 2
                      Dim outp As Variant     ' output
                      ReDim outp(1 To 6, 1 To h)
                      
                      Dim nn As Long          ' sample size
                      
                      If lab Then
                          outp(1, 1) = "p-value"
                          outp(2, 1) = "size"
                          outp(3, 1) = "df"
                          outp(4, 1) = "chi-square"
                          outp(5, 1) = "V effect"
                          outp(6, 1) = "w effect"
                      End If
                      
                      With Application.WorksheetFunction
                          outp(1, h) = FISHERTEST2(arr, m, n, slow)
                          outp(2, h) = .Sum(arr)
                          outp(3, h) = (m - 1) * (n - 1)
                          outp(4, h) = .CHISQ_INV_RT(outp(1, h), outp(3, h))
                          outp(5, h) = Sqr(outp(4, h) / (outp(2, h) * .Min(m - 1, n - 1)))
                          outp(6, h) = Sqr(outp(4, h) / outp(2, h))
                      End With
                      FISHER_TEST = outp
                      
                  End Function
                  
                  Function FISHER_MIDP(array1 As Variant, Optional tails As Long = 2, Optional dbl As Boolean = False) As Double
                  Attribute FISHER_MIDP.VB_Description = "returns the mid p-value for the corrected Fisher exact test on the data in array1"
                  Attribute FISHER_MIDP.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns the Fisher mid-p test for a 2 x 2 matrix
                  
                      Dim x As Double             ' min cell
                      Dim ntot As Double          ' grand total
                      Dim rtot As Double          ' row marginal total for x
                      Dim ctot As Double          ' column marginal total for x
                      
                      Dim matrix As Variant
                      matrix = array1
                      Dim i As Long
                      Dim j As Long
                      Dim mi As Long
                      Dim mj As Long
                      
                      ntot = 0#
                      x = matrix(1, 1)
                      mi = 1
                      mj = 1
                      For i = 1 To 2
                          For j = 1 To 2
                              ntot = ntot + matrix(i, j)
                              If matrix(i, j) < x Then
                                  x = matrix(i, j)
                                  mi = i
                                  mj = j
                              End If
                          Next
                      Next
                      rtot = matrix(mi, 1) + matrix(mi, 2)
                      ctot = matrix(1, mj) + matrix(2, mj)
                      If dbl And tails = 2 And matrix(1, 1) = matrix(2, 2) And matrix(1, 2) = matrix(2, 1) Then
                          FISHER_MIDP = FISHERTEST1(array1, tails) - WorksheetFunction.HypGeom_Dist(x, rtot, ctot, ntot, False)
                      Else
                          FISHER_MIDP = FISHERTEST1(array1, tails) - WorksheetFunction.HypGeom_Dist(x, rtot, ctot, ntot, False) / 2
                      End If
                  
                  End Function
                  

                  General
                  Stream Path:VBA/Forecasting
                  VBA File Name:Forecasting
                  Stream Size:135744
                  Data ASCII:. . . . . . . . J 9 . . . . . . . . 9 . . % . . . . . . . . . . . . * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . 5 . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . ( . . . . . . 7 .
                  Data Raw:01 16 03 00 06 f0 00 00 00 4a 39 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 8d 39 00 00 25 93 01 00 18 00 00 00 01 00 00 00 d4 1f 16 2a 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Forecasting"
                  ' Forecasting
                  
                  Function PESARAN(yarray As Variant, farray As Variant) As Double
                  Attribute PESARAN.VB_Description = "returns test statistic for Pesaran-Timmermann test"
                  Attribute PESARAN.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' s stat of the Pesaran-Timmermann Test on the data in yarray and forecast in farray
                  
                      Dim yarr As Variant ' yarray as array
                      yarr = yarray
                      Dim farr As Variant ' farray as array
                      farr = farray
                      Dim n As Long       ' # of elements in y array
                      n = UBound(yarr, 1)
                      Dim i As Long
                      Dim py As Double
                      Dim pz As Double
                      Dim pyz As Double
                      Dim p As Double
                      Dim qy As Double
                      Dim qz As Double
                      Dim v As Double
                      Dim w As Double
                      Dim s As Double
                      
                      py = 0#
                      pz = 0#
                      pyz = 0#
                      For i = 1 To n
                          If yarr(i, 1) > 0 Then
                              py = py + 1
                              If farr(i, 1) > 0 Then
                                  pz = pz + 1
                                  pyz = pyz + 1
                              End If
                          ElseIf farr(i, 1) > 0 Then
                              pz = pz + 1
                          ElseIf yarr(i, 1) < 0 And farr(i, 1) < 0 Then
                              pyz = pyz + 1
                          End If
                      Next
                      py = py / n
                      pz = pz / n
                      pyz = pyz / n
                      
                      qy = py * (1 - py) / n
                      qz = pz * (1 - pz) / n
                      p = py * pz + (1 - py) * (1 - pz)
                      v = p * (1 - p) / n
                      w = (2 * py - 1) ^ 2 * qz + (2 * pz - 1) ^ 2 * qy + 4 * qy * qz
                      PESARAN = (pyz - p) / Sqr(v - w)
                      
                  End Function
                  
                  Function PTTest(yarray As Variant, farray As Variant) As Double
                  Attribute PTTest.VB_Description = "returns p-value for Pesaran-Timmermann test"
                  Attribute PTTest.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' p-value of the Pesaran-Timmermann Test on the data in yarray and forecast in farray
                      
                      PTTest = 1 - Application.WorksheetFunction.Norm_S_Dist(PESARAN(yarray, farray), True)
                      
                  End Function
                  
                  Function DIEBOLD(yarray As Variant, farray1 As Variant, farray2 As Variant,     Optional h As Long = 0, Optional ttype As Long = 0) As Double
                  Attribute DIEBOLD.VB_Description = "returns the Diebold-Mariano statistic for forecasts farray1 and farray2 based on the data in yarray"
                  Attribute DIEBOLD.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' Diebold-Mariano test statistic for forecasts farray1 and farray2 based on the data in yarray, with lag h
                  ' ttype = 0 : e^sq and = 1 : abs(e)
                  
                      Dim arr As Variant      ' yarray as an array
                      Dim arr1 As Variant     ' farray1 as an array
                      Dim arr2 As Variant     ' farray2 as an array
                      arr = yarray
                      arr1 = farray1
                      arr2 = farray2
                      Dim n As Long           ' # of elements in yarray
                      n = UBound(arr, 1)
                      Dim davg As Double      ' d-mean
                      Dim dvar As Double      ' d-variance
                      Dim d As Variant        ' d array
                      ReDim d(1 To n, 1 To 1)
                      Dim i As Long
                      Dim k As Long
                      
                      Dim hh As Long          ' h-1 unless h is outside the range [1,n-1]
                      If h <= 0 Then
                          hh = Application.WorksheetFunction.RoundUp(n ^ (1 / 3), 0)
                      ElseIf h >= n Then
                          hh = n - 1
                      Else
                          hh = h - 1
                      End If
                      
                      If ttype = 0 Then
                          For i = 1 To n
                              d(i, 1) = (arr(i, 1) - arr1(i, 1)) ^ 2 - (arr(i, 1) - arr2(i, 1)) ^ 2
                          Next
                      Else
                          For i = 1 To n
                              d(i, 1) = Abs(arr(i, 1) - arr1(i, 1)) - Abs(arr(i, 1) - arr2(i, 1))
                          Next
                      End If
                      
                      With Application.WorksheetFunction
                          davg = .Average(d)
                          dvar = .Var_P(d)
                      End With
                      
                      Dim g As Double         ' sum of gamma values from 1 to hh-1
                      Dim temp As Double
                      g = 0#
                      For k = 1 To hh
                          g = g + ACVF(d, k)
                      Next
                      
                      DIEBOLD = davg / Sqr((dvar + 2 * g) / n)
                      
                  End Function
                  
                  Function DMTEST(yarray As Variant, farray1 As Variant, farray2 As Variant,     Optional h As Long = 0, Optional ttype As Long = 0) As Double
                  Attribute DMTEST.VB_Description = "returns the p-value of the Diebold-Mariano test for forecasts farray1 and farray2 based on the data in yarray"
                  Attribute DMTEST.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' p-value of the Diebold-Mariano test for forecasts farray1 and farray2 based on the data in yarray, with lag h
                  ' ttype = 0 : e^sq and = 1 : abs(e)
                  
                      Dim p As Double
                      p = Application.WorksheetFunction.Norm_S_Dist(DIEBOLD(yarray, farray1, farray2, h, ttype), True)
                      If p >= 0.5 Then
                          DMTEST = 2 * (1 - p)
                      Else
                          DMTEST = 2 * p
                      End If
                  End Function
                  
                  Function LossDiff(yarray As Variant, farray1 As Variant, farray2 As Variant, Optional ttype As Long = 0) As Variant
                  Attribute LossDiff.VB_Description = "returns the loss differential time series for forecasts farray1 and farray2 based on the data in yarray"
                  Attribute LossDiff.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' returns the loss differential time series for forecasts farray1 and farray2 based on the data in yarray
                  ' ttype = 0 : e^sq and = 1 : abs(e)
                  
                      Dim arr As Variant      ' yarray as an array
                      Dim arr1 As Variant     ' farray1 as an array
                      Dim arr2 As Variant     ' farray2 as an array
                      arr = yarray
                      arr1 = farray1
                      arr2 = farray2
                      Dim n As Long           ' # of elements in yarray
                      n = UBound(arr, 1)
                      Dim d As Variant        ' d array
                      ReDim d(1 To n, 1 To 1)
                      Dim i As Long
                      
                      If ttype = 0 Then
                          For i = 1 To n
                              d(i, 1) = (arr(i, 1) - arr1(i, 1)) ^ 2 - (arr(i, 1) - arr2(i, 1)) ^ 2
                          Next
                      Else
                          For i = 1 To n
                              d(i, 1) = Abs(arr(i, 1) - arr1(i, 1)) - Abs(arr(i, 1) - arr2(i, 1))
                          Next
                      End If
                      
                      LossDiff = d
                      
                  End Function
                  
                  Function HLN(yarray As Variant, farray1 As Variant, farray2 As Variant,     Optional h As Long = 0, Optional ttype As Long = 0) As Double
                  Attribute HLN.VB_Description = "returns the HLN statistic (extension of Diebold-Mariano) for forecasts farray1 and farray2 based on the data in yarray"
                  Attribute HLN.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' HLN test statistic for forecasts farray1 and farray2 based on the data in yarray, with lag h
                  ' ttype = 0 : e^sq and = 1 : abs(e)
                  
                      Dim arr As Variant      ' yarray as an array
                      arr = yarray
                      Dim n As Long           ' # of elements in yarray
                      n = UBound(arr, 1)
                      
                      Dim hh As Long          ' h unless h is outside the range [1,n-1]
                      If h <= 0 Then
                          hh = Application.WorksheetFunction.RoundUp(n ^ (1 / 3), 0) + 1
                      ElseIf h >= n Then
                          hh = n
                      Else
                          hh = h
                      End If
                      
                      Dim dm As Double        ' Diebold-Mariano stat
                      dm = DIEBOLD(yarray, farray1, farray2, hh, ttype)
                      
                      HLN = dm * Sqr((n + 1 - 2 * hh + hh * (hh - 1)) / n)
                  
                  End Function
                  
                  Function HLNTEST(yarray As Variant, farray1 As Variant, farray2 As Variant,     Optional h As Long = 0, Optional ttype As Long = 0) As Double
                  Attribute HLNTEST.VB_Description = "returns the p-value of the HLN test (extension of Diebold-Mariano) for forecasts farray1 and farray2 based on the data in yarray"
                  Attribute HLNTEST.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' p-value of the HLN test for forecasts farray1 and farray2 based on the data in yarray, with lag h
                  ' ttype = 0 : e^sq and = 1 : abs(e)
                  
                      Dim arr As Variant      ' yarray as an array
                      arr = yarray
                      Dim n As Long           ' # of elements in yarray
                      n = UBound(arr, 1)
                  
                      HLNTEST = Application.WorksheetFunction.T_DIST_2T(Abs(HLN(yarray, farray1, farray2, h, ttype)), n - 1)
                  
                  End Function
                  
                  Function ForecastError(yarray As Variant, farray As Variant, ttype As String) As Double
                  Attribute ForecastError.VB_Description = "returns error of the forecast in farray on the data in yarray"
                  Attribute ForecastError.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' return measure of forecast error based on ttype = mse, u1, u2, mpe, mape, mae, me, rmse, smape, mase
                      Dim s As String
                      s = LCase(ttype)
                      Dim arr1 As Variant
                      Dim arr2 As Variant
                      Dim nn As Long      ' count of elements in array1 (assumes that non-numeric elements and array1 and array have same length)
                      With WorksheetFunction
                          nn = .Count(yarray)
                          If s = "mse" Then
                              ForecastError = .SumXMY2(yarray, farray) / nn
                          ElseIf s = "rmse" Then
                              ForecastError = Sqr(.SumXMY2(yarray, farray) / nn)
                          Else
                              arr1 = yarray
                              arr2 = farray
                              If s = "me" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = arr1(i, 1) - arr2(i, 1)
                                  Next
                                  ForecastError = .Average(arr1)
                              ElseIf s = "mae" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = Abs(arr1(i, 1) - arr2(i, 1))
                                  Next
                                  ForecastError = .Average(arr1)
                              ElseIf s = "mpe" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = 1 - arr2(i, 1) / arr1(i, 1)
                                  Next
                                  ForecastError = .Average(arr1)
                              ElseIf s = "mape" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = Abs(1 - arr2(i, 1) / arr1(i, 1))
                                  Next
                                  ForecastError = .Average(arr1)
                              ElseIf s = "smape" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = Abs(arr1(i, 1) - arr2(i, 1)) / ((Abs(arr1(i, 1)) + Abs(arr2(i, 1))) / 2)
                                  Next
                                  ForecastError = .Average(arr1)
                              ElseIf s = "u1" Then
                                  For i = 1 To nn
                                      arr1(i, 1) = arr1(i, 1) - arr2(i, 1)
                                  Next
                                  ForecastError = Sqr(.SumSq(arr1)) / (Sqr(.SumSq(yarray)) + Sqr(.SumSq(farray)))
                              ElseIf s = "u2" Then
                                  For i = 2 To nn
                                      arr2(i, 1) = (arr2(i, 1) - arr1(i, 1)) / arr1(i - 1, 1)
                                  Next
                                  arr2(1, 1) = 0
                                  For i = nn To 2 Step -1
                                      arr1(i, 1) = arr1(i, 1) / arr1(i - 1, 1) - 1
                                  Next
                                  arr1(1, 1) = 0
                                  ForecastError = Sqr(.SumSq(arr2) / .SumSq(arr1))
                              End If
                          End If
                      End With
                  End Function
                  
                  Function Forecast_Error(yarray As Variant, farray As Variant, Optional lab As Boolean = False) As Variant
                  Attribute Forecast_Error.VB_Description = "returns array of error measurements (me, mse, rmse, mae, mpe, mape, smape, u1, u2) for the forecast in farray on the data in yarray"
                  Attribute Forecast_Error.VB_ProcData.VB_Invoke_Func = " \n27"
                  ' return an array of measures of forecast error based on mse, u1, u2, mpe, mape, mae, me, rmse
                  
                      Dim arr1 As Variant
                      Dim arr2 As Variant
                      Dim h As Long
                      h = 1
                      If lab Then h = 2
                      Dim outp As Variant ' output array
                      ReDim outp(1 To 9, 1 To h)
                      
                      If lab Then
                          outp(1, 1) = "me"
                          outp(2, 1) = "mse"
                          outp(3, 1) = "rmse"
                          outp(4, 1) = "mae"
                          outp(5, 1) = "mpe"
                          outp(6, 1) = "mape"
                          outp(7, 1) = "smape"
                          outp(8, 1) = "u1"
                          outp(9, 1) = "u2"
                      End If
                      
                      Dim nn As Long      ' count of elements in array1 (assumes that non-numeric elements and array1 and array have same length)
                      Dim arr As Variant  ' array used to make the calculations
                      
                      With WorksheetFunction
                          nn = .Count(yarray)
                          ReDim arr(1 To nn, 1 To 1)
                          outp(2, h) = .SumXMY2(yarray, farray) / nn
                          outp(3, h) = Sqr(.SumXMY2(yarray, farray) / nn)
                          arr1 = yarray
                          arr2 = farray
                          For i = 1 To nn
                              arr(i, 1) = arr1(i, 1) - arr2(i, 1)
                          Next
                          outp(1, h) = .Average(arr)
                          For i = 1 To nn
                              arr(i, 1) = Abs(arr1(i, 1) - arr2(i, 1))
                          Next
                          outp(4, h) = .Average(arr)
                          For i = 1 To nn
                              arr(i, 1) = 1 - arr2(i, 1) / arr1(i, 1)
                          Next
                          outp(5, h) = .Average(arr)
                          For i = 1 To nn
                              arr(i, 1) = Abs(1 - arr2(i, 1) / arr1(i, 1))
                          Next
                          outp(6, h) = .Average(arr)
                          For i = 1 To nn
                              arr(i, 1) = Abs(arr1(i, 1) - arr2(i, 1)) / ((Abs(arr1(i, 1)) + Abs(arr2(i, 1))) / 2)
                          Next
                          outp(7, h) = .Average(arr)
                          For i = 1 To nn
                              arr(i, 1) = arr1(i, 1) - arr2(i, 1)
                          Next
                          outp(8, h) = Sqr(.SumSq(arr)) / (Sqr(.SumSq(yarray)) + Sqr(.SumSq(farray)))
                          For i = 2 To nn
                              arr2(i, 1) = (arr2(i, 1) - arr1(i, 1)) / arr1(i - 1, 1)
                          Next
                          arr2(1, 1) = 0
                          For i = nn To 2 Step -1
                              arr1(i, 1) = arr1(i, 1) / arr1(i - 1, 1) - 1
                          Next
                          arr1(1, 1) = 0
                          outp(9, h) = Sqr(.SumSq(arr2) / .SumSq(arr1))
                      End With
                      
                      Forecast_Error = outp
                      
                  End Function
                  
                  Private Function HoltError(darray As Variant, alpha As Double, BETA As Double, Optional ttype As String = "mse") As Double
                  ' return error for Holt's Trend on the data in the col array array1 based on specified alpha and beta values
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim farr As Variant
                      ReDim farr(1 To m)
                      Dim i As Long
                      Dim u As Double
                      Dim v As Double
                      Dim u0 As Double ' previous u value
                      Dim alpha1 As Double
                      alpha1 = 1# - alpha
                      Dim beta1 As Double
                      beta1 = 1# - BETA
                      Dim temp As Double
                      temp = 0#
                      
                      u = darr(1, 1)
                      v = 0#
                      
                      For i = 2 To m
                          u0 = u
                          farr(i) = u + v
                          u = alpha * darr(i, 1) + alpha1 * (u + v)
                          v = BETA * (u - u0) + beta1 * v
                      Next
                      
                      If ttype = "mae" Then
                          For i = 2 To m
                              temp = temp + Abs(darr(i, 1) - farr(i))
                          Next
                      ElseIf ttype = "mape" Then
                          For i = 2 To m
                              temp = temp + Abs(1# - farr(i) / darr(i, 1))
                          Next
                      Else
                          For i = 2 To m
                              temp = temp + (darr(i, 1) - farr(i)) ^ 2
                          Next
                      End If
                      
                      HoltError = temp / (m - 1)
                      
                  End Function
                  
                  Sub HoltOpt(darray As Variant, ByRef alpha As Double, ByRef BETA As Double, Optional ttype As String = "mse")
                  ' find the values of alpha and beta that optimize the Holt Trend analysis for the data in the column array darray
                      
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim i As Long
                      Dim j As Long
                      Dim iter As Long
                      iter = 200
                      Dim imin As Long
                      Dim jmin As Long
                      Dim err As Double
                      Dim emin As Double
                      emin = 1.7976931348623E+308
                      
                      For i = 0 To iter
                          alpha = i / iter
                          For j = 0 To iter
                              BETA = j / iter
                              err = HoltError(darray, alpha, BETA, ttype)
                              If err < emin Then
                                  imin = i
                                  jmin = j
                                  emin = err
                              End If
                          Next
                      Next
                      
                      alpha = imin / iter
                      BETA = jmin / iter
                      
                  End Sub
                  
                  Private Function HoltDampError(darray As Variant, alpha As Double, BETA As Double, phi As Double,     Optional ttype As String = "mse") As Double
                  ' return error for Damped Holt's Trend on the data in the col array array1 based on specified alpha, beta, phi values
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim farr As Variant
                      ReDim farr(1 To m)
                      Dim i As Long
                      Dim u As Double
                      Dim v As Double
                      Dim u0 As Double ' previous u value
                      Dim alpha1 As Double
                      alpha1 = 1# - alpha
                      Dim beta1 As Double
                      beta1 = 1# - BETA
                      Dim temp As Double
                      temp = 0#
                      
                      u = darr(1, 1)
                      v = 0#
                      
                      For i = 2 To m
                          u0 = u
                          farr(i) = u + v * phi
                          u = alpha * darr(i, 1) + alpha1 * (u + v * phi)
                          v = BETA * (u - u0) + beta1 * v * phi
                      Next
                      
                      If ttype = "mae" Then
                          For i = 2 To m
                              temp = temp + Abs(darr(i, 1) - farr(i))
                          Next
                      ElseIf ttype = "mape" Then
                          For i = 2 To m
                              temp = temp + Abs(1# - farr(i) / darr(i, 1))
                          Next
                      Else
                          For i = 2 To m
                              temp = temp + (darr(i, 1) - farr(i)) ^ 2
                          Next
                      End If
                      
                      HoltDampError = temp / (m - 1)
                      
                  End Function
                  
                  Sub HoltDampOpt(darray As Variant, ByRef alpha As Double, ByRef BETA As Double, ByRef phi As Double,     Optional mnphi As Double = 0#, Optional ttype As String = "mse")
                  ' find the values of alpha and beta that optimize the Holt Trend analysis for the data in the column array darray
                      
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim iter As Long
                      Dim iter1 As Long
                      Dim imin As Long
                      Dim jmin As Long
                      Dim kmin As Long
                      Dim err As Double
                      Dim emin As Double
                      emin = 1.7976931348623E+308
                      Dim kinc As Double
                      
                      If phi = 0 Then
                          iter = 75
                          iter1 = 74
                          kinc = (1# - mnphi) / iter
                          For i = 0 To iter
                              alpha = i / iter
                              For j = 0 To iter
                                  BETA = j / iter
                                  phi = mnphi
                                  For k = 1 To iter1
                                      phi = phi + kinc
                                      err = HoltDampError(darray, alpha, BETA, phi, ttype)
                                      If err < emin Then
                                          imin = i
                                          jmin = j
                                          kmin = k
                                          emin = err
                                      End If
                                  Next
                              Next
                          Next
                          alpha = imin / iter
                          BETA = jmin / iter
                          phi = mnphi + kinc * kmin
                      Else
                          iter = 200
                          For i = 0 To iter
                              alpha = i / iter
                              For j = 0 To iter
                                  BETA = j / iter
                                  err = HoltDampError(darray, alpha, BETA, phi, ttype)
                                  If err < emin Then
                                      imin = i
                                      jmin = j
                                      emin = err
                                  End If
                              Next
                          Next
                          alpha = imin / iter
                          BETA = jmin / iter
                      End If
                      
                  End Sub
                  
                  Private Function HWMultError(darray As Variant, alpha As Double, BETA As Double, gamma As Double,     per As Long, Optional init As Boolean = True, Optional ttype As String = "mse") As Double
                  ' return error for Holt-Winters (mult) on the data in the col array array1 based on specified parameter values
                  
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Dim farr As Variant
                      ReDim farr(1 To m)
                      Dim i As Long
                      Dim u As Double
                      Dim v As Double
                      v = 0#
                      Dim s As Variant
                      ReDim s(1 To m)
                      Dim u0 As Double    ' previous u value
                      Dim alpha1 As Double
                      alpha1 = 1# - alpha
                      Dim beta1 As Double
                      beta1 = 1# - BETA
                      Dim gamma1 As Double
                      gamma1 = 1# - gamma
                      Dim temp As Double
                      temp = 0#
                      Dim avg As Double   ' average of second period
                      avg = 0#
                      
                      ' initialize
                      For i = 1 To per
                          temp = temp + darr(i, 1)
                          avg = avg + darr(per + i, 1)
                      Next
                      temp = temp / per
                      For i = 1 To per
                          s(i) = darr(i, 1) / temp
                      Next
                      u = darr(per, 1) / s(per)
                      If init Then v = (avg / per - temp) / per
                      
                      ' calculate forecasts
                      For i = per + 1 To m
                          u0 = u
                          farr(i) = (u + v) * s(i - per)
                          u = alpha * darr(i, 1) / s(i - per) + alpha1 * (u + v)
                          v = BETA * (u - u0) + beta1 * v
                          s(i) = gamma * darr(i, 1) / u + gamma1 * s(i - per)
                      Next
                      
                      ' calculate error
                      temp = 0#
                      If ttype = "mae" Then
                          For i = per + 1 To m
                              temp = temp + Abs(darr(i, 1) - farr(i))
                          Next
                      ElseIf ttype = "mape" Then
                          For i = per + 1 To m
                              temp = temp + Abs(1# - farr(i) / darr(i, 1))
                          Next
                      Else
                          For i = per + 1 To m
                              temp = temp + (darr(i, 1) - farr(i)) ^ 2
                          Next
                      End If
                      
                      HWMultError = temp / (m - per)
                      
                  End Function
                  
                  Sub HWMultOpt(darray As Variant, ByRef alpha As Double, ByRef BETA As Double, ByRef gamma As Double,     per As Long, Optional init As Boolean = True, Optional ttype As String = "mse")
                  ' find the values of alpha, beta and gamma that optimize the Holt-Winters (additive) for the data in the column array darray
                      
                      Dim darr As Variant
                      darr = darray
                      Dim m As Long
                      m = UBound(darr, 1)
                      Di

                  General
                  Stream Path:VBA/Freq
                  VBA File Name:Freq
                  Stream Size:22093
                  Data ASCII:. . . . . . . . . . . . . . . . . . @ . . . D . . . . . . . . . . . $ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . X . . . . . . . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 12 17 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 40 17 00 00 e8 44 00 00 08 00 00 00 01 00 00 00 d4 1f d1 24 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Freq"
                  ' association
                  
                  Sub sLambdaCoeff(array1 As Variant, ByRef lnum As Long, ByRef lden As Long)
                  ' return the numerator/denominator of the lambda coefficient for the contingency table in array1 w/o headings or totals
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim nn As Long  ' grand total
                      Dim mx As Long
                      Dim s As Long
                      Dim r As Long
                      Dim temp As Long
                      
                      ' calculate s and nn
                      s = 0
                      nn = 0
                      For i = 1 To m
                          mx = -1
                          For j = 1 To n
                              If arr(i, j) > mx Then mx = arr(i, j)
                              nn = nn + arr(i, j)
                          Next
                          s = s + mx
                      Next
                      
                      ' calculate r
                      r = -1
                      For j = 1 To n
                          temp = 0
                          For i = 1 To m
                              temp = temp + arr(i, j)
                          Next
                          If temp > r Then r = temp
                      Next
                      
                      ' return lnum and lden
                      lnum = s - r
                      lden = nn - r
                      
                  End Sub
                  
                  Function LAMBDA_COEFF(array1 As Variant, Optional lab As Boolean = False) As Variant
                  Attribute LAMBDA_COEFF.VB_Description = "returns a column array with three lambda statistics: C|R, R|C, symmetric"
                  Attribute LAMBDA_COEFF.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return the three lambda coefficients for the contingency table in array1 w/o headings or totals
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      ReDim t(1 To n, 1 To m)
                      t = WorksheetFunction.Transpose(array1)
                      
                      Dim lnum As Long
                      Dim lden As Long
                      Dim lnum1 As Long
                      Dim lden1 As Long
                      
                      Call sLambdaCoeff(array1, lnum, lden)
                      Call sLambdaCoeff(t, lnum1, lden1)
                      
                      Dim outp As Variant
                      Dim h As Long
                      
                      If lab Then
                          h = 2
                          ReDim outp(1 To 3, 1 To 2)
                          outp(1, 1) = "col|row"
                          outp(2, 1) = "row|col"
                          outp(3, 1) = "symmetric"
                      Else
                          h = 1
                          ReDim outp(1 To 3, 1 To 1)
                      End If
                      
                      outp(1, h) = lnum / lden
                      outp(2, h) = lnum1 / lden1
                      outp(3, h) = (lnum + lnum1) / (lden + lden1)
                      
                      LAMBDA_COEFF = outp
                      
                  End Function
                  
                  Function LAMBDA_TEST(array1 As Variant, Optional lab As Boolean = False, Optional alpha As Double = 0.05,     Optional lambda0 As Double = 0#) As Variant
                  Attribute LAMBDA_TEST.VB_Description = "returns a column array with lambda statistic, s.e., z-stat, p-value, end points of 1-alpha confidence interval"
                  Attribute LAMBDA_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return lambda test for the contingency table in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim nn As Long  ' grand total
                      Dim mx As Long
                      Dim s As Long
                      Dim temp As Long
                      
                      ' calculate r and jj
                      Dim r As Long
                      Dim jj As Long
                      r = -1
                      nn = 0
                      For j = 1 To n
                          temp = 0
                          For i = 1 To m
                              temp = temp + arr(i, j)
                          Next
                          If temp > r Then
                              jj = j
                              r = temp
                          End If
                          nn = nn + temp
                      Next
                      
                      ' calculate s and ri
                      ReDim ri(1 To m) As Long    ' r_i for each i
                      s = 0
                      For i = 1 To m
                          mx = -1
                          For j = 1 To n
                              If arr(i, j) > mx Then mx = arr(i, j)
                          Next
                          s = s + mx
                          ri(i) = mx
                      Next
                      
                      ' get lambda, se, and z
                      Dim ll As Double    ' lambda
                      ll = (s - r) / (nn - r)
                      Dim u As Long
                      u = 0
                      For i = 1 To m
                          If arr(i, jj) = ri(i) Then u = u + ri(i)
                      Next
                      Dim se As Double
                      se = Sqr((nn - s) * (s + r - 2 * u) / (nn - r) ^ 3)
                      z = (ll - lambda0) / se
                      
                      ' get p and zcrit
                      Dim p As Double
                      Dim zcrit As Double
                      With WorksheetFunction
                          p = .Norm_S_Dist(-Abs(z), True)
                          zcrit = .Norm_S_Inv(1 - alpha / 2)
                      End With
                      
                      ' get output
                      Dim outp As Variant
                      Dim h As Long
                      If lab Then
                          h = 2
                          ReDim outp(1 To 6, 1 To 2)
                          outp(1, 1) = "lambda"
                          outp(2, 1) = "s.e."
                          outp(3, 1) = "z-stat"
                          outp(4, 1) = "p-value"
                          outp(5, 1) = "lower"
                          outp(6, 1) = "upper"
                      Else
                          h = 1
                          ReDim outp(1 To 6, 1 To 1)
                      End If
                      
                      outp(1, h) = ll
                      outp(2, h) = se
                      outp(3, h) = z
                      outp(4, h) = p
                      outp(5, h) = ll - se * zcrit
                      outp(6, h) = ll + se * zcrit
                      
                      LAMBDA_TEST = outp
                      
                  End Function
                  
                  Function CONCORD(array1 As Variant) As Long
                  Attribute CONCORD.VB_Description = "returns # of concordant pairs in array1"
                  Attribute CONCORD.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' # of concordance pairs
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim ii As Long
                      Dim jj As Long
                      Dim mm As Long
                      mm = m - 1
                      Dim nn As Long
                      nn = n - 1
                      Dim temp As Long
                      Dim tot As Long
                      tot = 0
                      
                      For i = 1 To mm
                          For j = 1 To nn
                              temp = 0
                              For ii = i + 1 To m
                                  For jj = j + 1 To n
                                      temp = temp + arr(ii, jj)
                                  Next
                              Next
                              tot = tot + arr(i, j) * temp
                          Next
                      Next
                      
                      CONCORD = tot
                      
                  End Function
                  
                  Function DISCORD(array1 As Variant) As Long
                  Attribute DISCORD.VB_Description = "returns # of discordant pairs in array1"
                  Attribute DISCORD.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' # of discordance pairs
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim ii As Long
                      Dim jj As Long
                      Dim mm As Long
                      mm = m - 1
                      Dim temp As Long
                      Dim tot As Long
                      tot = 0
                      
                      For i = 1 To mm
                          For j = 2 To n
                              temp = 0
                              For ii = i + 1 To m
                                  For jj = 1 To j - 1
                                      temp = temp + arr(ii, jj)
                                  Next
                              Next
                              tot = tot + arr(i, j) * temp
                          Next
                      Next
                      
                      DISCORD = tot
                      
                  End Function
                  
                  Function GAMMA_TEST(array1 As Variant, Optional lab As Boolean, Optional alpha As Double = 0.05,     Optional gamma0 As Double = 0#) As Variant
                  Attribute GAMMA_TEST.VB_Description = "returns a column array with gamma statistic, C, D, s.e., z-stat, p-value, end points of 1-alpha confidence interval"
                  Attribute GAMMA_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns gamma and a test for gamma = gamma0
                  
                      Dim outp As Variant
                      Dim h As Long
                      
                      If lab Then
                          h = 2
                          ReDim outp(1 To 8, 1 To 2)
                          outp(1, 1) = "gamma"
                          outp(2, 1) = "# concord"
                          outp(3, 1) = "# discord"
                          outp(4, 1) = "s.e."
                          outp(5, 1) = "z-stat"
                          outp(6, 1) = "p-value"
                          outp(7, 1) = "lower"
                          outp(8, 1) = "upper"
                      Else
                          h = 1
                          ReDim outp(1 To 8, 1 To 1)
                      End If
                      
                      Dim g As Double
                      Dim c As Double
                      Dim d As Double
                      Dim se As Double
                      Dim zcrit As Double
                      Dim z As Double
                      Dim n As Long
                      Dim p As Double
                      
                      c = CONCORD(array1)
                      d = DISCORD(array1)
                      g = (c - d) / (c + d)
                      
                      With WorksheetFunction
                          n = .Sum(array1)
                          se = Sqr(n * (1 - g ^ 2) / (c + d))
                          z = (g - gamma0) / se
                          p = 2 * .Norm_S_Dist(-Abs(z), True)
                          zcrit = .Norm_S_Inv(1 - alpha / 2)
                      End With
                      
                      outp(1, h) = g
                      outp(2, h) = c
                      outp(3, h) = d
                      outp(4, h) = se
                      outp(5, h) = z
                      outp(6, h) = p
                      outp(7, h) = g - zcrit * se
                      outp(8, h) = g + zcrit * se
                      
                      GAMMA_TEST = outp
                      
                  End Function
                  
                  Function MSOMERS(array1 As Variant) As Long
                  Attribute MSOMERS.VB_Description = "returns the M statistic used to calculate the variance of Somers' d"
                  Attribute MSOMERS.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' sum of nij*(M+-M-+N+-N+)^2
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim i As Long
                      Dim j As Long
                      Dim ii As Long
                      Dim jj As Long
                      Dim tot As Long
                      Dim gtot As Long
                      gtot = 0
                      
                      For i = 1 To m
                          For j = 1 To n
                              tot = 0
                              For ii = 1 To i - 1
                                  For jj = 1 To j - 1
                                      tot = tot + arr(ii, jj)
                                  Next
                                  For jj = j + 1 To n
                                      tot = tot - arr(ii, jj)
                                  Next
                              Next
                              For ii = i + 1 To m
                                  For jj = 1 To j - 1
                                      tot = tot - arr(ii, jj)
                                  Next
                                  For jj = j + 1 To n
                                      tot = tot + arr(ii, jj)
                                  Next
                              Next
                              gtot = gtot + arr(i, j) * tot ^ 2
                          Next
                      Next
                          
                      MSOMERS = gtot
                      
                  End Function
                  
                  Function SOMERS_TEST(array1 As Variant, Optional lab As Boolean, Optional alpha As Double = 0.05,     Optional d0 As Double = 0#) As Variant
                  Attribute SOMERS_TEST.VB_Description = "returns a column array with Somers' d statistic, C, D, s.e., z-stat, p-value, end points of 1-alpha confidence interval"
                  Attribute SOMERS_TEST.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' returns Somers' test
                  
                      Dim outp As Variant
                      Dim h As Long
                      
                      If lab Then
                          h = 2
                          ReDim outp(1 To 8, 1 To 2)
                          outp(1, 1) = "somers d"
                          outp(2, 1) = "# concord"
                          outp(3, 1) = "# discord"
                          outp(4, 1) = "s.e."
                          outp(5, 1) = "z-stat"
                          outp(6, 1) = "p-value"
                          outp(7, 1) = "lower"
                          outp(8, 1) = "upper"
                      Else
                          h = 1
                          ReDim outp(1 To 8, 1 To 1)
                      End If
                      
                      Dim g As Double
                      Dim c As Double
                      Dim d As Double
                      Dim se As Double
                      Dim zcrit As Double
                      Dim z As Double
                      Dim nn As Long
                      Dim p As Double
                      Dim mm As Long
                      Dim temp As Long
                      
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      
                      mm = 0
                      For i = 1 To m
                          temp = 0
                          For j = 1 To n
                              temp = temp + arr(i, j)
                          Next
                          mm = mm + temp ^ 2
                      Next
                      
                      c = CONCORD(array1)
                      d = DISCORD(array1)
                      
                      With WorksheetFunction
                          nn = .Sum(array1)
                          g = 2 * (c - d) / (nn ^ 2 - mm)
                          se = 2 * Sqr(MSOMERS(array1)) / (nn ^ 2 - mm)
                          z = (g - d0) / se
                          p = 2 * .Norm_S_Dist(-Abs(z), True)
                          zcrit = .Norm_S_Inv(1 - alpha / 2)
                      End With
                      
                      outp(1, h) = g
                      outp(2, h) = c
                      outp(3, h) = d
                      outp(4, h) = se
                      outp(5, h) = z
                      outp(6, h) = p
                      outp(7, h) = g - zcrit * se
                      outp(8, h) = g + zcrit * se
                      
                      SOMERS_TEST = outp
                      
                  End Function
                  

                  General
                  Stream Path:VBA/GMM
                  VBA File Name:GMM
                  Stream Size:35570
                  Data ASCII:. . . . . . . . . . . . . . . . . . . . . . l . . . . . . . . . . . t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . . . +
                  Data Raw:01 16 03 00 06 f0 00 00 00 da 18 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 1d 19 00 00 05 6c 00 00 05 00 00 00 01 00 00 00 d4 1f dd 74 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "GMM"
                  ' Gaussian mixture model
                  
                  Function MultiGMM(darray As Variant, k As Long, Optional lab As Boolean = False, Optional iter As Long = 20,     Optional prec As Double = 0, Optional carray As Variant, Optional kiter As Long = 10,     Optional nruns As Long = 5) As Variant
                  Attribute MultiGMM.VB_Description = "returns an array with probability, mean and covariance for each cluster and LL and # of iterations for GMM cluster analysis"
                  Attribute MultiGMM.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' return results of GMM cluster analysis on the data in darray for k clussters based on iter iteartions
                  ' terminates when LL <= prec; if carray = Nothing initiate with K++means cluster analysis; otherwise use
                  ' use cluser assignments in the column array carray
                      
                      Dim darr As Variant
                      darr = darray
                      Dim n As Long
                      n = UBound(darr, 1)
                      Dim d As Long
                      d = UBound(darr, 2)
                      Dim h As Long
                      Dim i As Long
                      Dim ii As Long
                      Dim j As Long
                      Dim jj As Long
                      Dim m As Long
                      Dim temp As Double
                      Dim t As Double
                      
                      ReDim di(1 To 1, 1 To d)
                      ReDim mu(1 To k) As Variant
                      ReDim sigma(1 To k) As Variant
                      ReDim w(1 To k) As Double
                      Dim pp As Double
                      ReDim mm(1 To d) As Double
                      ReDim dd(1 To d) As Double
                      ReDim ss(1 To d, 1 To d)
                      ReDim p(1 To n, 1 To k) As Double
                      Dim oldll As Double
                      Dim carr As Variant
                      
                      ' set initial values
                      old11 = 1E+300
                      If IsMissing(carray) Then
                          ReDim carr(1 To n, 1 To 1)
                          carr = CLUSTAnal(darr, k, nruns, 2, , kiter)
                      Else
                          carr = carray
                      End If
                      
                      For j = 1 To k
                          w(j) = COUNT_IF(carr, j) / n
                          mu(j) = AVG_IF(carr, j, darr)
                          sigma(j) = COV_IF(carr, j, darr)
                      Next
                      
                      ' EM algorithm
                      For m = 1 To iter
                      
                          ' E step
                          For i = 1 To n
                              For h = 1 To d
                                  di(1, h) = darr(i, h)
                              Next
                              temp = 0#
                              For j = 1 To k
                                  p(i, j) = w(j) * MNORMDIST(di, mu(j), sigma(j), False)
                                  temp = temp + p(i, j)
                              Next
                              For j = 1 To k
                                  p(i, j) = p(i, j) / temp
                              Next
                          Next
                          
                          ' M step
                          For j = 1 To k
                              ' get pp and w(j)
                              pp = 0#
                              For i = 1 To n
                                  pp = pp + p(i, j)
                              Next
                              w(j) = pp / n
                              ' get mu(j)
                              For h = 1 To d
                                  mm(h) = 0#
                              Next
                              For i = 1 To n
                                  For h = 1 To d
                                      mm(h) = mm(h) + p(i, j) * darr(i, h)
                                  Next
                              Next
                              For h = 1 To d
                                  mm(h) = mm(h) / pp
                              Next
                              mu(j) = mm
                              ' get sigma(j)
                              For h = 1 To d
                                  For ii = h To d
                                      ss(h, ii) = 0#
                                  Next
                              Next
                              For i = 1 To n
                                  For h = 1 To d
                                      dd(h) = darr(i, h) - mm(h)
                                  Next
                                  For h = 1 To d
                                      For ii = h To d
                                          ss(h, ii) = ss(h, ii) + p(i, j) * dd(h) * dd(ii)
                                      Next
                                  Next
                              Next
                              For h = 1 To d
                                  For ii = h To d
                                      ss(h, ii) = ss(h, ii) / pp
                                  Next
                              Next
                              For h = 2 To d
                                  For ii = 1 To h - 1
                                      ss(h, ii) = ss(ii, h)
                                  Next
                              Next
                              sigma(j) = ss
                          Next
                          
                          ' log-likelihood
                          If prec > 0# Then
                              temp = 0#       ' temp = log-likelihood
                              For i = 1 To n
                                  For h = 1 To d
                                      di(1, h) = darr(i, h)
                                  Next
                                  t = 0#
                                  For j = 1 To k
                                      t = t + w(j) * MNORMDIST(di, mu(j), sigma(j), False)
                                  Next
                                  temp = temp + Log(t)
                              Next
                              If Abs(temp - oldll) <= prec Then Exit For
                              oldll = temp
                          End If
                      Next
                      
                      ' output initialization
                      Dim outp As Variant
                      Dim hh As Long
                      If lab Then
                          ReDim outp(1 To (d + 2) * k + 1, 1 To d + 1)
                          hh = 1
                          jj = 1
                          For j = 1 To k
                              outp(jj, 1) = "weight " & j
                              outp(jj + 1, 1) = "mu " & j
                              For h = 1 To d
                                  outp(jj + h + 1, 1) = "cov " & j & " " & h
                              Next
                              jj = jj + d + 2
                          Next
                          outp(jj, 1) = "LL/iter"
                      Else
                          ReDim outp(1 To (d + 2) * k + 1, 1 To d)
                          hh = 0
                      End If
                      
                      ' log-likelihood
                      If prec <= 0# Then
                          temp = 0#   ' temp = log-likelihood
                          For i = 1 To n
                              For h = 1 To d
                                  di(1, h) = darr(i, h)
                              Next
                              t = 0
                              For j = 1 To k
                                  t = t + w(j) * MNORMDIST(di, mu(j), sigma(j), False)
                              Next
                              temp = temp + Log(t)
                          Next
                      End If
                      
                      ' output
                      jj = 1
                      For j = 1 To k
                          outp(jj, hh + 1) = w(j)
                          For h = hh + 2 To d + 1
                              outp(jj, h) = ""
                          Next
                          mm = mu(j)
                          ss = sigma(j)
                          For h = 1 To d
                              outp(jj + 1, h + hh) = mm(h)
                              For i = 1 To d
                                  outp(jj + i + 1, h + hh) = ss(i, h)
                              Next
                          Next
                          jj = jj + d + 2
                      Next
                      outp(jj, hh + 1) = temp
                      outp(jj, hh + 2) = m
                      For h = 3 To d
                          outp(jj, h + hh) = ""
                      Next
                      MultiGMM = outp
                  
                  End Function
                  
                  Function UniGMM(darray As Variant, k As Long, Optional lab As Boolean = False, Optional iter As Long = 20,     Optional prec As Double = 0, Optional carray As Variant, Optional kiter As Long = 10,     Optional nruns As Long = 5) As Variant
                  Attribute UniGMM.VB_Description = "returns an array with probability, mean and variance for each cluster and LL and # of iterations for GMM cluster analysis"
                  Attribute UniGMM.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' returns results of GMM clustering for data in column array darray with k clusters
                  ' if carray has one column then carray consists of cluster indices from 1 to k
                  ' if carray has one row (with k columns) then carray contains the initial means
                  ' if carray is r then k initial means are closen at random from min to max of darray
                  ' if carray is not an array then k initial means are closen in intervals of size delta from min+delta/2 to max-delta/2 of darray
                  ' if carray is missing then carray is initialized using k++ means
                  
                      Dim darr As Variant
                      darr = darray
                      Dim n As Long
                      n = UBound(darr, 1)
                      Dim i As Long
                      Dim j As Long
                      Dim m As Long
                      Dim temp As Double
                      
                      ReDim mu(1 To k) As Double
                      ReDim sigma(1 To k) As Double
                      ReDim w(1 To k) As Double
                      Dim ww As Double
                      Dim mn As Double
                      Dim mx As Double
                      Dim mm As Double
                      Dim dif As Double
                      Dim ss As Double
                      ReDim p(1 To n, 1 To k) As Double
                      Dim oldll As Double
                      Dim carr As Variant
                      Dim c As Long
                      
                      ' set initialization type
                      If IsMissing(carray) Then
                          c = 1
                          ReDim carr(1 To n, 1 To 1)
                          carr = CLUSTAnal(darr, k, nruns, 1, , kiter)
                      Else
                          carr = carray
                          If IsArray(carray) Then ' if c = 1 then use cluster assigment in carray; otherwise c = k and carr contains means
                              c = UBound(carr, 2)
                          Else
                              c = 0
                          End If
                      End If
                      
                      With WorksheetFunction
                      
                      ' initialize values
                      If c = 1 Then
                          For j = 1 To k
                              w(j) = COUNT_IF(carr, j) / n
                              mu(j) = AVG_IF(carr, j, darr)
                              sigma(j) = COV_IF(carr, j, darr)(1)
                          Next
                      Else
                          ww = 1 / k
                          ss = .StDev_S(darr)
                          For j = 1 To k
                              w(j) = 1 / k
                              sigma(j) = ss
                          Next
                          If c = k Then
                              For j = 1 To k
                                  mu(j) = carr(1, j)
                              Next
                          Else
                              mn = .Min(darr)
                              mx = .Max(darr)
                              dif = mx - mn
                              If carr = "r" Then
                                  For j = 1 To k
                                      mu(j) = mn + dif * Rnd()
                                  Next
                              Else
                                  temp = dif / k
                                  mm = mn - temp / 2
                                  For j = 1 To k
                                      mm = mm + temp
                                      mu(j) = mm
                                  Next
                              End If
                          End If
                      End If
                      
                      ' EM algorithm
                      For m = 1 To iter
                      
                          ' E step
                          For i = 1 To n
                              temp = 0#
                              For j = 1 To k
                                  p(i, j) = w(j) * .Norm_Dist(darr(i, 1), mu(j), sigma(j), False)
                                  temp = temp + p(i, j)
                              Next
                              For j = 1 To k
                                  p(i, j) = p(i, j) / temp
                              Next
                          Next
                          
                          ' M step
                          For j = 1 To k
                              ww = 0#
                              mm = 0#
                              ss = 0#
                              temp = mu(j)
                              For i = 1 To n
                                  ww = ww + p(i, j)
                                  mm = mm + p(i, j) * darr(i, 1)
                                  ss = ss + p(i, j) * (darr(i, 1) - temp) ^ 2
                              Next
                              w(j) = ww / n
                              mu(j) = mm / ww
                              sigma(j) = Sqr(ss / ww)
                          Next
                          
                          ' log-likelihood
                          If prec > 0# Then
                              temp = 0#       ' temp = log-likelihood
                              For i = 1 To n
                                  mm = 0
                                  For j = 1 To k
                                      mm = mm + w(j) * .Norm_Dist(darr(i, 1), mu(j), sigma(j), False)
                                  Next
                                  temp = temp + Log(mm)
                              Next
                              If Abs(temp - oldll) <= prec Then Exit For
                              oldll = temp
                          End If
                      Next
                      
                      End With
                      
                      ' output initialization
                      Dim outp As Variant
                      Dim h As Long
                      If lab Then
                          ReDim outp(1 To 4, 1 To k + 1)
                          h = 1
                          outp(1, 1) = "weight"
                          outp(2, 1) = "mu"
                          outp(3, 1) = "sigma"
                          outp(4, 1) = "LL/iter"
                      Else
                          ReDim outp(1 To 4, 1 To k)
                          h = 0
                      End If
                      
                      ' log-likelihood
                      If prec <= 0# Then
                          temp = 0#   ' temp = log-likelihood
                          With WorksheetFunction
                              For i = 1 To n
                                  mm = 0
                                  For j = 1 To k
                                      mm = mm + w(j) * .Norm_Dist(darr(i, 1), mu(j), sigma(j), False)
                                  Next
                                  temp = temp + Log(mm)
                              Next
                          End With
                      End If
                      
                      ' output
                      For j = 1 To k
                          outp(1, j + h) = w(j)
                          outp(2, j + h) = mu(j)
                          outp(3, j + h) = sigma(j)
                      Next
                      outp(4, h + 1) = temp
                      outp(4, h + 2) = m
                      For j = 3 To k
                          outp(4, j + h) = ""
                      Next
                      UniGMM = outp
                  
                  End Function
                  
                  Function UniGMMClust(darray As Variant, garray As Variant, Optional sorted As Boolean = False) As Variant
                  Attribute UniGMMClust.VB_Description = "returns a m x k+2 array; col 1 is duplicated from darray; the next k columns show the probability that each element is in each cluster; the last col lists the cluster with the highest probability"
                  Attribute UniGMMClust.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' returns an n x k array with probability of each of the k clusters for each row in darray
                  ' where darray = n x 1 data array and garray = 4 x k+1 array output from UniGMM
                  
                      Dim darr As Variant
                      darr = darray
                      Dim garr As Variant
                      garr = garray
                      Dim n As Long
                      n = UBound(darr, 1)
                      Dim kk As Long
                      kk = UBound(garr, 2)
                      Dim k As Long
                      k = kk - 1
                      Dim kkk As Long
                      kkk = kk + 1
                      Dim i As Long
                      Dim j As Long
                      Dim mm As Double
                      Dim ss As Double
                      
                      Dim outp As Variant
                      ReDim outp(1 To n + 1, 1 To kkk)
                      Dim soutp As Variant
                      Dim tot As Double
                      ReDim nn(2 To kk) As Long
                      Dim mx As Double
                      Dim m As Long
                      
                      For i = 1 To n
                          outp(i, 1) = darr(i, 1)
                      Next
                      
                      With WorksheetFunction
                          For j = 2 To kk
                              nn(j) = 0
                              mm = garr(2, j)
                              ss = garr(3, j)
                              For i = 1 To n
                                  outp(i, j) = .Norm_Dist(darr(i, 1), mm, ss, False)
                              Next
                          Next
                      End With
                      
                      For i = 1 To n
                          tot = outp(i, 2)
                          m = 2
                          mx = tot
                          For j = 3 To kk
                              tot = tot + outp(i, j)
                              If outp(i, j) > mx Then
                                  mx = outp(i, j)
                                  m = j
                              End If
                          Next
                          outp(i, kkk) = m - 1
                          nn(m) = nn(m) + 1
                          For j = 2 To kk
                              outp(i, j) = outp(i, j) / tot
                          Next
                      Next
                      
                      outp(n + 1, 1) = "total"
                      For j = 2 To kk
                          outp(n + 1, j) = nn(j) / n
                      Next
                      outp(n + 1, kkk) = n
                      
                      If sorted Then
                          ReDim soutp(1 To n + 1, 1 To kkk)
                          soutp = QSORTRows(outp, kkk)
                          UniGMMClust = soutp
                      Else
                          UniGMMClust = outp
                      End If
                      
                  End Function
                  
                  Function MultiGMMClust(darray As Variant, garray As Variant, Optional sorted As Boolean = False) As Variant
                  Attribute MultiGMMClust.VB_Description = "rreturns a m x k+2 array; col 1 is duplicated from darray; the next k columns show the probability that each element is in each cluster; the last col lists the cluster with the highest probability"
                  Attribute MultiGMMClust.VB_ProcData.VB_Invoke_Func = " \n29"
                  ' returns an n x k array with probability of each of the k clusters for each row in darray
                  ' where darray = n x d data array and garray = (d+2)*k+1 x d+1 array output from MultiGMM
                  
                      Dim darr As Variant
                      darr = darray
                      Dim garr As Variant
                      garr = garray
                      Dim n As Long
                      n = UBound(darr, 1)
                      Dim d As Long
                      d = UBound(darr, 2)
                      Dim dd As Long
                      dd = d + 2
                      Dim d1 As Long
                      d1 = d + 1
                      Dim kk As Long
                      kk = UBound(garr, 1)
                      Dim k As Long
                      k = kk \ dd
                      Dim kkk As Long
                      kkk = k + d1
                      Dim h As Long
                      Dim hh As Long
                      Dim i As Long
                      Dim j As Long
                      Dim jj As Long
                      ReDim mm(1 To 1, 1 To d) As Double
                      ReDim di(1 To 1, 1 To d) As Double
                      ReDim ss(1 To d, 1 To d) As Double
                      
                      Dim outp As Variant
                      ReDim outp(1 To n + 1, 1 To kkk)
                      Dim soutp As Variant
                      Dim tot As Double
                      ReDim nn(1 To k) As Long
                      Dim mx As Double
                      Dim m As Long
                      
                      For i = 1 To n
                          For h = 1 To d
                              outp(i, h) = darr(i, h)
                          Next
                      Next
                      
                      jj = 2
                      For j = 1 To k
                          nn(j) = 0
                          For h = 1 To d
                              mm(1, h) = garr(jj, h + 1)
                              For hh = 1 To d
                                  ss(h, hh) = garr(jj + h, hh + 1)
                              Next
                          Next
                          jj = jj + dd
                          For i = 1 To n
                              For h = 1 To d
                                  di(1, h) = darr(i, h)
                              Next
                              outp(i, j + d) = MNORMDIST(di, mm, ss, False)
                          Next
                      Next
                      
                      For i = 1 To n
                          tot = outp(i, d1)
                          m = 1
                          mx = tot
                          For j = 2 To k
                              tot = tot + outp(i, d + j)
                              If outp(i, d + j) > mx Then
                                  mx = outp(i, d + j)
                                  m = j
                              End If
                          Next
                          outp(i, kkk) = m
                          nn(m) = nn(m) + 1
                          For j = 1 To k
                              outp(i, j + d) = outp(i, j + d) / tot
                          Next
                      Next
                      
                      outp(n + 1, 1) = "total"
                      For j = 1 To k
                          outp(n + 1, j + d) = nn(j) / n
                      Next
                      outp(n + 1, kkk) = n
                      
                      If sorted Then
                          ReDim soutp(1 To n + 1, 1 To kkk)
                          soutp = QSORTRows(outp, kkk)
                          MultiGMMClust = soutp
                      Else
                          MultiGMMClust = outp
                      End If
                      
                  End Function
                  
                  Sub RunGMM(rg As Range, ce As Range, rgc As Range, k As Long, iter As Long, head As Boolean)
                  
                      On Error GoTo errorHandler
                      
                      Application.ScreenUpdating = False
                  
                      Dim h As Long
                      Dim j As Long
                      Dim rg0 As Range    ' rg w/o column heading
                      Dim rg1 As Range    ' used for formating
                      Dim rg2 As Range    ' used for formatting
                      Dim ce1 As Range    ' cell which contains k value
                      
                      Dim n As Long       ' # of data rows in rg
                      n = rg.Rows.Count
                      Dim d As Long       ' # of columns in rg
                      d = rg.Columns.Count
                      Dim dd As Long
                      dd = d + 2
                      
                      ' handle case where output is on a different worksheet from input
                      Dim s As String
                      s = ""
                      If rg.Worksheet.Name <> ce.Worksheet.Name Then s = "'" & rg.Worksheet.Name & "'!"
                      
                      ' set rg0 based on whether head = True
                      If head Then
                          n = n - 1
                          Set rg0 = rg.Cells(2, 1).Resize(n, d)
                      Else
                          Set rg0 = rg
                      End If
                      
                      ce.Value = "GMM Cluster Analysis"
                      If d = 1 Then   ' uni-GMM
                          Set rg1 = ce.Offset(2, 0).Resize(4, k + 1)
                          If rgc Is Nothing Then
                              rg1.FormulaArray = "=UniGMM(" & s & rg0.Address(False, False) & "," & k & ",TRUE," & iter & ")"
                          Else
                              rg1.FormulaArray = "=UniGMM(" & s & rg0.Address(False, False) & "," & k & ",TRUE," & iter & ",," &                 s & rgc.Address(False, False) & ")"
                          End If
                          rg1.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                      Else
                          Set rg1 = ce.Offset(2, 0).Resize(k * dd + 1, d + 1)
                          If rgc Is Nothing Then
                              rg1.FormulaArray = "=MultiGMM(" & s & rg0.Address(False, False) & "," & k & ",TRUE," & iter & ")"
                          Else
                              rg1.FormulaArray = "=MultiGMM(" & s & rg0.Address(False, False) & "," & k & ",TRUE," & iter & ",," &                 s & rgc.Address(False, False) & ")"
                          End If
                          For j = 0 To k - 1
                              Set rg2 = ce.Offset(j * dd + 2, 0).Resize(dd, d + 1)
                              rg2.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                          Next
                      End If
                      
                      For h = 1 To d
                          ce.Offset(1, k + h + 1).Value = "data"
                      Next
                      
                      If d = 1 Then   ' uni-GMM
                          ce.Offset(1, k + 2).Value = "data"
                          For j = 1 To k
                              ce.Offset(1, k + j + 2).Value = "prob " & j
                          Next
                          ce.Offset(1, k + k + 3).Value = "cluster"
                          Set rg2 = ce.Offset(1, k + 2).Resize(1, k + 2)
                          rg2.HorizontalAlignment = xlRight
                          Set rg2 = ce.Offset(2, k + 2).Resize(n + 1, k + 2)
                          rg2.FormulaArray = "=UniGMMClust(" & s & rg0.Address(False, False) & "," & rg1.Address(False, False) & ")"
                          Set rg2 = ce.Offset(2, k + 2).Resize(n, k + 2)
                          rg2.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                          ce.Offset(n + 2, k + 2).HorizontalAlignment = xlRight
                      Else
                          For h = 1 To d
                              ce.Offset(1, d + h + 1).Value = "data " & h
                          Next
                          For j = 1 To k
                              ce.Offset(1, d + d + j + 1).Value = "prob " & j
                          Next
                          ce.Offset(1, k + d + dd).Value = "cluster"
                          Set rg2 = ce.Offset(1, d + 2).Resize(1, d + k + 1)
                          rg2.HorizontalAlignment = xlRight
                          Set rg2 = ce.Offset(2, d + 2).Resize(n + 1, d + k + 1)
                          rg2.FormulaArray = "=MultiGMMClust(" & s & rg0.Address(False, False) & "," &             rg1.Address(False, False) & ")"
                          Set rg2 = ce.Offset(2, dd).Resize(n, d + k + 1)
                          rg2.BorderAround ColorIndex:=1, weight:=xlThin, LineStyle:=xlContinuous
                          ce.Offset(n + 2, d + 2).HorizontalAlignment = xlRight
                      End If
                      
                      Application.ScreenUpdating = True
                      
                  Exit Sub
                  errorHandler:
                      MsgBox "A run time error has occurred. The analysis tool will be aborted." & Chr(13) & Chr(10) & Error(err)
                      Application.ScreenUpdating = True
                      
                  End Sub
                  

                  General
                  Stream Path:VBA/GoF
                  VBA File Name:GoF
                  Stream Size:20117
                  Data ASCII:. . . . . . . . 2 . . . . . . . . . ` . . . = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . 0 . . . . . . . . +
                  Data Raw:01 16 03 00 06 f0 00 00 00 32 08 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 60 08 00 00 98 3d 00 00 01 00 00 00 01 00 00 00 d4 1f 98 01 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "GoF"
                  Function ICF_GOF(xarray As Variant, dist As Variant, Optional lab As Boolean = False, Optional iter As Long = 20,     Optional param1 As Variant, Optional param2 As Variant) As Variant
                  Attribute ICF_GOF.VB_Description = "returns a column array with the ICF statistic and .05 and .10 critical values"
                  Attribute ICF_GOF.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return the ICF statistic, .05 and .10 critical values
                  ' dist = 6 (uniform): uniform; dist = 1 (norm): normal; dist = 2 (expon): exponential; dist = 3 (weibull): Weibull
                  ' dist = 8 (logistic): logistic; dist = 9 (lognorm): lognormal; dist = 10 (laplace): laplace distribution
                  ' dist = 12 (cauchy): Cauchy; dist = 20 (mnorm): multivariate normal
                  ' assumes there are no missing data elements and xarray is a column array
                  ' iter > 0 : MLE with iter iterations, iter = -3 : use stated parameters, 0 : Method of Moments, -1 : pure, -2 : regression
                  
                      Dim h As Long
                      h = 1
                      If lab Then h = 2
                      Dim outp As Variant
                      ReDim outp(1 To 3, 1 To h)
                      
                      If lab Then
                          outp(1, 1) = "I-stat"
                          outp(2, 1) = "I-crit .05"
                          outp(3, 1) = "I-crit .10"
                      End If
                      
                      Dim xarr As Variant
                      xarr = xarray
                      Dim n As Long
                      n = UBound(xarr, 1)
                      Dim nn As Long
                      nn = n - 1
                      Dim i As Long
                      Dim j As Long
                      Dim k As Long
                      Dim temp As Double
                      Dim temp1 As Double
                      Dim temp2 As Double
                      Dim p As Double
                      Dim g As Double
                      Dim a As Double
                      Dim b As Double
                      Dim aa As Double
                      Dim bb As Double
                      Dim vect As Variant
                      
                      ' use numeric values for dist instead of text
                      If dist = "norm" Then
                          dist = 1
                      ElseIf dist = "uniform" Or dist = 6 Then
                          dist = 0
                      ElseIf dist = "expon" Then
                          dist = 2
                      ElseIf dist = "weibull" Then
                          dist = 3
                      ElseIf dist = "gumbel" Then
                          dist = 7
                      ElseIf dist = "logistic" Then
                          dist = 8
                      ElseIf dist = "laplace" Then
                          dist = 10
                      ElseIf dist = "lognorm" Then
                          dist = 9
                      ElseIf dist = "cauchy" Then
                          dist = 12
                      ElseIf dist = "mnorm" Then
                          dist = 20
                      End If
                      
                      ' lognormal
                      If dist = 9 Then
                          For i = 1 To n
                              xarr(i, 1) = Log(xarr(i, 1))
                          Next
                          dist = 1
                      ElseIf dist = 3 Then
                          For i = 1 To n
                              xarr(i, 1) = -Log(xarr(i, 1))
                          Next
                          dist = 7
                      End If
                      
                      ' get a and b (theta parameters)
                      With WorksheetFunction
                          If Not IsMissing(param2) Then
                              a = param1
                              b = param2
                          ElseIf dist = 1 Then
                              If iter = 0 Then
                                  a = .Average(xarr)
                                  b = .StDev_S(xarr)
                              Else
                                  a = .Average(xarr)
                                  b = .StDev_P(xarr)
                              End If
                          ElseIf dist = 0 Then
                              aa = .Min(xarr)
                              bb = .Max(xarr)
                              a = (bb + aa) / 2
                              b = (bb - aa) / 2
                          ElseIf dist = 2 Then
                              If IsMissing(param1) Then
                                  a = .Min(xarr)
                              Else
                                  a = param1
                              End If
                              b = .Average(xarr) - a
                          ElseIf dist = 7 Then
                              If iter > 0 Then
                                  ReDim vect(1 To 3, 1 To 1)
                                  vect = GUMBEL_FIT(xarr, , iter)
                                  a = vect(1, 1)
                                  b = vect(2, 1)
                              ElseIf iter = 0 Then
                                  b = .StDev_S(xarr) * Sqr(6) / (4 * Atn(1))
                                  a = .Average(xarr) - b * POLYGAMMA(1)
                              Else
                                  b = .StDev_P(xarr) * Sqr(6) / (4 * Atn(1))
                                  a = .Average(xarr) - b * POLYGAMMA(1)
                              End If
                          ElseIf dist = 8 Then
                              If iter > 0 Then
                                  ReDim vect(1 To 3, 1 To 1)
                                  vect = LOGISTIC_FIT(xarr, , iter)
                                  a = vect(1, 1)
                                  b = vect(2, 1)
                              ElseIf iter = 0 Then
                                  a = .Average(xarr)
                                  b = .StDev_S(xarr) * Sqr(3) / (4 * Atn(1))
                              Else
                                  a = .Average(xarr)
                                  b = .StDev_P(xarr) * Sqr(3) / (4 * Atn(1))
                              End If
                          ElseIf dist = 10 Then
                              a = .Median(xarr)
                              b = 0
                              For i = 1 To n
                                  b = b + Abs(xarr(i, 1) - a)
                              Next
                              b = b / n
                          ElseIf dist = 12 Then
                              ReDim vect(1 To 3, 1 To 1)
                              If iter > 0 Then
                                  vect = CAUCHY_FIT(array1, , iter)
                              ElseIf iter = 0 Then
                                  vect = CAUCHY_FITM(xarray, , False, True)
                              ElseIf iter = -1 Then
                                  vect = CAUCHY_FITM(xarray, , True, True)
                              Else
                                  vect = CAUCHY_FITX(xarray)
                              End If
                              a = vect(1, 1)
                              If iter = -3 Then a = a * n / (n + 1)
                              b = vect(2, 1)
                          End If
                      End With
                      
                      ' get zarr (normalized xarr)
                      Dim zarr As Variant
                      Dim d As Long
                      Dim marr As Variant
                      Dim sarr As Variant
                      Dim tarr As Variant
                      If dist <> 20 Then
                          ReDim zarr(1 To n)
                          For i = 1 To n
                              zarr(i) = (xarr(i, 1) - a) / b
                          Next
                          If dist = 7 Then
                              ReDim marr(1 To n)
                              For i = 1 To n
                                  marr(i) = Exp(-zarr(i))
                              Next
                          End If
                      Else
                          d = UBound(xarr, 2)
                          ReDim zarr(1 To n, 1 To d)
                          ReDim marr(1 To 1, 1 To d)
                          ReDim sarr(1 To d, 1 To d)
                          marr = MEANCOL(xarray)
                          sarr = COV(xarray)
                          tarr = WorksheetFunction.MInverse(sarr)
                          sarr = MSQRT(tarr)
                          For j = 1 To d
                              temp1 = marr(1, j)
                              For i = 1 To n
                                  xarr(i, j) = xarr(i, j) - temp1
                              Next
                          Next
                          zarr = WorksheetFunction.MMult(xarr, sarr)
                      End If
                      
                      temp1 = 0#
                      temp2 = 0#
                      
                      If dist = 1 Then
                          For i = 1 To nn
                              temp1 = temp1 + Exp(-(zarr(i) ^ 2) / 6)
                              For j = i + 1 To n
                                  temp2 = temp2 + Exp(-(zarr(i) - zarr(j)) ^ 2 / 4)
                              Next
                          Next
                          temp1 = temp1 + Exp(-(zarr(n) ^ 2) / 6)
                          outp(1, h) = 1# + n / Sqr(2) - 2 * Sqr(2 / 3) * temp1 + 2 * temp2 / n
                          outp(2, h) = 0.361 - 0.25 / Sqr(n) + 1.41 / n - 3.4 / Sqr(n) ^ 3
                          outp(3, h) = 0.121 - 0.18 / Sqr(n) + 0.85 / n - 2 / Sqr(n) ^ 3
                          
                      ElseIf dist = 0 Then
                          For i = 1 To nn
                              temp1 = temp1 + zarr(i) ^ 2
                              For j = i + 1 To n
                                  temp2 = temp2 + Abs(zarr(i) - zarr(j))
                              Next
                          Next
                          temp1 = temp1 + zarr(n) ^ 2
                          outp(1, h) = n / 6 + temp1 / 2 - temp2 / n
                          outp(2, h) = 0.929 + 0.03 / Sqr(n) - 0.83 / n + 0.44 / Sqr(n) ^ 3
                          outp(3, h) = 0.701 - 0.064 / Sqr(n) + 0.84 / n - 1 / Sqr(n) ^ 3
                          
                      ElseIf dist = 2 Then
                          For i = 1 To nn
                              temp1 = temp1 + (2 * zarr(i) + 1) * Exp(-zarr(i))
                              For j = i + 1 To n
                                  temp2 = temp2 + Exp(-Abs(zarr(i) - zarr(j)))
                              Next
                          Next
                          temp1 = temp1 + (2 * zarr(n) + 1) * Exp(-zarr(n))
                          outp(1, h) = 1# + n / 2 - temp1 + 2 * temp2 / n
                          If IsMissing(param1) Then
                              outp(2, h) = 0.785 - 0.29 / Sqr(n) + 1.3 / n - 2.1 / Sqr(n) ^ 3
                              outp(3, h) = 0.635 + 0.022 / Sqr(n) - 0.36 / n + 0.75 / Sqr(n) ^ 3
                          Else
                              outp(2, h) = 0.785
                              outp(3, h) = 0.635
                          End If
                      
                      ElseIf dist = 7 Then
                          For i = 1 To nn
                              temp1 = temp1 + marr(i) * ((marr(i) + 1) * Exp(marr(i)) * Ei(-marr(i)) + 1)
                              For j = i + 1 To n
                                  temp2 = temp2 + (marr(i) * marr(j)) / (marr(i) + marr(j)) ^ 2
                              Next
                          Next
                          temp1 = temp1 + marr(n) * ((marr(n) + 1) * Exp(marr(n)) * Ei(-marr(n)) + 1)
                          outp(1, h) = 1# + 2 * n / 3 + 8 * temp1 + 8 * temp2 / n
                          outp(2, h) = 0.2946 - 0.2 / Sqr(n) + 0.8 / n - 1.4 / Sqr(n) ^ 3
                          outp(3, h) = 0.226 - 0.106 / Sqr(n) + 0.42 / n - 0.8 / Sqr(n) ^ 3
                          
                      ElseIf dist = 8 Then
                          p = 4 * Atn(1)  ' pi
                          For i = 1 To nn
                              temp = 1 / (1 + 1 / Exp(zarr(i))) ' hi
                              temp1 = temp1 + temp * (zarr(i) ^ 2 + 6 * zarr(i) + 6 + p ^ 2)
                              temp1 = temp1 - temp ^ 2 * (7 * zarr(i) ^ 2 + 18 * zarr(i) + 6 + 7 * p ^ 2)
                              temp1 = temp1 + 12 * temp ^ 3 * (zarr(i) ^ 2 + zarr(i) + p ^ 2) - 6 * temp ^ 4 * (zarr(i) ^ 2 + p ^ 2)
                              For j = i + 1 To n
                                  temp = zarr(i) - zarr(j)    ' dij
                                  g = 1 / (1 - 1 / Exp(temp))
                                  temp2 = temp2 + (temp + 2) * g - (3 * temp + 2) * g ^ 2 + 2 * temp * g ^ 3
                              Next
                          Next
                          temp = 1 / (1 + 1 / Exp(zarr(n))) ' hi
                          temp1 = temp1 + temp * (zarr(n) ^ 2 + 6 * zarr(n) + 6 + p ^ 2)
                          temp1 = temp1 - temp ^ 2 * (7 * zarr(n) ^ 2 + 18 * zarr(n) + 6 + 7 * p ^ 2)
                          temp1 = temp1 + 12 * temp ^ 3 * (zarr(n) ^ 2 + zarr(n) + p ^ 2) - 6 * temp ^ 4 * (zarr(n) ^ 2 + p ^ 2)
                          outp(1, h) = 1# + 0.684 * n - 6 * temp1 + 12 * temp2 / n
                          outp(2, h) = 0.315 + 0.345 / Sqr(n) - 5.67 / n + 19.65 / Sqr(n) ^ 3 - 26.64 / n ^ 2
                          outp(3, h) = 0.246 + 0.153 / Sqr(n) - 2.925 / n + 8.01 / Sqr(n) ^ 3 - 9.36 / n ^ 2
                          
                      ElseIf dist = 10 Then
                          For i = 1 To nn
                              temp1 = temp1 + (3 * Abs(zarr(i)) + zarr(i) ^ 2 + 3) * Exp(-Abs(zarr(i)))
                              For j = i + 1 To n
                                  temp2 = temp2 + (Abs(zarr(i) - zarr(j)) + 1) * Exp(-Abs(zarr(i) - zarr(j)))
                              Next
                          Next
                          temp1 = temp1 + (3 * Abs(zarr(n)) + zarr(n) ^ 2 + 3) * Exp(-Abs(zarr(n)))
                          outp(1, h) = 1# + 5 * n / 8 - temp1 / 2 + 2 * temp2 / n
                          outp(2, h) = 0.348 - 0.04 / Sqr(n) - 5.67 / n + 19.65 / Sqr(n) ^ 3
                          outp(3, h) = 0.283 + 0.06 / Sqr(n) - 2.925 / n + 8.01 / Sqr(n) ^ 3
                          
                      ElseIf dist = 12 Then
                          For i = 1 To nn
                              temp1 = temp1 + 1 / (zarr(i) ^ 2 + 9)
                              For j = i + 1 To n
                                  temp2 = temp2 + 1 / ((zarr(i) - zarr(j)) ^ 2 + 4)
                              Next
                          Next
                          temp1 = temp1 + 1 / (zarr(n) ^ 2 + 9)
                          outp(1, h) = 1# + n / 2 - 12 * temp1 + 8 * temp2 / n
                          outp(2, h) = 0.151 + 12.56 / Sqr(n) - 177.5 / n + 1092 / Sqr(n) ^ 3 - 2020 / n ^ 2
                          outp(3, h) = 0.342 + 1.9 / Sqr(n) - 25.3 / n + 199 / Sqr(n) ^ 3 - 403 / n ^ 2
                          
                      ElseIf dist = 20 Then
                          For i = 1 To nn
                              temp = 0#
                              For k = 1 To d
                                  temp = temp + zarr(i, k) ^ 2
                              Next
                              temp1 = temp1 + Exp(-(temp / 6))
                              For j = i + 1 To n
                                  temp = 0#
                                  For k = 1 To d
                                      temp = temp + (zarr(i, k) - zarr(j, k)) ^ 2
                                  Next
                                  temp2 = temp2 + Exp(-(temp / 4))
                              Next
                          Next
                          temp = 0#
                          For j = 1 To d
                              temp = temp + zarr(n, j) ^ 2
                          Next
                          temp1 = temp1 + Exp(-(temp / 6))
                          outp(1, h) = 1# + n / 2 ^ (d / 2) - 2 * (2 / 3) ^ (d / 2) * temp1 + 2 * temp2 / n
                          If d = 2 Then
                              outp(2, h) = 0.27 - 0.556 / Sqr(n) + 5.8 / n - 27.6 / Sqr(n) ^ 3 + 41.6 / n ^ 2
                              outp(3, h) = 0.224 - 0.376 / Sqr(n) + 3.8 / n - 18.6 / Sqr(n) ^ 3 + 27.8 / n ^ 2
                          ElseIf d = 3 Then
                              outp(2, h) = 0.351 - 0.06 / Sqr(n) + 0.08 / n - 2 / Sqr(n) ^ 3
                              outp(3, h) = 0.314 - 0.06 / Sqr(n) - 0.06 / n - 1.4 / Sqr(n) ^ 3
                          ElseIf d = 4 Then
                              outp(2, h) = 0.448 - 0.12 / Sqr(n) + 0.12 / n - 2.24 / Sqr(n) ^ 3
                              outp(3, h) = 0.412 - 0.12 / Sqr(n) + 0.28 / n - 2.4 / Sqr(n) ^ 3
                          ElseIf d = 5 Then
                              outp(2, h) = 0.531 - 0.079 / Sqr(n) - 0.11 / n - 1.7 / Sqr(n) ^ 3
                              outp(3, h) = 0.498 - 0.057 / Sqr(n) - 1078 / n - 1.58 / Sqr(n) ^ 3
                          End If
                         
                      End If
                      
                      ICF_GOF = outp
                      
                  End Function
                  

                  General
                  Stream Path:VBA/Init
                  VBA File Name:Init
                  Stream Size:3250
                  Data ASCII:. . . . . . . . : . . . . . . . . . B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . . < 2 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . . . `
                  Data Raw:01 16 03 00 01 f0 00 00 00 3a 03 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 42 03 00 00 a6 09 00 00 00 00 00 00 01 00 00 00 d4 1f f3 80 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Init"
                  Sub InitStats()
                  Attribute InitStats.VB_ProcData.VB_Invoke_Func = " \n14"
                  '
                  ' Initate statistics capabilities
                  '
                  ' Keyboard Shortcut: Ctrl+m
                  '
                  '    RangeSave = False
                  '    Application.MacroOptions Macro:="InitStats", HasShortcutKey:=True, ShortcutKey:="M"
                      If ThisWorkbook.Sheets("Config").Range("B3") = "" Then
                          frmInput.Show vbModeless
                      Else
                          frmMenu.Show vbModeless
                      End If
                  
                  End Sub
                  
                  ' Sub RegisterFunction()
                  '    Application.MacroOptions Macro:="InitStats", HasShortcutKey:=True, ShortcutKey:="M"
                  ' End Sub
                  
                  Sub RSRibbon()
                  Attribute RSRibbon.VB_ProcData.VB_Invoke_Func = "M\n14"
                  '
                  ' RealStatsRibbon Macro
                  ' Add Real Statistics to the AddIns ribbon
                  '
                  ' Keyboard Shortcut: Ctrl+Shift+M
                  '
                      On Error Resume Next
                          
                      Dim barre As CommandBarPopup
                      Set barre = Application.CommandBars("Worksheet Menu Bar").FindControl(, , "Real Statistics", , False)
                      
                      If (barre.Caption = "") Then
                      
                          Set barre = Application.CommandBars("Worksheet Menu Bar").Controls.Add(msoControlPopup, , , , True)
                      
                          barre.Caption = "Real Statistics"
                          barre.Tag = "Real Statistics"
                          
                          With barre.Controls.Add(msoControlButton)
                            .Caption = "Data Analysis Tools"
                            .FaceId = 43
                            .OnAction = "InitStats"
                          End With
                                   
                      End If
                  
                  End Sub
                  

                  General
                  Stream Path:VBA/LambdaLike
                  VBA File Name:LambdaLike
                  Stream Size:227168
                  Data ASCII:. . . . . . . . B . . . . . . . . . . . . . O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . . . . . . . . . |
                  Data Raw:01 16 03 00 06 f0 00 00 00 42 bd 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 85 bd 00 00 cd b7 02 00 4f 00 00 00 01 00 00 00 d4 1f d6 8d 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "LambdaLike"
                  ' Lambda
                  
                  Sub FindNextAddr(s As String, ByRef begin As Long, ByRef last As Long)
                  ' begin = index of the start of the next cell address in s starting with initial value of begin
                  ' last = index of the end of the address + 1; if no address is found then begin = 0
                  
                      Dim state As Long
                      state = 0
                      Dim n As Long       ' length of s
                      n = Len(s)
                      Dim m As Long
                      m = begin
                      begin = 0
                      Dim c As String     ' current character
                      For last = m To n
                          c = Mid(s, last, 1)
                          If state = 0 Then
                              If c >= "A" And c <= "Z" Then
                                  state = 1
                                  begin = last
                              ElseIf c = ")" Or c = "+" Or c = "-" Or c = "*" Or c = "/" Or c = "^" Or                 c = "&" Or c = "," Or c = "=" Or c = ">" Or c = "<" Or c = "(" Then
                              Else
                                  state = 2
                              End If
                          ElseIf state = 1 Then
                              If c >= "A" And c <= "Z" Then
                              ElseIf c >= "1" And c <= "9" Then
                                  state = 3
                              Else
                                  state = 0
                                  begin = 0
                              End If
                          ElseIf state = 2 Then
                              If c = ")" Or c = "+" Or c = "-" Or c = "*" Or c = "/" Or c = "^" Or                 c = "&" Or c = "," Or c = "=" Or c = ">" Or c = "<" Or c = "(" Then
                                  state = 0
                                  begin = 0
                              End If
                          ElseIf state = 3 Then
                              If c >= "0" And c <= "9" Then
                              ElseIf c = ")" Or c = "+" Or c = "-" Or c = "*" Or c = "/" Or c = "^" Or                 c = "&" Or c = "," Or c = "=" Or c = ">" Or c = "<" Then
                                  Exit Sub    ' address found
                              Else
                                  state = 2
                              End If
                          End If
                      Next
                      
                      If state <> 3 Then begin = 0
                          
                  End Sub
                  
                  Sub ReplaceAddrs(ByRef ss As String, Optional sx As String = "", Optional parnum As Long = 0, Optional ByRef begin As Long = 1)
                  ' replaces all occurrences of sx in ss by "##" & CStr(parnum)
                  ' if sx = "" then find the next address; if no match begin = 0, otherwise it is increased
                  ' if sx <> "" then begin = -1 if no match is found, and begin = 1 otherwise
                  
                      Dim n As Long
                      n = Len(ss)
                      Dim m As Long       ' length of sx
                      Dim s As String
                      s = "##" & CStr(parnum)
                  
                      Dim k As Long
                      If sx = "" Then
                          Call FindNextAddr(ss, begin, k)
                          If begin > 0 Then
                              m = k - begin
                              sx = Mid(ss, begin, m)
                              ss = Mid(ss, 1, begin - 1) & s & Mid(ss, k)
                              n = n - m + 5
                              k = begin + 6
                              begin = k
                          Else
                              Exit Sub
                          End If
                      Else
                          k = begin
                          m = Len(sx)
                  '        begin = -1  ' set to no match until a match is found
                      End If
                      
                      Do While k <= n
                          Call FindParam(ss, sx, k)
                          If k > 0 Then
                              ss = Mid(ss, 1, k - 1) & s & Mid(ss, k + m)
                              n = n - m + 5
                              k = k + 6
                   '           If begin < 0 Then begin = 1 ' only used when sx was originally not empty
                          Else
                              Exit Sub
                          End If
                      Loop
                      
                  End Sub
                  
                  Sub FindParam(ss As String, sx As String, Optional ByRef begin As Long = 1)
                  ' set begin = index of the parameter sx in ss starting with begin; if none exists set begin = 0
                  
                      Dim n As Long       ' length of ss
                      n = Len(ss)
                      Dim m As Long       ' length of sx
                      m = Len(sx)
                      Dim k As Long       ' points to next character after first occurrence of sx in ss
                      Dim c As String     ' first character after first occurrence of sx in ss
                      
                      Do While begin <= n
                          begin = InStr(begin, ss, sx)
                          If begin = 0 Then Exit Sub
                          k = begin + m
                          If begin > 1 Then
                              c = Mid(ss, begin - 1, 1)
                              If c = "(" Or c = "+" Or c = "-" Or c = "*" Or c = "/" Or c = "^" Or               c = "&" Or c = "," Or c = "=" Or c = ">" Or c = "<" Or c = ")" Then
                              Else
                                  GoTo cont   ' continue looping
                              End If
                          End If
                          If k >= n Then Exit Sub
                          c = Mid(ss, k, 1)
                          If c = "(" Or c = "+" Or c = "-" Or c = "*" Or c = "/" Or c = "^" Or           c = "&" Or c = "," Or c = "=" Or c = ">" Or c = "<" Or c = ")" Then Exit Sub
                  cont:
                          begin = k + 1
                      Loop
                      
                      begin = 0
                      
                  End Sub
                  
                  Sub FindNextParam(s As String, ByRef begin As Long, ByRef last As Long)
                  ' begin = index of the start of the next parameter in s starting with initial value of begin
                  ' last = index of the end of the address + 1; if no address is found then begin = 0
                  
                      Dim state As Long
                      state = 0
                      Dim n As Long       ' length of s
                      n = Len(s)
                      Dim m As Long
                      m = begin
                      begin = 0
                      Dim c As String     ' current character
                      For last = m To n
                          c = Mid(s, last, 1)
                          If state = 0 Then
                              If c = "$" Then
                                  state = 1
                                  begin = last
                              End If
                          ElseIf state = 1 Then
                              If (c >= "A" And c <= "Z") Or (c >= "a" And c <= "z") Then
                                  state = 2
                              Else
                                  state = 0
                                  begin = 0
                              End If
                          ElseIf state = 2 Then
                              If (c >= "A" And c <= "Z") Or (c >= "a" And c <= "z") Or (c >= "0" And c <= "9") Or c = "_" Then
                              Else
                                  Exit Sub
                              End If
                           End If
                      Next
                      
                      If state <> 2 Then begin = 0
                          
                  End Sub
                  
                  Sub ReplaceParams(ByRef ss As String, Optional sx As String = "", Optional parnum As Long = 0, Optional ByRef begin As Long = 1)
                  ' replaces all occurrences of sx in ss by "##" & CStr(parnum)
                  ' if sx = "" then find the next $ parameter or address; if no match begin = 0, otherwise it is increased
                  ' if sx <> "" then begin = -1 if no match is found, and begin = 1 otherwise
                  
                      Dim n As Long
                      n = Len(ss)
                      Dim m As Long       ' length of sx
                      Dim s As String
                      s = "##" & CStr(parnum)
                  
                      Dim k As Long
                      If sx = "" Then
                          Call FindNextParam(ss, begin, k)
                          If begin > 0 Then
                              m = k - begin
                              sx = Mid(ss, begin, m)
                              ss = Mid(ss, 1, begin - 1) & s & Mid(ss, k)
                              n = n - m + 5
                              k = begin + 6
                              begin = k
                          Else
                              Exit Sub
                          End If
                      Else
                          k = begin
                          m = Len(sx)
                  '        begin = -1  ' set to no match until a match is found
                      End If
                      
                      Do While k <= n
                          Call FindParam(ss, sx, k)
                          If k > 0 Then
                              ss = Mid(ss, 1, k - 1) & s & Mid(ss, k + m)
                              n = n - m + 5
                              k = k + 6
                  '            If begin < 0 Then begin = 1 ' only used when sx was originally not empty
                          Else
                              Exit Sub
                          End If
                      Loop
                      
                  End Sub
                  
                  Function LAMB(expression As Variant, ParamArray args() As Variant) As String
                  
                      On Error GoTo ErrTrap
                      
                      Dim parnum As Long
                      Dim ss As String
                      parnum = 0
                      Dim begin As Long
                      begin = 1
                      Dim i As Long   ' index to args
                      i = 0
                      Dim n As Long
                      n = UBound(args)
                      Dim sx As String
                      
                      If TypeName(expression) = "Range" Then
                          If expression.HasFormula Then
                              ss = expression.Formula
                              Do
                                  If i <= n Then
                                      sx = args(i).Address(False, False)
                                      Call ReplaceAddrs(ss, sx, parnum, begin)
                                      i = i + 1
                  '                    If begin > 0 Then
                  '                        parnum = parnum + 1
                  '                    ElseIf begin < 0 Then
                  '                        begin = 1
                  '                    End If
                                      begin = 1   ' remove if you add back the commented out steps
                                  Else
                                      Call ReplaceAddrs(ss, , parnum, begin)
                  '                    If begin > 0 Then parnum = parnum + 1
                                  End If
                                  parnum = parnum + 1 ' remove if you add back the commented out steps
                              Loop Until begin = 0
                              LAMB = ss
                              Exit Function
                          End If
                      End If
                      
                      ss = expression
                     
                      Do
                          If i <= n Then
                              sx = args(i)
                              Call ReplaceParams(ss, sx, parnum, begin)
                              i = i + 1
                  '            If begin > 0 Then
                  '                parnum = parnum + 1
                  '            ElseIf begin < 0 Then
                  '                begin = 1
                  '            End If
                              begin = 1   ' remove if you add back the commented out steps
                          Else
                              Call ReplaceParams(ss, , parnum, begin)
                  '            If begin > 0 Then parnum = parnum + 1
                          End If
                          parnum = parnum + 1 ' remove if you add back the commented out steps
                      Loop Until begin = 0
                      LAMB = ss
                      Exit Function
                  
                  ErrTrap:
                      sx = ""
                      Resume Next
                  End Function
                  
                  Sub sLAMB(expression As Variant, ss As String)
                      
                      Dim nvar As Long
                      nvar = 0
                      Dim begin As Long
                      Dim sx As String
                      
                      If TypeName(expression) = "Range" Then
                          If expression.HasFormula Then
                              ss = expression.Formula
                              Do
                                  begin = 1
                                  Call ReplaceAddrs(ss, , nvar, begin)
                                  nvar = nvar + 1
                              Loop Until begin <= 0
                              Exit Sub
                          End If
                      End If
                      
                      ss = expression
                      Do
                          begin = 1
                          Call ReplaceParams(ss, , nvar, begin)
                          nvar = nvar + 1
                      Loop Until begin <= 0
                  
                  End Sub
                  
                  ' Lambda evaluation
                  
                  Function EVALS(expression As Variant, ParamArray args() As Variant) As Variant
                  ' evaluates expression at the specifed values
                      
                      Dim ss As String
                      Dim i As Long   ' index to args
                      Dim n As Long
                      n = UBound(args)
                      Dim s As String
                      Dim x As Variant
                      Dim c As String
                      c = """"
                      
                      If InStr(1, expression, "##") > 0 Then
                          ss = expression
                      Else
                          Call sLAMB(expression, ss)
                      End If
                      
                      For i = 0 To n
                          x = args(i)
                          If VarType(x) = vbString Then
                              s = c & x & c
                          ElseIf VarType(x) >= vbArray Then
                              s = Array2String(x)
                          Else
                              s = "(" & CStr(x) & ")"
                          End If
                          ss = Replace(ss, "##" & CStr(i), s)
                      Next
                   
                      EVALS = Application.Evaluate(ss)
                  
                  End Function
                  
                  Function EVALArray(expression As Variant, xarray As Variant) As Variant
                  Attribute EVALArray.VB_Description = "returns f(xarray)"
                  Attribute EVALArray.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' evaluates expression at the specifed values
                  
                      Dim xarr As Variant
                      xarr = xarray
                      Dim n As Long
                      n = UBound(xarr, 1)
                      
                      Dim ss As String
                      Dim i As Long   ' index to args
                      Dim s As String
                      Dim x As Variant
                      Dim c As String
                      c = """"
                      
                      If InStr(1, expression, "##") > 0 Then
                          ss = expression
                      Else
                          Call sLAMB(expression, ss)
                      End If
                      
                      For i = 1 To n
                          x = xarr(i, 1)
                          If VarType(x) = vbString Then
                              s = c & x & c
                          ElseIf VarType(x) >= vbArray Then
                              s = Array2String(x)
                          Else
                              s = "(" & CStr(x) & ")"
                          End If
                          ss = Replace(ss, "##" & CStr(i - 1), s)
                      Next
                   
                      EVALArray = Application.Evaluate(ss)
                  
                  End Function
                  
                  ' lambda-like functions
                      
                  Function BYCOLS(array1 As Variant, expression As Variant, Optional col As Variant) As Variant
                  Attribute BYCOLS.VB_Description = "returns a m x 1 array whose elements are obtained by applying the formula to each column in array1"
                  Attribute BYCOLS.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' return a row array with results of applying the expression defined by expression(col) to each column in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim outp As Variant
                      ReDim outp(1 To 1, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      Dim c As String
                      c = """"
                      Dim s1 As String
                      Dim s As String
                      Dim ss As String
                      
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, col)
                          End If
                      Else
                          ss = LAMB(expression, col)
                      End If
                      
                      For j = 1 To n
                          If VarType(arr(1, j)) = vbString Then
                              s = "{" & c & arr(1, j) & c
                          Else
                              s = "{" & CStr(arr(1, j))
                          End If
                          For i = 2 To m
                              If VarType(arr(i, j)) = vbString Then
                                  s = s & "," & c & arr(i, j) & c
                              Else
                                  s = s & "," & CStr(arr(i, j))
                              End If
                          Next
                          s = s & "}"
                          s1 = Replace(ss, "##0", s)
                          outp(1, j) = Application.Evaluate(s1)
                      Next
                      
                      BYCOLS = outp
                      
                  End Function
                  
                  Function BYROWS(array1 As Variant, expression As Variant, Optional row As Variant) As Variant
                  Attribute BYROWS.VB_Description = "returns a 1 x n array whose elements are obtained by applying the formula to each row in array1"
                  Attribute BYROWS.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' return a col array with results of applying the expression defined by ss(sx) to each column in array1
                  
                      Dim arr As Variant
                      arr = array1
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim outp As Variant
                      ReDim outp(1 To m, 1 To 1)
                      Dim i As Long
                      Dim j As Long
                      Dim c As String
                      c = """"
                      Dim s1 As String
                      Dim s As String
                      Dim ss As String
                      
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, row)
                          End If
                      Else
                          ss = LAMB(expression, row)
                      End If
                      
                      For i = 1 To m
                          If VarType(arr(i, 1)) = vbString Then
                              s = "{" & c & arr(i, 1) & c
                          Else
                              s = "{" & CStr(arr(i, 1))
                          End If
                          For j = 2 To n
                              If VarType(arr(i, j)) = vbString Then
                                  s = s & "," & c & arr(i, j) & c
                              Else
                                  s = s & "," & CStr(arr(i, j))
                              End If
                          Next
                          s = s & "}"
                          s1 = Replace(ss, "##0", s)
                          outp(i, 1) = Application.Evaluate(s1)
                      Next
                      
                      BYROWS = outp
                      
                  End Function
                  
                  Function MAKESARRAY(nrows As Long, ncols As Long, expression As Variant,     Optional row As Variant, Optional col As Variant) As Variant
                  Attribute MAKESARRAY.VB_Description = "returns an nrows x ncols array whose elements are defined by applying the formula to each row/col combination"
                  Attribute MAKESARRAY.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' return an nrows x ncols array with results of applying the expression defined by expression(row, col)
                  ' to each element (row, col) in the array
                  
                      Dim outp As Variant
                      ReDim outp(1 To nrows, 1 To ncols)
                      Dim i As Long
                      Dim j As Long
                      
                      Dim s1 As String
                      Dim s2 As String
                      Dim ss As String
                  
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, row, col)
                          End If
                      Else
                          ss = LAMB(expression, row, col)
                      End If
                      
                      For i = 1 To nrows
                          s1 = Replace(ss, "##0", "(" & CStr(i) & ")")
                          For j = 1 To ncols
                              s2 = Replace(s1, "##1", "(" & CStr(j) & ")")
                              outp(i, j) = Application.Evaluate(s2)
                          Next
                      Next
                      
                      MAKESARRAY = outp
                      
                  End Function
                  
                  Function MAPS(array1 As Variant, expression As Variant, Optional element As Variant) As Variant
                  Attribute MAPS.VB_Description = "returns an array of te same size and shape as array1 whose elements are obtained by applying the formula to each element value in array1"
                  Attribute MAPS.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' return an nrows x ncols array with results of applying the expression defined by expression(element) to each element in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                  
                      Dim outp As Variant
                      ReDim outp(1 To m, 1 To n)
                      Dim i As Long
                      Dim j As Long
                      
                      Dim s1 As String
                      Dim ss As String
                      Dim c As String
                      c = """"
                      
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, element)
                          End If
                      Else
                          ss = LAMB(expression, element)
                      End If
                      
                      For i = 1 To m
                          For j = 1 To n
                              If VarType(arr(i, j)) = vbString Then
                                  s1 = Replace(ss, "##0", c & arr(i, j) & c)
                              Else
                                  s1 = Replace(ss, "##0", "(" & CStr(arr(i, j)) & ")")
                              End If
                              outp(i, j) = Application.Evaluate(s1)
                          Next
                      Next
                      
                      MAPS = outp
                      
                  End Function
                  
                  Function REDUCES(init As Variant, array1 As Variant, expression As Variant, Optional element As Variant,     Optional accum As Variant) As Variant
                  Attribute REDUCES.VB_Description = "returns the value of the accumulator after applying the formula to each element value in array1"
                  Attribute REDUCES.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' return the value of the accumulator after applying the expression defined by expression(accum, element)
                  ' to each element in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim accumulator As Variant
                      accumulator = init
                      Dim i As Long
                      Dim j As Long
                      
                      Dim s1 As String
                      Dim s2 As String
                      Dim ss As String
                      Dim c As String
                      c = """"
                      
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, element, accum)
                          End If
                      Else
                          ss = LAMB(expression, element, accum)
                      End If
                      
                      For i = 1 To m
                          For j = 1 To n
                              If VarType(arr(i, j)) = vbString Then
                                  s1 = Replace(ss, "##0", c & arr(i, j) & c)
                              Else
                                  s1 = Replace(ss, "##0", "(" & CStr(arr(i, j)) & ")")
                              End If
                              If VarType(accumulator) = vbString Then
                                  s2 = Replace(s1, "##1", c & accumulator & c)
                              Else
                                  s2 = Replace(s1, "##1", "(" & CStr(accumulator) & ")")
                              End If
                              accumulator = Application.Evaluate(s2)
                          Next
                      Next
                      
                      REDUCES = accumulator
                      
                  End Function
                  
                  Function SCANS(init As Variant, array1 As Variant, expression As Variant, Optional element As Variant,     Optional accum As Variant) As Variant
                  Attribute SCANS.VB_Description = "returns an array of te same size and shape as array1 whose elements are the accumulator values obtained by applying the formula to each element value in array1"
                  Attribute SCANS.VB_ProcData.VB_Invoke_Func = " \n34"
                  ' returns an array of the same size and shape as array1, where the value of each element is
                  ' the value of the accumulator after applying the expression defined by expression(accum, element) to each element in array1
                  
                      Dim arr As Variant
                      arr = array1
                      Dim m As Long
                      m = UBound(arr, 1)
                      Dim n As Long
                      n = UBound(arr, 2)
                      Dim accumulator As Variant
                      accumulator = init
                      Dim i As Long
                      Dim j As Long
                      
                      Dim outp As Variant
                      ReDim outp(1 To m, 1 To n)
                      
                      Dim s1 As String
                      Dim s2 As String
                      Dim ss As String
                      Dim c As String
                      c = """"
                      
                      If VarType(expression) = vbString Then
                          If InStr(1, expression, "##") > 0 Then
                              ss = expression
                          Else
                              ss = LAMB(expression, element, accum)
                          End If
                      Else
                          ss = LAMB(expression, element, accum)
                      End If
                      
                      For i = 1 To m
                          For j = 1 To n
                              If VarType(arr(i, j)) = vbString Then
                                  s1 = Replace(s2, "##0", c & arr(i, j) & c)
                              Else
                                  s1 = Replace(ss, "##0", "(" & CStr(arr(i, j)) & ")")
                              End If
                              If VarType(accumulator) = vbString Then
                                  s2 = Replace(s1, "##1", c & accumulator & c)
                      

                  General
                  Stream Path:VBA/LevenbergMarquardt
                  VBA File Name:LevenbergMarquardt
                  Stream Size:72050
                  Data ASCII:. . . . . . . . . # . . . . . . . . . . # . . . . . . . . . . . . . b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . S . . . . . S . . . . . S . . . . . < . . . . . . . . . . N . 0 . { . F . C . F . B . 3 . D . 2 . A . - .
                  Data Raw:01 16 03 00 01 f0 00 00 00 0a 23 00 00 d4 00 00 00 00 02 00 00 ff ff ff ff 11 23 00 00 a9 d5 00 00 00 00 00 00 01 00 00 00 d4 1f 9e 62 00 00 ff ff 01 00 00 00 80 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "LevenbergMarquardt"
                  Attribute VB_Base = "0{FCFB3D2A-A0FA-1068-A738-08002B3371B5}"
                  Attribute VB_GlobalNameSpace = False
                  Attribute VB_Creatable = False
                  Attribute VB_PredeclaredId = False
                  Attribute VB_Exposed = False
                  Attribute VB_TemplateDerived = False
                  Attribute VB_Customizable = False
                  'Minpack Copyright Notice (1999) University of Chicago.  All rights reserved
                  '
                  'Redistribution and use in source and binary forms, with or
                  'without modification, are permitted provided that the
                  'following conditions are met:
                  '
                  '1. Redistributions of source code must retain the above
                  'copyright notice, this list of conditions and the following
                  'disclaimer.
                  '
                  '2. Redistributions in binary form must reproduce the above
                  'copyright notice, this list of conditions and the following
                  'disclaimer in the documentation and/or other materials
                  'provided with the distribution.
                  '
                  '3. The end-user documentation included with the
                  'redistribution, if any, must include the following
                  'acknowledgment:
                  '
                  '   "This product includes software developed by the
                  '   University of Chicago, as Operator of Argonne National
                  '   Laboratory.
                  '
                  'Alternately, this acknowledgment may appear in the software
                  'itself, if and wherever such third-party acknowledgments
                  'normally appear.
                  '
                  '4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
                  'WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
                  'UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
                  'THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
                  'IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
                  'OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
                  'OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
                  'OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
                  'USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
                  'THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
                  'DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
                  'UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
                  'BE CORRECTED.
                  '
                  '5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
                  'HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
                  'ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
                  'INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
                  'ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
                  'PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
                  'SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
                  '(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
                  'EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
                  'POSSIBILITY OF SUCH LOSS OR DAMAGES.
                  
                  '|--------------------------------------------------------------------------|'
                  '|--------------------------------------------------------------------------|'
                  '             Documentation for MINPACK subroutine LMDIF
                  '
                  '                        Double precision version
                  '
                  '                      Argonne National Laboratory
                  '
                  '         Burton S. Garbow, Kenneth E. Hillstrom, Jorge J. More
                  '
                  '                               March 1980
                  '
                  '
                  ' 1. Purpose.
                  '
                  '       The purpose of LMDIF is to minimize the sum of the squares of M
                  '       nonlinear functions in N variables by a modification of the
                  '       Levenberg-Marquardt algorithm.  The user must provide a subrou-
                  '       tine which calculates the functions.  The Jacobian is then cal-
                  '       culated by a forward-difference approximation.
                  '
                  '
                  ' 2. Subroutine and type statements.
                  '
                  '       SUBROUTINE LMDIF(FCN,M,N,X,FVEC,FTOL,XTOL,GTOL,MAXFEV,EPSFCN,
                  '      *                 DIAG,MODE,FACTOR,NPRINT,INFO,NFEV,FJAC,LDFJAC,
                  '      *                 IPVT,QTF,WA1,WA2,WA3,WA4)
                  '       INTEGER M,N,MAXFEV,MODE,NPRINT,INFO,NFEV,LDFJAC
                  '       INTEGER IPVT(N)
                  '       DOUBLE PRECISION FTOL,XTOL,GTOL,EPSFCN,FACTOR
                  '       DOUBLE PRECISION X(N),FVEC(M),DIAG(N),FJAC(LDFJAC,N),QTF(N),
                  '      *                 WA1(N),WA2(N),WA3(N),WA4(M)
                  '       EXTERNAL fcn
                  '
                  '
                  ' 3. Parameters.
                  '
                  '       Parameters designated as input parameters must be specified on
                  '       entry to LMDIF and are not changed on exit, while parameters
                  '       designated as output parameters need not be specified on entry
                  '       and are set to appropriate values on exit from LMDIF.
                  '
                  '       FCN is the name of the user-supplied subroutine which calculates
                  '         the functions.  FCN must be declared in an EXTERNAL statement
                  '         in the user calling program, and should be written as follows.
                  '
                  '         SUBROUTINE fcn(m, n, x, fvec, iflag)
                  '         INTEGER M,N,IFLAG
                  '         DOUBLE PRECISION X(N),FVEC(M)
                  '         ----------
                  '         CALCULATE THE FUNCTIONS AT X AND
                  '         RETURN THIS VECTOR IN FVEC.
                  '         ----------
                  '         Return
                  '         End
                  '
                  '
                  '         The value of IFLAG should not be changed by FCN unless the
                  '         user wants to terminate execution of LMDIF.  In this case set
                  '         IFLAG to a negative integer.
                  '
                  '       M is a positive integer input variable set to the number of
                  '         functions.
                  '
                  '       N is a positive integer input variable set to the number of
                  '         variables.  N must not exceed M.
                  '
                  '       X is an array of length N.  On input X must contain an initial
                  '         estimate of the solution vector.  On output X contains the
                  '         final estimate of the solution vector.
                  '
                  '       FVEC is an output array of length M which contains the functions
                  '         evaluated at the output X.
                  '
                  '       FTOL is a nonnegative input variable.  Termination occurs when
                  '         both the actual and predicted relative reductions in the sum
                  '         of squares are at most FTOL.  Therefore, FTOL measures the
                  '         relative error desired in the sum of squares.  Section 4 con-
                  '         tains more details about FTOL.
                  '
                  '       XTOL is a nonnegative input variable.  Termination occurs when
                  '         the relative error between two consecutive iterates is at most
                  '         XTOL.  Therefore, XTOL measures the relative error desired in
                  '         the approximate solution.  Section 4 contains more details
                  '         about XTOL.
                  '
                  '       GTOL is a nonnegative input variable.  Termination occurs when
                  '         the cosine of the angle between FVEC and any column of the
                  '         Jacobian is at most GTOL in absolute value.  Therefore, GTOL
                  '         measures the orthogonality desired between the function vector
                  '         and the columns of the Jacobian.  Section 4 contains more
                  '         details about GTOL.
                  '
                  '       MAXFEV is a positive integer input variable.  Termination occurs
                  '         when the number of calls to FCN is at least MAXFEV by the end
                  '         of an iteration.
                  '
                  '       EPSFCN is an input variable used in determining a suitable step
                  '         for the forward-difference approximation.  This approximation
                  '         assumes that the relative errors in the functions are of the
                  '         order of EPSFCN.  If EPSFCN is less than the machine preci-
                  '         sion, it is assumed that the relative errors in the functions
                  '         are of the order of the machine precision.
                  '
                  '       DIAG is an array of length N.  If MODE = 1 (see below), DIAG is
                  '         internally set.  If MODE = 2, DIAG must contain positive
                  '         entries that serve as multiplicative scale factors for the
                  '         variables.
                  '
                  '       MODE is an integer input variable.  If MODE = 1, the variables
                  '         will be scaled internally.  If MODE = 2, the scaling is
                  '         specified by the input DIAG.  Other values of MODE are equiva-
                  '         lent to MODE = 1.
                  '
                  '       FACTOR is a positive input variable used in determining the ini-
                  '         tial step bound.  This bound is set to the product of FACTOR
                  '         and the Euclidean norm of DIAG*X if nonzero, or else to FACTOR
                  '         itself.  In most cases FACTOR should lie in the interval
                  '         (.1,100.).  100. is a generally recommended value.
                  '
                  '       NPRINT is an integer input variable that enables controlled
                  '         printing of iterates if it is positive.  In this case, FCN is
                  '         called with IFLAG = 0 at the beginning of the first iteration
                  '         and every NPRINT iterations thereafter and immediately prior
                  '         to return, with X and FVEC available for printing.  If NPRINT
                  '         is not positive, no special calls of FCN with IFLAG = 0 are
                  '         made.
                  '
                  '       INFO is an integer output variable.  If the user has terminated
                  '         execution, INFO is set to the (negative) value of IFLAG.  See
                  '         description of FCN.  Otherwise, INFO is set as follows.
                  '
                  '         INFO = 0  Improper input parameters.
                  '
                  '         INFO = 1  Both actual and predicted relative reductions in the
                  '                   sum of squares are at most FTOL.
                  '
                  '         INFO = 2  Relative error between two consecutive iterates is
                  '                   at most XTOL.
                  '
                  '         INFO = 3  Conditions for INFO = 1 and INFO = 2 both hold.
                  '
                  '         INFO = 4  The cosine of the angle between FVEC and any column
                  '                   of the Jacobian is at most GTOL in absolute value.
                  '
                  '         INFO = 5  Number of calls to FCN has reached or exceeded
                  '                   MAXFEV.
                  '
                  '         INFO = 6  FTOL is too small.  No further reduction in the sum
                  '                   of squares is possible.
                  '
                  '         INFO = 7  XTOL is too small.  No further improvement in the
                  '                   approximate solution X is possible.
                  '
                  '         INFO = 8  GTOL is too small.  FVEC is orthogonal to the
                  '                   columns of the Jacobian to machine precision.
                  '
                  '         Sections 4 and 5 contain more details about INFO.
                  '
                  '       NFEV is an integer output variable set to the number of calls to
                  '         FCN.
                  '
                  '       FJAC is an output M by N array.  The upper N by N submatrix of
                  '         FJAC contains an upper triangular matrix R with diagonal ele-
                  '         ments of nonincreasing magnitude such that
                  '
                  '                T     T           T
                  '               P *(JAC *JAC)*P = R *R,
                  '
                  '         where P is a permutation matrix and JAC is the final calcu-
                  '         lated j
                  '|-------------------------------------------------------------------------|
                  '|-------------------------------------------------------------------------|
                  
                  Option Explicit
                  Private FunctionName_ As String
                  Public fvec As Variant
                  Private IndependentVariables_ As Variant
                  Private ObservedVariables_ As Variant
                  Private iflag_ As Variant
                  Public Jacobian As Variant
                  
                  Private Sub lmdif(fcn As String, m As Single, n As Single, x As Variant, fvec As Variant,       ftol As Double, xtol As Double, gtol As Double, maxfev As Single, epsfcn As Double,       DIAG As Variant, mode As Single, Factor As Double, nprint As Single,       info As Variant, nfev As Variant, fjac As Variant, ldfjac As Single,       ipvt As Variant, qtf As Variant, wa1 As Variant, wa2 As Variant,       wa3 As Variant, wa4 As Variant)
                  Dim i As Single
                  Dim iflag As Single
                  Dim ij As Single
                  Dim jj As Single
                  Dim iter As Single
                  Dim j As Single
                  Dim L As Single
                  Dim actred As Double
                  Dim delta As Double
                  delta = 0
                  Dim dirder As Double
                  Dim fnorm As Double
                  Dim fnorm1 As Double
                  Dim gnorm As Double
                  Dim par As Double
                  Dim pnorm As Double
                  Dim prered As Double
                  Dim ratio As Double
                  Dim sum1 As Double
                  Dim temp As Double
                  Dim temp1 As Double
                  Dim temp2 As Double
                  Dim temp3 As Double
                  Dim xnorm As Double
                  xnorm = 0
                  Dim one As Double
                  Dim p1 As Double
                  Dim p5 As Double
                  Dim p25 As Double
                  Dim p75 As Double
                  Dim p0001 As Double
                  Dim zero As Double
                  one = 1
                  p1 = 0.1
                  p5 = 0.5
                  p25 = 0.25
                  p75 = 0.75
                  p0001 = 0.0001
                  zero = 0
                  Dim epsmch As Double
                  '     epsmch is the machine precision.
                  epsmch = 1E-16
                  
                        info = 0
                        iflag = 0
                        nfev = 0
                  
                  '     check the input parameters for errors.
                        If ((n <= 0) Or (m < n) Or (ldfjac < m)          Or (ftol < zero) Or (xtol < zero) Or (gtol < zero)          Or (maxfev <= 0) Or (Factor <= zero)) Then GoTo L300
                        If (mode <> 2) Then GoTo L20
                        For j = 1 To n
                           If (DIAG(j) <= zero) Then GoTo L300
                        Next j
                        
                  L20:
                  '     evaluate the function at the starting point
                  '     and calculate its norm.
                        iflag = 1
                        LevenbergCostFunction m, n, x, fvec, iflag
                        nfev = 1
                        If (iflag < 0) Then GoTo L300
                        fnorm = myenorm(m, fvec)
                  
                  '     initialize levenberg-marquardt parameter and iteration counter.
                  
                        par = zero
                        iter = 1
                  
                  '     beginning of the outer loop.
                  '
                  L30:
                  
                  '        calculate the jacobian matrix.
                  
                           iflag = 2
                           fdjac2 m, n, x, fvec, fjac, ldfjac, iflag, epsfcn, wa4
                           nfev = nfev + n
                           If (iflag < 0) Then GoTo L300
                  
                  '        if requested, call fcn to enable printing of iterates.
                  
                           If (nprint <= 0) Then GoTo L40
                           iflag = 0
                           If (mymod(iter - 1, nprint) = 0) Then LevenbergCostFunction m, n, x, fvec, iflag
                           If (iflag < 0) Then GoTo L300
                  L40:
                  '
                  '        compute the qr factorization of the jacobian.
                  '
                           qrfac m, n, fjac, ldfjac, True, ipvt, n, wa1, wa2, wa3
                  '
                  '        on the first iteration and if mode is 1, scale according
                  '        to the norms of the columns of the initial jacobian.
                  '
                           If (iter <> 1) Then GoTo L80
                           If (mode = 2) Then GoTo L60
                           For j = 1 To n
                              DIAG(j) = wa2(j)
                              If (wa2(j) = zero) Then DIAG(j) = one
                           Next j
                  L60:
                  '
                  '        on the first iteration, calculate the norm of the scaled x
                  '        and initialize the step bound delta.
                  '
                           For j = 1 To n
                              wa3(j) = DIAG(j) * x(j)
                           Next j
                           xnorm = myenorm(n, wa3)
                           delta = Factor * xnorm
                           If (delta = zero) Then delta = Factor
                  
                  L80:
                  '
                  '        form (q transpose)*fvec and store the first n components in
                  '        qtf.
                  '
                           For i = 1 To m
                              wa4(i) = fvec(i)
                           Next i
                           For j = 1 To n
                              If (fjac(j, j) = zero) Then GoTo L120
                              sum1 = zero
                              For i = j To m
                                 sum1 = sum1 + fjac(i, j) * wa4(i)
                              Next i
                              temp = -sum1 / fjac(j, j)
                              For i = j To m
                                 wa4(i) = wa4(i) + fjac(i, j) * temp
                              Next i
                  L120:
                              fjac(j, j) = wa1(j)
                              qtf(j) = wa4(j)
                           Next j
                  '
                  '        compute the norm of the scaled gradient.
                  '
                           gnorm = zero
                           If (fnorm = zero) Then GoTo L170
                           For j = 1 To n
                              L = ipvt(j)
                              If (wa2(L) = zero) Then GoTo L150
                              sum1 = zero
                              For i = 1 To j
                                 sum1 = sum1 + fjac(i, j) * (qtf(i) / fnorm)
                              Next i
                              gnorm = dmax1(gnorm, dabs(sum1 / wa2(L)))
                  L150:
                           Next j
                  L170:
                  '
                  '        test for convergence of the gradient norm.
                  '
                           If (gnorm <= gtol) Then info = 4
                           If (info <> 0) Then GoTo L300
                  '
                  '        rescale if necessary.
                  '
                           If (mode = 2) Then GoTo L190
                           For j = 1 To n
                              DIAG(j) = dmax1(CDbl(DIAG(j)), CDbl(wa2(j)))
                           Next j
                  L190:
                  '
                  '        beginning of the inner loop.
                  '
                  L200:
                  '
                  '           determine the levenberg-marquardt parameter.
                  '
                              lmpar n, fjac, ldfjac, ipvt, DIAG, qtf, delta, par, wa1, wa2, wa3, wa4
                  '
                  '           store the direction p and x + p. calculate the norm of p.
                  '
                              For j = 1 To n
                                 wa1(j) = -wa1(j)
                                 wa2(j) = x(j) + wa1(j)
                                 wa3(j) = DIAG(j) * wa1(j)
                              Next j
                              pnorm = myenorm(n, wa3)
                  '
                  '           on the first iteration, adjust the initial step bound.
                  '
                              If (iter = 1) Then delta = dmin1(delta, pnorm)
                  '
                  '           evaluate the function at x + p and calculate its norm.
                  '
                              iflag = 1
                              LevenbergCostFunction m, n, wa2, wa4, iflag
                              nfev = nfev + 1
                              If (iflag < 0) Then GoTo L300
                              fnorm1 = myenorm(m, wa4)
                  '
                  '           compute the scaled actual reduction.
                  '
                              actred = -one
                              If (p1 * fnorm1 < fnorm) Then actred = one - (fnorm1 / fnorm) * (fnorm1 / fnorm)
                  '
                  '           compute the scaled predicted reduction and
                  '           the scaled directional derivative.
                  '
                              For j = 1 To n
                                 wa3(j) = zero
                                 L = ipvt(j)
                                 temp = wa1(L)
                                 For i = 1 To j
                                    wa3(i) = wa3(i) + fjac(i, j) * temp
                                 Next i
                              Next j
                              temp1 = myenorm(n, wa3) / fnorm
                              temp2 = (dsqrt(par) * pnorm) / fnorm
                              prered = temp1 * temp1 + (temp2 * temp2) / p5
                              dirder = dirder - (temp1 * temp1 + temp2 * temp2)
                  '
                  '           compute the ratio of the actual to the predicted
                  '           reduction.
                  '
                              ratio = zero
                              If (prered <> zero) Then ratio = actred / prered
                  '
                  '           update the step bound.
                  '
                              If (ratio > p25) Then GoTo L240
                                 If (actred >= zero) Then temp = p5
                                 If (actred < zero) Then                  temp = p5 * dirder / (dirder + p5 * actred)
                                 If ((p1 * fnorm1 >= fnorm) Or (temp < p1)) Then temp = p1
                                 delta = temp * dmin1(delta, pnorm / p1)
                                 par = par / temp
                                 GoTo L260
                  L240:
                                 If ((par <> zero) And (ratio < p75)) Then GoTo L250
                                 delta = pnorm / p5
                                 par = p5 * par
                  L250:
                  L260:
                  '
                  '           test for successful iteration.
                  '
                              If (ratio < p0001) Then GoTo L290
                  '
                  '           successful iteration. update x, fvec, and their norms.
                  '
                              For j = 1 To n
                                 x(j) = wa2(j)
                                 wa2(j) = DIAG(j) * x(j)
                              Next j
                              For i = 1 To m
                                 fvec(i) = wa4(i)
                              Next i
                              xnorm = myenorm(n, wa2)
                              fnorm = fnorm1
                              iter = iter + 1
                  L290:
                  '
                  '           tests for convergence.
                  '
                              If ((dabs(actred) <= ftol) And (prered <= ftol)                And (p5 * ratio <= one)) Then info = 1
                              If (delta <= xtol * xnorm) Then info = 2
                              If ((dabs(actred) <= ftol) And (prered <= ftol)                And (p5 * ratio <= one) And (info = 2)) Then info = 3
                              If (info <> 0) Then GoTo L300
                  '
                  '           tests for termination and stringent tolerances.
                  '
                              If (nfev >= maxfev) Then info = 5
                              If ((dabs(actred) <= epsmch) And (prered <= epsmch)                And (p5 * ratio <= one)) Then info = 6
                              If (delta <= epsmch * xnorm) Then info = 7
                              If (gnorm <= epsmch) Then info = 8
                              If (info <> 0) Then GoTo L300
                  '
                  '           end of the inner loop. repeat if iteration unsuccessful.
                  '
                              If (ratio < p0001) Then GoTo L200
                  '
                  '        end of the outer loop.
                  '
                           GoTo L30
                  L300:
                  '
                  '     termination, either normal or user imposed.
                  '
                        If (iflag < 0) Then info = iflag
                        iflag = 0
                        If (nprint > 0) Then LevenbergCostFunction m, n, x, fvec, iflag
                        'Return
                  '
                  '     last card of subroutine lmdif.
                  '
                        
                  End Sub
                  
                  Private Function dsqrt(x As Double) As Double
                  dsqrt = x ^ 0.5
                  End Function
                  
                  Private Function dmax1(a As Double, b As Double)
                  If a >= b Then
                    dmax1 = a
                  Else
                    dmax1 = b
                  End If
                  End Function
                  
                  Private Function dmin1(a As Double, b As Double)
                  If a <= b Then
                    dmin1 = a
                  Else
                    dmin1 = b
                  End If
                  End Function
                  
                  Private Function min1single(a As Single, b As Single)
                  If a <= b Then
                    min1single = a
                  Else
                    min1single = b
                  End If
                  End Function
                  
                  Private Function dabs(x As Double) As Double
                  dabs = Abs(x)
                  End Function
                  
                  Private Sub testenorm(x As Variant)
                  
                  End Sub
                  
                   Private Sub qrfac(m As Single, n As Single, ByRef a As Variant, lda As Single,    pivot As Boolean, ByRef ipvt As Variant, lipvt As Single, ByRef rdiag As Variant,     ByRef acnorm As Variant, ByRef wa As Variant)
                      Dim i As Single
                      Dim j As Single
                      Dim k As Single
                      Dim jp1 As Single
                      Dim kmax As Single
                      Dim minmn As Single
                      Dim ajnorm As Double
                      Dim epsmch As Double
                      Dim one As Double
                      Dim p05 As Double
                      Dim sum1 As Double
                      Dim temp As Double
                      Dim zero As Double
                      Dim dpmpar As Double
                      Dim enorm As Double
                      one = 1
                      p05 = 0.05
                      zero = 0
                      
                      ReDim tmpaarr(1 To m) As Variant
                      Dim tmpj As Single
                      
                  '
                  '     e

                  General
                  Stream Path:VBA/LogisticRegression
                  VBA File Name:LogisticRegression
                  Stream Size:519738
                  Data ASCII:. . . . . . . . > . . . . . . . . 5 ? . . . . . . ` . . . . . . . . r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . c . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . 8 . . . . < . . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 f2 3e 01 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 35 3f 01 00 0d 10 06 00 60 00 00 00 01 00 00 00 d4 1f 72 96 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "LogisticRegression"
                  ' Utilities
                  
                  Sub sMultColVect(arr() As Double, arr0() As Double, vect() As Double, m As Long, n As Long)
                  ' multiply mxn array arr0 by mx1 column vector vect and put the result in array arr
                      Dim i As Long
                      Dim j As Long
                      For j = 1 To n
                          For i = 1 To m
                              arr(i, j) = vect(i, 1) * arr0(i, j)
                          Next
                      Next
                  End Sub
                  
                  Sub sAddVects(vect() As Double, vect0 As Variant, m As Long)
                  ' add mx1 vectors vect0 and vect and put the result in array vect
                      Dim i As Long
                      For i = 1 To m
                          vect(i, 1) = vect(i, 1) + vect0(i, 1)
                      Next
                  End Sub
                  
                  ' Logistic Regression
                  
                  Function LogitReduce(rg As Range, s As String) As Variant
                  Attribute LogitReduce.VB_Description = "returns an array containing a copy of rg with the columns specified by entries in s removed"
                  Attribute LogitReduce.VB_ProcData.VB_Invoke_Func = " \n28"
                  ' return a range containing a consolidation of the data in range rg
                  ' assumes rg is in summary form with headings and the columns in rg headed by entries in the list s are removed
                  
                      Dim m As Long       ' # of rows in rg w/o headings
                      Dim n As Long       ' # of columns in rg
                      m = rg.Rows.Count - 1
                      n = rg.Columns.Count
                      Dim mat As Variant  ' data contained in rg (w/o headings)
                      mat = rg.Cells(2, 1).Resize(m, n).Value
                      Dim nn As Long      ' # of independent variables = n - 2
                      nn = n - 2
                      Dim i As Long       ' row index for mat
                      Dim j As Long       ' column index for mat
                      Dim index As Variant ' index matrix
                      ReDim index(1 To m, 1 To 3)
                      Dim p As Long       ' size of index array
                      p = 0
                      Dim k As Long       ' index to index array
                      Dim kk As Long      ' index to index array
                      Dim r As Long       ' r = -1 (below match), r = 0 (match so far), r = 1 (above match)
                      
                      ' determine column to exclude
                      Dim arr() As Boolean    ' columns in rg to be excluded
                      ReDim arr(1 To nn)
                      Dim d As Long           ' # of independent vbls to retain (or error code for LogitExtractNames)
                      Call LogitExtractNames(rg, s, arr(), d)
                      If d <= 0 Then
                          LogitReduce = CVErr(xlErrNA)
                          Exit Function
                      End If
                  
                      ' build index array
                      For i = 1 To m
                          r = 1
                          For k = 1 To p
                              For j = 1 To nn
                                  If arr(j) Then  ' j is not excluded
                                      If mat(i, j) > mat(index(k, 1), j) Then
                                          r = 1   ' get next k
                                          Exit For
                                      End If
                                      If mat(i, j) < mat(index(k, 1), j) Then
                                          r = -1
                                          Exit For ' add entry to index and get next i
                                      End If
                                      r = 0
                                  End If
                              Next
                              If r = 0 Then  ' match: update index(k, 2) and index(k, 3)
                                  index(k, 2) = index(k, 2) + mat(i, n - 1)
                                  index(k, 3) = index(k, 3) + mat(i, n)
                                  Exit For    ' get next i
                              End If
                              If r < 0 Then   ' no match: add entry to index
                                  For kk = p To k Step -1
                                      index(kk + 1, 1) = index(kk, 1)
                                      index(kk + 1, 2) = index(kk, 2)
                                      index(kk + 1, 3) = index(kk, 3)
                                  Next
                                  p = p + 1
                                  index(k, 1) = i
                                  index(k, 2) = mat(i, n - 1)
                                  index(k, 3) = mat(i, n)
                                  Exit For    ' get next i
                              End If
                          Next
                          If r > 0 Then       ' no match: add entry to index
                              p = p + 1
                              index(p, 1) = i
                              index(p, 2) = mat(i, n - 1)
                              index(p, 3) = mat(i, n)
                          End If
                      Next
                      
                      ' build output array from index
                      Dim mat1 As Variant
                      ReDim mat1(1 To p + 1, 1 To d + 2)
                      Dim jj As Long          ' column index
                         
                      jj = 0
                      For j = 1 To nn
                          If arr(j) Then
                              jj = jj + 1
                              mat1(1, jj) = rg.Cells(1, j).Value
                              For k = 1 To p
                                  mat1(k + 1, jj) = mat(index(k, 1), j)
                              Next
                          End If
                      Next
                      mat1(1, d + 2) = rg.Cells(1, n).Value
                      mat1(1, d + 1) = rg.Cells(1, n - 1).Value
                      For k = 1 To p
                          mat1(k + 1, d + 2) = index(k, 3)
                          mat1(k + 1, d + 1) = index(k, 2)
                      Next
                      
                      LogitReduce = mat1
                      
                  End Function
                  
                  Sub LogitReduceSize(rg As Range, s As String, p As Long, d As Long)
                  ' return the # of rows p and columns d of the output summary data (w/o column headings or data columns)
                  ' output is the data in rg (in summary form with headings) with columns headed by entries in the list s removed
                  
                      Dim m As Long       ' # of rows in rg w/o headings
                      Dim n As Long       ' # of columns in rg
                      m = rg.Rows.Count - 1
                      n = rg.Columns.Count
                      Dim mat As Variant  ' data contained in rg (w/o headings)
                      mat = rg.Cells(2, 1).Resize(m, n).Value
                      Dim nn As Long      ' # of independent variables = n - 2
                      nn = n - 2
                      
                      Dim i As Long       ' row index for mat
                      Dim j As Long       ' column index for mat
                      Dim index As Variant ' index matrix
                      ReDim index(1 To m, 1 To 3)
                      mm = 0
                      Dim k As Long       ' index to index array
                      Dim kk As Long      ' index to index array
                      Dim r As Long       ' r = -1 (below match), r = 0 (match so far), r = 1 (above match)
                      
                      ' determine column to exclude
                      Dim arr() As Boolean    ' columns in rg to be excluded
                      ReDim arr(1 To nn)
                      Call LogitExtractNames(rg, s, arr(), d)
                      If d <= 0 Then
                          p = 0
                          Exit Sub
                      End If
                  
                      ' build index array
                      For i = 1 To m
                          r = 1
                          For k = 1 To p
                              For j = 1 To nn
                                  If arr(j) Then  ' j is not excluded
                                      If mat(i, j) > mat(index(k, 1), j) Then
                                          r = 1   ' get next k
                                          Exit For
                                      End If
                                      If mat(i, j) < mat(index(k, 1), j) Then
                                          r = -1
                                          Exit For ' add entry to index and get next i
                                      End If
                                      r = 0
                                  End If
                              Next
                              If r = 0 Then  ' match: update index(k, 2) and index(k, 3)
                                  index(k, 2) = index(k, 2) + mat(i, n - 1)
                                  index(k, 3) = index(k, 3) + mat(i, n)
                                  Exit For    ' get next i
                              End If
                              If r < 0 Then   ' no match: add entry to index
                                  For kk = p To k Step -1
                                      index(kk + 1, 1) = index(kk, 1)
                                      index(kk + 1, 2) = index(kk, 2)
                                      index(kk + 1, 3) = index(kk, 3)
                                  Next
                                  p = p + 1
                                  index(k, 1) = i
                                  index(k, 2) = mat(i, n - 1)
                                  index(k, 3) = mat(i, n)
                                  Exit For    ' get next i
                              End If
                          Next
                          If r > 0 Then       ' no match: add entry to index
                              p = p + 1
                              index(p, 1) = i
                              index(k, 2) = mat(i, n - 1)
                              index(k, 3) = mat(i, n)
                          End If
                      Next
                      
                  End Sub
                  
                  Sub LogitExtractNames(rg As Range, s As String, ByRef arr() As Boolean, ByRef d As Long)
                  ' extract the substrings in s (using comma as delimiter) and find the matches for each of these with the names in the first
                  ' row of rg excluding the last two columns; return the array arr with n - 2 elements (where n = the # of columns in rg)
                  ' and arr(j) = false if one of the elements in s corresponds to the jth column of rg
                  ' also return d = the # of entries in arr which are true unless one of the error codes occurs
                  ' if some substring of s has no match then set d = -1; if s has a duplicate entry then set d = -2
                  
                      Dim n As Long       ' # of columns in rg - 2
                      n = rg.Columns.Count - 2
                      Dim j As Long       ' index to rg
                          
                      Dim ok As Boolean   ' is true if match is found
                      Dim sarr() As String ' array corresponding to elements in s
                      sarr = Split(s, ",")
                      
                      If trim(s) = "" Then
                          d = n
                          Exit Sub
                      End If
                  
                      d = n
                      
                      For j = 1 To n
                          arr(j) = True
                      Next
                      
                      Dim ss As Variant   ' substring in arr
                      For Each ss In sarr
                          ok = False
                          For j = 1 To n
                              If rg.Cells(1, j) = trim(ss) Then
                                  ok = True
                                  If Not arr(j) Then
                                      d = -2
                                      Exit Sub
                                  Else
                                      arr(j) = False
                                      d = d - 1
                                      Exit For
                                  End If
                              End If
                          Next
                          If Not ok Then
                              d = -1
                              Exit Sub
                          End If
                      Next
                      
                  End Sub
                  
                  Function LogitRSquare(array1 As Variant, Optional lab As Boolean = False, Optional raw As Boolean = False,     Optional iter As Long = 20, Optional guess As Variant) As Variant
                  Attribute LogitRSquare.VB_Description = "returns an array consisting of LL, LL0, R-square (McFadden, Cox and Snell, Nagelkerke versions), AIC and BIC for logistic regression based on the data in array1"
                  Attribute LogitRSquare.VB_ProcData.VB_Invoke_Func = " \n28"
                  ' return the LL, LL0, R-sq, AIC and BIC for the data in array1 (w/o headings in summary form) after iter iterations
                  ' add a column of labels if lab is True; data in array1 is in raw form if raw = True; otherwise it is in summary form
                  
                      Dim hi As Double    ' highest value for x so that Exp(x) doesn't overflow
                      hi = 709.7
                      
                      Dim head As Boolean
                      head = False
                  
                      Dim arr As Variant  ' array1 as an array
                      arr = array1
                      Dim mat1 As Variant ' array1 w/o rows with missing data(used with raw data)
                      Dim m As Long       ' # of rows of data (w/o heading)
                      Dim n As Long       ' # of variables (indep + 1 dep)
                      n = UBound(arr, 2)
                      m = CountFullRows(arr, False, head)
                  
                      Dim mat0 As Variant ' summary form of array1 w/o any missing rows
                  
                      If raw Then
                          ReDim mat1(1 To m, n)
                          mat1 = DELROWNonNum(arr, head, "")
                          m = CountRowsUnique(mat1, head, 1)
                          ReDim mat0(1 To m + d, 1 To n + 1)
                          mat0 = LogitSummary(mat1, head)
                      Else
                          ReDim mat0(1 To m + d, n)
                          mat0 = DELROWNonNum(arr, head, "")
                          n = n - 1
                      End If
                      
                      Dim i As Long       ' row index
                      Dim j As Long       ' coefficient index
                      Dim k As Long       ' iteration index
                      
                      Dim des As Variant  ' design matrix for mat1
                      ReDim des(1 To m, 1 To n)
                      For i = 1 To m
                          des(i, 1) = 1
                          For j = 1 To n - 1
                              des(i, j + 1) = mat0(i + d, j)
                          Next
                      Next
                      
                      Dim tdes As Variant ' transpose of the design matrix for mat1
                      ReDim tdes(1 To n, 1 To m)
                      tdes = Application.WorksheetFunction.Transpose(des)
                      Dim des1 As Variant ' design matrix multiplied by a vector
                      ReDim des1(1 To m, 1 To n)
                      
                      Dim tot As Variant  ' total observations
                      ReDim tot(1 To m, 1 To 1)
                      Dim obs As Variant  ' % of observations that are successful
                      ReDim obs(1 To m, 1 To 1)
                      Dim pred As Double  ' predicted % of successes
                      Dim pred1 As Variant    ' vector related to pred
                      ReDim pred1(1 To m, 1 To 1)
                      Dim pred2 As Variant    ' vector related to pred
                      ReDim pred2(1 To m, 1 To 1)
                      Dim ll As Variant   ' LL vector
                      ReDim ll(1 To m, 1 To 1)
                      
                      Dim suc As Double   ' sum of success scores
                      Dim fail As Double  ' sum of failure scores
                      Dim ntot As Double  ' sample size
                      suc = 0#
                      fail = 0#
                      For i = 1 To m
                          suc = suc + mat0(i, n)
                          fail = fail + mat0(i, n + 1)
                          tot(i, 1) = mat0(i, n) + mat0(i, n + 1)
                          obs(i, 1) = mat0(i, n) / tot(i, 1)
                      Next
                      ntot = suc + fail
                      
                      Dim coeff As Variant    ' coefficients
                      ReDim coeff(1 To n, 1 To 1)
                      If IsMissing(guess) Then
                          For i = 1 To n
                              coeff(i, 1) = 0
                          Next
                      Else
                          coeff = guess
                      End If
                      
                      Dim covr As Variant     ' inverse of covariance matrix
                      ReDim covr(1 To n, 1 To n)
                      
                      Dim converge As Variant ' convergence vector
                      ReDim converge(1 To n, 1 To 1)
                      Dim temp As Double
                      
                      For k = 1 To iter
                          For i = 1 To m
                              temp = coeff(1, 1)
                              For j = 2 To n
                                  temp = temp + coeff(j, 1) * mat0(i + d, j - 1)
                              Next
                              pred = 1 / (1 + Exp(-temp))
                              pred1(i, 1) = pred * (1 - pred) * tot(i, 1)
                              pred2(i, 1) = tot(i, 1) * (obs(i, 1) - pred)
                              ll(i, 1) = mat0(i + d, n) * Log(pred) + mat0(i + d, n + 1) * Log(1 - pred)
                          Next
                          Call sMultColVector(des1, des, pred1)
                          covr = Application.WorksheetFunction.MInverse(Application.WorksheetFunction.MMult(tdes, des1))
                          converge = Application.WorksheetFunction.MMult(covr, Application.WorksheetFunction.MMult(tdes, pred2))
                          Call sAdd(coeff, coeff, converge)
                      Next
                          
                      Dim mat As Variant  ' output
                      ReDim mat(1 To 7, 1 To 1)
                      
                      mat(1, 1) = Application.WorksheetFunction.Sum(ll)           ' LL
                      mat(2, 1) = suc * Log(suc / ntot) + fail * Log(fail / ntot) ' LL0
                      mat(3, 1) = 1 - mat(1, 1) / mat(2, 1)                       ' R-sq (L)
                      mat(4, 1) = 1 - Exp((-2 / ntot) * (mat(1, 1) - mat(2, 1)))  ' R-sq (CS)
                      mat(5, 1) = mat(4, 1) / (1 - Exp(2 * mat(2, 1) / ntot))     ' R-sq (N)
                      mat(6, 1) = -2 * mat(1, 1) + 2 * n                          ' AIC
                      mat(7, 1) = -2 * mat(1, 1) + n * Log(ntot)                  ' BIC
                      
                      Dim mat2 As Variant     ' output if labels
                      If lab Then
                          ReDim mat2(1 To 7, 1 To 2)
                          mat2(1, 1) = "LL"
                          mat2(2, 1) = "LL0"
                          mat2(3, 1) = "R-sq (L)"
                          mat2(4, 1) = "R-sq (CS)"
                          mat2(5, 1) = "R-sq (N)"
                          mat2(6, 1) = "AIC"
                          mat2(7, 1) = "BIC"
                          For i = 1 To 7
                              mat2(i, 2) = mat(i, 1)
                          Next
                          LogitRSquare = mat2
                      Else
                          LogitRSquare = mat
                      End If
                      
                  End Function
                  
                  Function LogitTest(array1 As Variant, Optional lab As Boolean = False, Optional raw As Boolean = False,     Optional iter As Long = 20, Optional guess As Variant) As Variant
                  Attribute LogitTest.VB_Description = "returns an array consisting of LL, LL0, chi-square test statistic, df and p-value for logistic regression based on the data in array1"
                  Attribute LogitTest.VB_ProcData.VB_Invoke_Func = " \n28"
                  ' return the LL, LL0, Chi-sq, df, p-value for the data in array1 (w/o headings) after iter iterations
                  ' add a column of labels if lab is True; data in array1 is in raw form if raw = True; otherwise it is in summary form
                  
                      Dim hi As Double    ' highest value for x so that Exp(x) doesn't overflow
                      hi = 709.7
                      
                      Dim head As Boolean
                      head = False
                  
                      Dim arr As Variant  ' array1 as an array
                      arr = array1
                      Dim mat1 As Variant ' array1 w/o rows with missing data(used with raw data)
                      Dim m As Long       ' # of rows of data (w/o heading)
                      Dim n As Long       ' # of variables (indep + 1 dep)
                      n = UBound(arr, 2)
                      m = CountFullRows(arr, False, head)
                  
                      Dim mat0 As Variant ' summary form of array1 w/o any missing rows
                  
                      If raw Then
                          ReDim mat1(1 To m, n)
                          mat1 = DELROWNonNum(arr, head, "")
                          m = CountRowsUnique(mat1, head, 1)
                          ReDim mat0(1 To m + d, 1 To n + 1)
                          mat0 = LogitSummary(mat1, head)
                      Else
                          ReDim mat0(1 To m + d, n)
                          mat0 = DELROWNonNum(arr, head, "")
                          n = n - 1
                      End If
                      
                      Dim i As Long       ' row index
                      Dim j As Long       ' coefficient index
                      Dim k As Long       ' iteration index
                      
                      Dim des As Variant  ' design matrix for mat1
                      ReDim des(1 To m, 1 To n)
                      For i = 1 To m
                          des(i, 1) = 1
                          For j = 1 To n - 1
                              des(i, j + 1) = mat0(i + d, j)
                          Next
                      Next
                      
                      Dim tdes As Variant ' transpose of the design matrix for mat1
                      ReDim tdes(1 To n, 1 To m)
                      tdes = Application.WorksheetFunction.Transpose(des)
                      Dim des1 As Variant ' design matrix multiplied by a vector
                      ReDim des1(1 To m, 1 To n)
                      
                      Dim tot As Variant  ' total observations
                      ReDim tot(1 To m, 1 To 1)
                      Dim obs As Variant  ' % of observations that are successful
                      ReDim obs(1 To m, 1 To 1)
                      Dim pred As Double  ' predicted % of successes
                      Dim pred1 As Variant    ' vector related to pred
                      ReDim pred1(1 To m, 1 To 1)
                      Dim pred2 As Variant    ' vector related to pred
                      ReDim pred2(1 To m, 1 To 1)
                      Dim ll As Variant   ' LL vector
                      ReDim ll(1 To m, 1 To 1)
                      
                      Dim suc As Double   ' sum of success scores
                      Dim fail As Double  ' sum of failure scores
                      Dim ntot As Double  ' sample size
                      suc = 0#
                      fail = 0#
                      For i = 1 To m
                          suc = suc + mat0(i, n)
                          fail = fail + mat0(i, n + 1)
                          tot(i, 1) = mat0(i, n) + mat0(i, n + 1)
                          obs(i, 1) = mat0(i, n) / tot(i, 1)
                      Next
                      ntot = suc + fail
                      
                      Dim coeff As Variant    ' coefficients
                      ReDim coeff(1 To n, 1 To 1)
                      If IsMissing(guess) Then
                          For i = 1 To n
                              coeff(i, 1) = 0
                          Next
                      Else
                          coeff = guess
                      End If
                      
                      Dim covr As Variant     ' inverse of covariance matrix
                      ReDim covr(1 To n, 1 To n)
                      
                      Dim converge As Variant ' convergence vector
                      ReDim converge(1 To n, 1 To 1)
                      Dim temp As Double
                      
                      For k = 1 To iter
                          For i = 1 To m
                              temp = coeff(1, 1)
                              For j = 2 To n
                                  temp = temp + coeff(j, 1) * mat0(i + d, j - 1)
                              Next
                              pred = 1 / (1 + Exp(-temp))
                              pred1(i, 1) = pred * (1 - pred) * tot(i, 1)
                              pred2(i, 1) = tot(i, 1) * (obs(i, 1) - pred)
                              ll(i, 1) = mat0(i + d, n) * Log(pred) + mat0(i + d, n + 1) * Log(1 - pred)
                          Next
                          Call sMultColVector(des1, des, pred1)
                          covr = Application.WorksheetFunction.MInverse(Application.WorksheetFunction.MMult(tdes, des1))
                          converge = Application.WorksheetFunction.MMult(covr, Application.WorksheetFunction.MMult(tdes, pred2))
                          Call sAdd(coeff, coeff, converge)
                      Next
                          
                      Dim mat As Variant  ' output
                      ReDim mat(1 To 5, 1 To 1)
                      
                      mat(1, 1) = Application.WorksheetFunction.Sum(ll)           ' LL
                      mat(2, 1) = suc * Log(suc / ntot) + fail * Log(fail / ntot) ' LL0
                      mat(3, 1) = 2 * (mat(1, 1) - mat(2, 1))                     ' Chi-sq
                      mat(4, 1) = n - 1                                           ' df
                      mat(5, 1) = CHISQ_DIST_RT(mat(3, 1), mat(4, 1)) ' p-value
                      
                      Dim mat2 As Variant     ' output if labels
                      If lab Then
                          ReDim mat2(1 To 5, 1 To 2)
                          mat2(1, 1) = "LL"
                          mat2(2, 1) = "LL0"
                          mat2(3, 1) = "Chi-square"
                          mat2(4, 1) = "df"
                          mat2(5, 1) = "p-value"
                          For i = 1 To 5
                              mat2(i, 2) = mat(i, 1)
                          Next
                          LogitTest = mat2
                      Else
                          LogitTest = mat
                      End If
                      
                  End Function
                  
                  Function LogitPredC(darray As Variant, carray As Variant) As Variant
                  Attribute LogitPredC.VB_Description = "returns predicted probability of success for each row in darray based on logistic regression coefficients in carray"
                  Attribute LogitPredC.VB_ProcData.VB_Invoke_Func = " \n28"
                  ' return the prediction for the data in darray based on the logit regression coefficients in carray
                  ' assumes that carray is a column vector with as many rows as darray has columns + 1
                      Dim m As Long       ' # of rows in darray
                      Dim n As Long       ' # of cols in carray
                      Dim darr As Variant ' darray as array
                      Dim carr As Variant ' carray as array
                      darr = darray
                      carr = carray
                      If IsArray(darr) Then
                          m = UBound(darr, 1)
                          n = UBound(darr, 2)
                      Else
                          m = 1
                          n = 1
                      End If
                      Dim i As Long
                      Dim carr0 As Variant    ' carray w/o first entry
                      ReDim carr0(1 To n, 1 To 1)
                      For i = 1 To n
                          carr0(i, 1) = carr(i + 1, 1)
                      Next
                      Dim outp As Variant     ' output
                      ReDim outp(1 To m, 1 To 1)
                      With Application.WorksheetFunction
                          outp = .MMult(darr, carr0)
                          If m > 1 Then
                              For i = 1 To m

                  General
                  Stream Path:VBA/Lookup
                  VBA File Name:Lookup
                  Stream Size:135615
                  Data ASCII:. . . . . . . . Z Y . . . . . . . . Y . . a . . < . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 0 . . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . . . . W . . + . .
                  Data Raw:01 16 03 00 06 f0 00 00 00 5a 59 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 9d 59 00 00 61 97 01 00 3c 00 00 00 01 00 00 00 d4 1f 71 c3 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                  Attribute VB_Name = "Lookup"
                  Function Interpolate(r As Variant, r1 As Variant, r2 As Variant, v1 As Variant, v2 As Variant, Optional h As Long = 1) As Double
                  Attribute Interpolate.VB_Description = "returns the interpolation between r1 and r2 based on v1 and v2"
                  Attribute Interpolate.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' if h = 0, then return value between v1 and v2 that are proportional to the distances r is between r1 and r2
                  ' where v1 corresponds to r1 and v2 corresponds to r2
                  ' if h = 2, then return value between v1 and v2 that are the harmonic interpolation for r between r1 and r2
                  ' if h = 1, then return value between v1 and v2 that are the log interpolation for r between r1 and r2
                      If h = 2 Then
                          Interpolate = v2 + (1 - (100 / r1 - 100 / r) / (100 / r1 - 100 / r2)) * (v1 - v2)
                      ElseIf h = 0 Then
                          Interpolate = v1 + (r - r1) / (r2 - r1) * (v2 - v1)
                      Else
                          Interpolate = v1 + (Log(r) - Log(r1)) / (Log(r2) - Log(r1)) * (v2 - v1)
                      End If
                  End Function
                  
                  Function MLookup(array1 As Variant, r As Variant, c As Variant) As Variant
                  Attribute MLookup.VB_Description = "returns the element in array1 whose row is headed by r and whose column is headed by c"
                  Attribute MLookup.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' return item in range array1 in row headed by r and column headed by c
                  ' range array1 is assumed to contain the row and column headings
                      Dim matrix As Variant
                      matrix = array1
                      Dim i As Long       ' row index
                      Dim j As Long       ' col index
                      Dim m As Long       ' # rows in array1
                      Dim n As Long       ' # cols in array1
                      Dim rindex As Long  ' location of r
                      Dim cindex As Long  ' location of c
                      m = UBound(matrix, 1)
                      n = UBound(matrix, 2)
                      rindex = 0
                      For i = 2 To m
                          If matrix(i, 1) = r Then
                              rindex = i
                              Exit For
                          End If
                      Next
                      cindex = 0
                      For j = 2 To n
                          If matrix(1, j) = c Then
                              cindex = j
                              Exit For
                          End If
                      Next
                      If rindex = 0 Or cindex = 0 Then
                          MLookup = CVErr(xlErrNA)
                      Else
                          MLookup = matrix(rindex, cindex)
                      End If
                  End Function
                  
                  Function ILookup(array1 As Variant, r As Variant, c As Variant, Optional hc As Long = 1, Optional hr As Long = 2) As Variant
                  Attribute ILookup.VB_Description = "returns the element in array1 whose row is headed by r and whose column is headed by c"
                  Attribute ILookup.VB_ProcData.VB_Invoke_Func = " \n33"
                  ' return item in range array1 in row r and column c where interpolation is used if necessary
                  ' range array1 is assumed to contain the row and column headings which may include entries headed by > or <
                  ' hr defines interpolation for rows and hc defines interpolation for columns: linear if 0, log if 1, harmonic if 2
                  
                      Dim matrix As Variant
                      matrix = array1
                      Dim i As Long       ' index
                      Dim j As Long       ' index
                      Dim m As Long       ' # rows in array1
                      Dim n As Long       ' # cols in array1
                      m = UBound(matrix, 1)
                      n = UBound(matrix, 2)
                      Dim rindex As Long  ' row <= r
                      rindex = 0
                      Dim cindex As Long  ' col <= c
                      cindex = 0
                      Dim rnext As Long   ' row > r
                      rnext = 0
                      Dim cnext As Long   ' col > c
                      cnext = 0
                      Dim a As Double     ' used for interpolation
                      Dim b As Double     ' used for interpolation
                      
                      Dim rfirst As Long  ' first row
                      Dim cfirst As Long  ' first col
                      Dim rlast As Long   ' last row
                      Dim clast As Long   ' last col
                      If left(matrix(2, 1), 1) = "<" Then
                          rfirst = 3
                      Else
                          rfirst = 2
                      End If
                      If left(matrix(m, 1), 1) = ">" Then
                          rlast = m - 1
                      Else
                          rlast = m
                      End If
                      If left(matrix(1, 2), 1) = "<" Then
                          cfirst = 3
                      Else
                          cfirst = 2
                      End If
                      If left(matrix(1, n), 1) = ">" Then
                          clast = n - 1
                      Else
                          clast = n
                      End If
                  
                      ' match rows
                      For i = rfirst To rlast
                          If matrix(i, 1) > r Then
                              rindex = i - 1
                              rnext = i
                              Exit For
                          End If
                          If matrix(i, 1) = r Then
                              rindex = i
                              Exit For
                          End If
                      Next
                      If rindex = 0 And rlast < m Then    ' r > last row heading and there is a > row heading
                          rindex = m
                      ElseIf rindex = 1 Then  ' r < first row heading and there is no < row heading
                          rindex = 0
                      End If
                      
                      ' match cols
                      For j = cfirst To clast
                          If matrix(1, j) > c Then
                              cindex = j - 1
                              cnext = j
                              Exit For
                          End If
                          If matrix(1, j) = c Then
                              cindex = j
                              Exit For
                          End If
                      Next
                      If cindex = 0 And clast < n Then    ' c > last col heading and there is a > col heading
                          cindex = n
                      ElseIf cindex = 1 Then  ' c < first col heading and there is no < col heading
                          cindex = 0
                      End If
                      
                      If rindex = 0 Or cindex = 0 Then
                          ILookup = CVErr(xlErrNA)
                      Else
                          If rnext = 0 Then
                              If cnext = 0 Then
                                  ILookup = matrix(rindex, cindex)
                              Else    ' interpolate between
                                  ILookup = Interpolate(c, matrix(1, cindex), matrix(1, cnext), matrix(rindex, cindex), matrix(rindex, cnext), hc)
                              End If
                          Else    ' interpolate
                              If cnext = 0 Then
                                  ILookup = Interpolate(r, matrix(rindex, 1), matrix(rnext, 1), matrix(rindex, cindex), matrix(rnext, cindex), hr)
                              Else    ' interpolate multiple times
                                  a = Interpolate(r, matrix(rindex, 1), matrix(rnext, 1), matrix(rindex, cindex), matrix(rnext, cindex), hr)
                                  b = Interpolate(r, matrix(rindex, 1), matrix(rnext, 1), matrix(rindex, cnext), matrix(rnext, cnext), hr)
                                  ILookup = Interpolate(c, matrix(1, cindex), matrix(1, cnext), a, b, hc)
                              End If
                          End If
                      End If
                      
                  End Function
                  
                  ' Misc
                  
                  Function TauCRIT(n As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  Attribute TauCRIT.VB_Description = "returns critical value for Kendall's Tau Correlation for given values of n, tails and alpha"
                  Attribute TauCRIT.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return value in Tau table for given values of n, alpha and tails (tails = 1, 2)
                      Dim alpha1 As Double
                      If tails = 1 Then
                          alpha1 = alpha * 2
                      Else
                          alpha1 = alpha
                      End If
                      Dim h As Long
                      If interp Then
                          h = 1
                      Else
                          h = 0
                      End If
                      TauCRIT = ILookup(ThisWorkbook.Sheets("Ken Tau Table").Range("A3:G30"), n, alpha1, h)
                  End Function
                  
                  Function RhoCRIT(n As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  Attribute RhoCRIT.VB_Description = "returns critical value for Spearman's Rho Correlation for given values of n, tails and alpha"
                  Attribute RhoCRIT.VB_ProcData.VB_Invoke_Func = " \n30"
                  ' return value in Rho table for given values of n, alpha and tails (tails = 1, 2)
                      Dim alpha1 As Double
                      If tails = 1 Then
                          alpha1 = alpha * 2
                      Else
                          alpha1 = alpha
                      End If
                      Dim h As Long
                      If interp Then
                          h = 1
                      Else
                          h = 0
                      End If
                      RhoCRIT = ILookup(ThisWorkbook.Sheets("Sp Rho Table").Range("A3:G30"), n, alpha1, h)
                  End Function
                  
                  Private Function SRankCRIT(n As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2,     Optional interp As Boolean = True) As Variant
                  ' return signed rank critical value for given values of n, alpha and tails (tails = 1, 2)
                      SRankCRIT = SRINV(alpha, n, tails)
                  End Function
                  
                  Private Function SRankPROB(x As Double, n As Long, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  ' return the p-value for the signed rank test at x
                      SRankPROB = SRDIST(x, n, tails)
                  End Function
                  
                  Private Function MCRIT(n1 As Long, n2 As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2,     Optional interp As Boolean = True) As Variant
                  ' return Mann-Whitney critical value for given values of n, alpha and tails (tails = 1, 2)
                      MCRIT = MWINV(alpha, n1, n2, tails)
                  End Function
                  
                  Private Function MPROB(x As Double, n1 As Long, n2 As Long, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  ' return the p-value for the Mann-Whitney test at x
                      MPROB = MWDIST(x, n1, n2, tails)
                  End Function
                  
                  Private Function WCRIT(n1 As Long, n2 As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2,     Optional interp As Boolean = True) As Variant
                  ' return Wilcoxon Rank-Sum test critical value for given values of n, alpha and tails (tails = 1, 2)
                      WCRIT = MWINV(alpha, n1, n2, tails, False)
                  End Function
                  
                  Private Function WPROB(x As Double, n1 As Long, n2 As Long, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  ' return the p-value for the Wilcoxon Rank-Sum test at x
                      WPROB = MWDIST(x, n1, n2, tails, False)
                  End Function
                  
                  Function DPROB(x As Double, k As Double, df As Double, Optional iter As Long = 40,     Optional interp As Boolean = True, Optional txt As Boolean = False) As Variant
                  ' return an estimate of the p-value for Dunnett's test based on the Dunnett's test table
                  ' iter = # of iterations; value less than .01 is rounded down to 0, value greater than .1 is rounded up to 1
                      
                      Dim i As Long           ' index
                      Dim p0 As Double        ' low end of p-value
                      Dim p1 As Double        ' high end of p-value
                      Dim p As Double         ' average p-value
                      
                      ' x is too large, p < .01
                      If DCRIT(k, df, 0.01, interp) < x Then
                          If txt Then
                              DPROB = "< .01"
                          Else
                              DPROB = 0
                          End If
                          Exit Function
                      ElseIf DCRIT(k, df, 0.05, interp) < x Then
                          p0 = 0.01
                          p1 = 0.05
                      ElseIf DCRIT(k, df, 0.1, interp) < x Then
                          p0 = 0.05
                          p1 = 0.1
                      ' x is too small, p > .1
                      Else
                          If txt Then
                              DPROB = "> .1"
                          Else
                              DPROB = 1
                          End If
                          Exit Function
                      End If
                      
                      ' test if p = p0
                      If DCRIT(k, df, p0, interp) = x Then
                          DPROB = p0
                          Exit Function
                      End If
                      
                      ' main routine
                      For i = 1 To iter
                          p = (p0 + p1) / 2
                          If DCRIT(k, df, p, interp) <= x Then
                              p1 = p
                          Else
                              p0 = p
                          End If
                      Next
                      
                      ' output result
                      DPROB = p
                      
                  End Function
                  
                  ' KS test
                  
                  Function KSCRIT(n As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  Attribute KSCRIT.VB_Description = "returns critical value in Kolmogorov-Smirnov Table for given values of n, alpha and tails"
                  Attribute KSCRIT.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return value in one-sample KS table for given values of n, alpha and tails = 1 or 2
                      Dim alpha1 As Double
                      If tails = 1 Then
                          alpha1 = alpha * 2
                      Else
                          alpha1 = alpha
                      End If
                      Dim h As Long
                      If interp Then
                          h = 1
                      Else
                          h = 0
                      End If
                      If n <= 50 Then
                          KSCRIT = ILookup(ThisWorkbook.Sheets("KS Table").Range("A3:H30"), n, alpha1, h, h)
                      Else
                          KSCRIT = ILookup(ThisWorkbook.Sheets("KS Table").Range("A3:H30"), n, alpha1, h) / n ^ 0.5
                      End If
                  End Function
                  
                  Function KS2CRIT(n1 As Long, n2 As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  Attribute KS2CRIT.VB_Description = "returns critical value in the Two Sample Kolmogorov-Smirnov Table for given values of n, alpha and tails"
                  Attribute KS2CRIT.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return value in two sample KS table for given values of n1, n2, alpha and tails (tails = 1, 2)
                  
                      Dim m1 As Long
                      Dim m2 As Long
                      If n1 <= n2 Then
                          m1 = n1
                          m2 = n2
                      Else
                          m1 = n2
                          m2 = n1
                      End If
                  
                      Dim alpha1 As Double
                      If tails = 1 Then
                          alpha1 = alpha * 2
                      Else
                          alpha1 = alpha
                      End If
                      Dim h As Long
                      If interp Then
                          h = 1
                      Else
                          h = 0
                      End If
                      
                      If m1 > 15 Or m2 > 20 Then
                          KS2CRIT = KINV(alpha1) * Sqr((n1 + n2) / (n1 * n2))
                      Else
                          If alpha1 = 0.01 Then
                              KS2CRIT = MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A4:T18"), m1, m2) / (m1 * m2)
                          ElseIf alpha1 = 0.02 Then
                              KS2CRIT = MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A21:T35"), m1, m2) / (m1 * m2)
                          ElseIf alpha1 = 0.05 Then
                              KS2CRIT = MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A38:T52"), m1, m2) / (m1 * m2)
                          ElseIf alpha1 = 0.1 Then
                              KS2CRIT = MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A55:T69"), m1, m2) / (m1 * m2)
                          ElseIf alpha1 = 0.2 Then
                              KS2CRIT = MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A72:T86"), m1, m2) / (m1 * m2)
                          ElseIf alpha1 > 0.01 And alpha1 < 0.02 Then
                              KS2CRIT = Interpolate(alpha1, 0.01, 0.02, MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A4:T18"), m1, m2),                 MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A21:T35"), m1, m2), h) / (m1 * m2)
                          ElseIf alpha1 > 0.02 And alpha1 < 0.05 Then
                              KS2CRIT = Interpolate(alpha1, 0.02, 0.05, MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A21:T35"), m1, m2),                 MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A38:T52"), m1, m2), h) / (m1 * m2)
                          ElseIf alpha1 > 0.05 And alpha1 < 0.1 Then
                              KS2CRIT = Interpolate(alpha1, 0.05, 0.1, MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A38:T52"), m1, m2),                 MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A55:T69"), m1, m2), h) / (m1 * m2)
                          ElseIf alpha1 > 0.1 And alpha1 < 0.2 Then
                              KS2CRIT = Interpolate(alpha1, 0.1, 0.2, MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A55:T69"), m1, m2),                 MLookup(ThisWorkbook.Sheets("KS2 Table").Range("A72:T86"), m1, m2), h) / (m1 * m2)
                          Else
                              KS2CRIT = CVErr(xlErrNA)
                          End If
                      End If
                      
                  End Function
                  
                  Function KSPROB(x As Double, n As Long, Optional tails As Long = 2, Optional iter As Long = 40,     Optional interp As Boolean = True, Optional txt As Boolean = False) As Variant
                  Attribute KSPROB.VB_Description = "returns estimated p-value for the Kolmogorov-Smirnov test at x based on iterating in the Kolmogorov-Smirnov Table of critical values"
                  Attribute KSPROB.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return an estimate of the p-value for one sample KS test based on the KS test table
                  ' iter = # of iterations; value less than .001 is rounded down to 0, value greater than .2 is rounded up to 1
                      
                      Dim i As Long           ' index
                      Dim p0 As Double        ' low end of p-value
                      Dim p1 As Double        ' high end of p-value
                      Dim p As Double         ' average p-value
                      
                      ' x is too small, p < .001
                      If KSCRIT(n, 0.001, tails, interp) < x Then
                          If txt Then
                              If tails = 1 Then
                                  KSPROB = "< 0.0005"
                              Else
                                  KSPROB = "< 0.001"
                              End If
                          Else
                              KSPROB = 0
                          End If
                          Exit Function
                      ElseIf KSCRIT(n, 0.01, tails, interp) < x Then
                          p0 = 0.001
                          p1 = 0.01
                      ElseIf KSCRIT(n, 0.02, tails, interp) < x Then
                          p0 = 0.01
                          p1 = 0.02
                      ElseIf KSCRIT(n, 0.05, tails, interp) < x Then
                          p0 = 0.02
                          p1 = 0.05
                      ElseIf KSCRIT(n, 0.1, tails, interp) < x Then
                          p0 = 0.05
                          p1 = 0.1
                      ElseIf KSCRIT(n, 0.2, tails, interp) < x Then
                          p0 = 0.1
                          p1 = 0.2
                      ' test if p = .2
                      ElseIf KSCRIT(n, 0.2, 2, interp) = x Then
                          If tails = 1 Then
                              KSPROB = 0.1
                          Else
                              KSPROB = 0.2
                          End If
                          Exit Function
                      ' x is too large, p > .2
                      Else
                          If txt Then
                              If tails = 1 Then
                                  KSPROB = "> 0.1"
                              Else
                                  KSPROB = "> 0.2"
                              End If
                          Else
                              KSPROB = 1
                          End If
                          Exit Function
                      End If
                      
                      ' test if p = p0
                      If KSCRIT(n, p0, tails, interp) = x Then
                          KSPROB = p0
                          Exit Function
                      End If
                      
                      ' main routine
                      For i = 1 To iter
                          p = (p0 + p1) / 2
                          If KSCRIT(n, p, tails, interp) <= x Then
                              p1 = p
                          Else
                              p0 = p
                          End If
                      Next
                      
                      ' output result
                      KSPROB = p
                      
                  End Function
                  
                  Function KS2PROB(x As Double, n1 As Long, n2 As Long, Optional tails As Long = 2,     Optional iter As Long = 40, Optional interp As Boolean = True, Optional txt As Boolean = False) As Variant
                  Attribute KS2PROB.VB_Description = "returns estimated p-value for the Two Sample Kolmogorov-Smirnov test at x based on iterating in the Two Sample Kolmogorov-Smirnov Table of critical values"
                  Attribute KS2PROB.VB_ProcData.VB_Invoke_Func = " \n26"
                  ' return an estimate of the p-value for the KS2 test based on the KS2 table
                  ' iter = # of iterations; value less than .01 (.005 in 1 tailed case) is rounded down to 0,
                  ' value greater than .2 (.1 in 1 tailed case) is rounded up to 1
                      
                      Dim i As Long           ' index
                      Dim p0 As Double        ' low end of p-value
                      Dim p1 As Double        ' high end of p-value
                      Dim p As Double         ' average p-value
                          
                      ' off the chart
                      If (n1 > 20 Or n2 > 20) Or (n1 > 15 And n2 > 15) Then
                          KS2PROB = 1 - KDIST(x * Sqr((n1 * n2) / (n1 + n2)))
                          Exit Function
                      End If
                      
                      ' x is too small, p < .01
                      If KS2CRIT(n1, n2, 0.01, 2, interp) < x Then
                          If txt Then
                              If tails = 1 Then
                                  KS2PROB = "< 0.005"
                              Else
                                  KS2PROB = "< 0.01"
                              End If
                          Else
                              KS2PROB = 0
                          End If
                          Exit Function
                      ElseIf KS2CRIT(n1, n2, 0.02, 2, interp) < x Then
                          p0 = 0.01
                          p1 = 0.02
                      ElseIf KS2CRIT(n1, n2, 0.05, 2, interp) < x Then
                          p0 = 0.02
                          p1 = 0.05
                      ElseIf KS2CRIT(n1, n2, 0.1, 2, interp) < x Then
                          p0 = 0.05
                          p1 = 0.1
                      ElseIf KS2CRIT(n1, n2, 0.2, 2, interp) < x Then
                          p0 = 0.1
                          p1 = 0.2
                      ' test if p = .2
                      ElseIf KS2CRIT(n1, n2, 0.2, 2, interp) = x Then
                          If tails = 1 Then
                              KS2PROB = 0.1
                          Else
                              KS2PROB = 0.2
                          End If
                          Exit Function
                      ' x is too large, p > .2
                      ElseIf KS2CRIT(n1, n2, 0.2, 2, interp) > x Then
                          If txt Then
                              If tails = 1 Then
                                  KS2PROB = "> 0.1"
                              Else
                                  KS2PROB = "> 0.2"
                              End If
                          Else
                              KS2PROB = 1
                          End If
                          Exit Function
                      End If
                      
                      ' test if p = p0
                      If KS2CRIT(n1, n2, p0, 2, interp) = x Then
                          If tails = 1 Then
                              KS2PROB = p0 / 2
                          Else
                              KS2PROB = p0
                          End If
                          Exit Function
                      End If
                      
                      ' main routine
                      For i = 1 To iter
                          p = (p0 + p1) / 2
                          If KS2CRIT(n1, n2, p, 2, interp) <= x Then
                              p1 = p
                          Else
                              p0 = p
                          End If
                      Next
                      
                      ' output result
                      If tails = 1 Then
                          KS2PROB = p / 2
                      Else
                          KS2PROB = p
                      End If
                      
                  End Function
                  
                  Function LCRIT(n As Long, Optional alpha As Double = 0.05, Optional tails As Long = 2, Optional interp As Boolean = True) As Variant
                  Attribute LCRIT.VB_Description = "returns critical value in Lilliefors' Table for given values of n, tails and alpha"
                  Attribute LCRIT.VB_ProcData.VB_Invoke_Func = " \n20"
                  ' return value in one-sample Lilliefors table for given values of n, alpha and tails = 1 or 2
                      Dim alpha1 As Double
                      Dim f As Double
                      If tails = 1 Then
                          alpha1 = alpha * 2
                      Else
                          alpha1 = alpha
                      End If
                      Dim h As Long
                      If interp Then
                          h = 1
                      Else
                          h = 0
                      End If
                      If n <= 50 Then
                          LCRIT = ILookup(ThisWorkbook.Sheets("Lil Table").Range("A3:F51"), n, alpha1, h)
                      Else
                          f = (0.83 + n) / n ^ 0.5 - 0.01
                          LCRIT = ILookup(ThisWorkbook.Sheets("Lil Table").Rang

                  General
                  Stream Path:PROJECT
                  CLSID:
                  File Type:ASCII text, with CRLF line terminators
                  Stream Size:19090
                  Entropy:5.075727444646521
                  Base64 Encoded:True
                  Data ASCII:I D = " { 0 0 0 0 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 } " . . D o c u m e n t = T h i s W o r k b o o k / & H 0 0 0 0 0 0 0 0 . . M o d u l e = B a s i c . . P a c k a g e = { A C 9 F 2 F 9 0 - E 8 7 7 - 1 1 C E - 9 F 6 8 - 0 0 A A 0 0 5 7 4 A 4 F } . . M o d u l e = I n i t . . B a s e C l a s s = f r m I n p u t . . B a s e C l a s s = f r m A n o v a 1 . . B a s e C l a s s = f r m A n o v a R 1 . . B a s e C l a s s = f r m L i n E q . . B a s e C l a s s = f r m D e s c . .
                  Data Raw:49 44 3d 22 7b 30 30 30 30 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 30 30 30 30 30 30 30 30 7d 22 0d 0a 44 6f 63 75 6d 65 6e 74 3d 54 68 69 73 57 6f 72 6b 62 6f 6f 6b 2f 26 48 30 30 30 30 30 30 30 30 0d 0a 4d 6f 64 75 6c 65 3d 42 61 73 69 63 0d 0a 50 61 63 6b 61 67 65 3d 7b 41 43 39 46 32 46 39 30 2d 45 38 37 37 2d 31 31 43 45 2d 39 46 36 38 2d 30 30
                  General
                  Stream Path:PROJECTlk
                  CLSID:
                  File Type:Windows Precompiled iNF, version 0.1, flags 0x45220000, at 0x4600
                  Stream Size:54
                  Entropy:1.361698256628813
                  Base64 Encoded:False
                  Data ASCII:. . . . . . " E . . . . . . . . . . . . F . . . . . . . . . E . . . . . . . . . . . . F . . . . . . . .
                  Data Raw:01 00 02 00 00 00 22 45 02 00 00 00 00 00 c0 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 12 45 02 00 00 00 00 00 c0 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00
                  General
                  Stream Path:PROJECTwm
                  CLSID:
                  File Type:data
                  Stream Size:8918
                  Entropy:3.867400431898196
                  Base64 Encoded:False
                  Data ASCII:T h i s W o r k b o o k . T . h . i . s . W . o . r . k . b . o . o . k . . . B a s i c . B . a . s . i . c . . . I n i t . I . n . i . t . . . f r m I n p u t . f . r . m . I . n . p . u . t . . . f r m A n o v a 1 . f . r . m . A . n . o . v . a . 1 . . . f r m A n o v a R 1 . f . r . m . A . n . o . v . a . R . 1 . . . f r m L i n E q . f . r . m . L . i . n . E . q . . . f r m D e s c . f . r . m . D . e . s . c . . . f r m R O C P l o t . f . r . m . R . O . C . P . l . o . t . . . f r m C h i S q . f
                  Data Raw:54 68 69 73 57 6f 72 6b 62 6f 6f 6b 00 54 00 68 00 69 00 73 00 57 00 6f 00 72 00 6b 00 62 00 6f 00 6f 00 6b 00 00 00 42 61 73 69 63 00 42 00 61 00 73 00 69 00 63 00 00 00 49 6e 69 74 00 49 00 6e 00 69 00 74 00 00 00 66 72 6d 49 6e 70 75 74 00 66 00 72 00 6d 00 49 00 6e 00 70 00 75 00 74 00 00 00 66 72 6d 41 6e 6f 76 61 31 00 66 00 72 00 6d 00 41 00 6e 00 6f 00 76 00 61 00 31 00 00

                  Download Network PCAP: filteredfull

                  TimestampSIDSignatureSeveritySource IPSource PortDest IPDest PortProtocol
                  2025-03-26T20:27:06.819643+01002028371ET JA3 Hash - Possible Malware - Fake Firefox Font Update3192.168.2.44973013.107.246.41443TCP
                  2025-03-26T20:27:13.265859+01002028371ET JA3 Hash - Possible Malware - Fake Firefox Font Update3192.168.2.44973113.107.246.41443TCP
                  2025-03-26T20:27:13.269165+01002028371ET JA3 Hash - Possible Malware - Fake Firefox Font Update3192.168.2.44973213.107.246.41443TCP
                  • Total Packets: 211
                  • 443 (HTTPS)
                  • 53 (DNS)
                  TimestampSource PortDest PortSource IPDest IP
                  Mar 26, 2025 20:27:06.528279066 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.528312922 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:06.528815985 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.528815985 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.528846979 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:06.819118977 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:06.819643021 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.821487904 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.821496010 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:06.821729898 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:06.824156046 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:06.864274025 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.089428902 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.089457989 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.089473009 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.089596033 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.089612007 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.089673996 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.089673996 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.111514091 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.111567974 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.111692905 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.111692905 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.111701965 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.112065077 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.180084944 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.180151939 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.180275917 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.180275917 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.180286884 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.182071924 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.194638968 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.194689035 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.194825888 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.194827080 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.194842100 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.194905043 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.219155073 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.219198942 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.219335079 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.219335079 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.219347000 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.219950914 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.278117895 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.278162003 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.278390884 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.278392076 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.278403044 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.278515100 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.302160978 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.302213907 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.302341938 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.302341938 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.302352905 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.302512884 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.331696033 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.331746101 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.331837893 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.331851959 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.331888914 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.331916094 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.374820948 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.374886036 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.375056028 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.375056028 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.375066042 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.375134945 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.402323008 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.402373075 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.402463913 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.402475119 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.402543068 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.430766106 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.430810928 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.430895090 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.430902958 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.431052923 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.431052923 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.465338945 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.465387106 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.465584993 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.465584993 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.465598106 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.465647936 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.497430086 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.497454882 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.497529030 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.497543097 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.497575045 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.497596979 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.519012928 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.519064903 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.519104958 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.519110918 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.519166946 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.555799007 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.555845022 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.555900097 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.555908918 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.555958033 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.582161903 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.582178116 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.582242966 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.582259893 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.582300901 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.603830099 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.603847980 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.603904963 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.603914976 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.603951931 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.629661083 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.629676104 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.629820108 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.629827976 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.629868984 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.662939072 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.662986994 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.663053036 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.663060904 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.663094044 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.663108110 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.690646887 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.690661907 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.690754890 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.690768003 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.690814972 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.713680983 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.713723898 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.713805914 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.713814020 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.713857889 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.713871002 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.741565943 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.741583109 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.741638899 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.741647959 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.741693974 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.741707087 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.766133070 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.766146898 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.766230106 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.766237974 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.766299009 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.792249918 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.792270899 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.792401075 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.792417049 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.792460918 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.814714909 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.814757109 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.814821005 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.814831018 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.814866066 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.814884901 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.841598988 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.841614962 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.841703892 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.841715097 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.841784000 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.864671946 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.864686012 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.864783049 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.864790916 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.864854097 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.888490915 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.888535023 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.888587952 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.888597965 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.888648033 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.888673067 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.907944918 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.907969952 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.908076048 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.908083916 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.908142090 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.938558102 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.938577890 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.938654900 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.938663960 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.938704014 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.958956003 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.958971024 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.959059954 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.959069967 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.959127903 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.980127096 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.980143070 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.980230093 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:07.980241060 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:07.980287075 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.000576019 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.000590086 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.000632048 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.000641108 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.000669956 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.000684023 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.026258945 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.026298046 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.026333094 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.026341915 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.026385069 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.026385069 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.047056913 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.047089100 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.047130108 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.047153950 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.047166109 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.047199965 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.067559004 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.067588091 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.067739010 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.067739010 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.067763090 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.067807913 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.088494062 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.088546038 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.088563919 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.088573933 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.088603020 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.088615894 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.112752914 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.112814903 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.112947941 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.112947941 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.112971067 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.113019943 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.136476040 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.136526108 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.136568069 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.136581898 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.136611938 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.136621952 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.156217098 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.156287909 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.156306982 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.156316042 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.156362057 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.174559116 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.174604893 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.174746990 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.174746990 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.174771070 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.174817085 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.194757938 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.194813967 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.194828987 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.194839001 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.194861889 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.194881916 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.218204975 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.218251944 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.218322992 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.218337059 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.218369961 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.218389034 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.234720945 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.234765053 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.234826088 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.234834909 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.234843969 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.234996080 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.254128933 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.254179955 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.254220963 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.254232883 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.254272938 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.254287958 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.274005890 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.274050951 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.274091005 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.274100065 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.274131060 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.274147034 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.298755884 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.298799992 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.298836946 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.298861980 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.298875093 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.298904896 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.320472002 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.320518017 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.320657015 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.320657015 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.320679903 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.320724964 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.335052013 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.335095882 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.335242987 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.335252047 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.335297108 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.352565050 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.352608919 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.352641106 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.352653980 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.352684975 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.352705002 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.366909981 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.366964102 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.366991043 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.366998911 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.367026091 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.367041111 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.391294956 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.391343117 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.391407967 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.391416073 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.391454935 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.391474009 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.410955906 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.411000967 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.411089897 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.411103964 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.411158085 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.411176920 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.426629066 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.426675081 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.426738024 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.426745892 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.426919937 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.443335056 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.443378925 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.443406105 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.443413019 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.443445921 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.443461895 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.458023071 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.458070993 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.458137989 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.458152056 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.458184004 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.458195925 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.477521896 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.477571011 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.477602959 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.477612019 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.477648020 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.477665901 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.494940042 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.494986057 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.495019913 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.495034933 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.495064974 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.495083094 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.511948109 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.511993885 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.512020111 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.512026072 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.512064934 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.512082100 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.529211998 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.529259920 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.529282093 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.529288054 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.529324055 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.529337883 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.545690060 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.545734882 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.545763016 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.545774937 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.545799971 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.545821905 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.561139107 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.561188936 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.561214924 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.561227083 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.561254978 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.561281919 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.580955982 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.581000090 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.581065893 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.581073046 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.581234932 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.597126961 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.597172022 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.597242117 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.597261906 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.597295046 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.597313881 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.611164093 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.611208916 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.611251116 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.611264944 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.611298084 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.611320019 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.626211882 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.626259089 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.626279116 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.626290083 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.626321077 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.626331091 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.642764091 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.642812014 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.642870903 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.642882109 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.642916918 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.642932892 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.655183077 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.655230045 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.655256987 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.655267000 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.655293941 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.655316114 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.657603979 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.657747984 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.657759905 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:08.657787085 CET49730443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:08.657877922 CET4434973013.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:12.984558105 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.984596968 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:12.984666109 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.984797001 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.984812021 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:12.984869957 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.985014915 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.985035896 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:12.985151052 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:12.985166073 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.265250921 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.265858889 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.265891075 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.268587112 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.268645048 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.268668890 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.269165039 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.269181013 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.270843983 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.270857096 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.445348978 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.445393085 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.445594072 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.445852995 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.446587086 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.446587086 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.446638107 CET49731443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.446652889 CET4434973113.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.450886011 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.451086998 CET4434973213.107.246.41192.168.2.4
                  Mar 26, 2025 20:27:13.451319933 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.451319933 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.451335907 CET49732443192.168.2.413.107.246.41
                  Mar 26, 2025 20:27:13.451344013 CET4434973213.107.246.41192.168.2.4
                  TimestampSource PortDest PortSource IPDest IP
                  Mar 26, 2025 20:26:37.824951887 CET5360764162.159.36.2192.168.2.4
                  Mar 26, 2025 20:27:06.435339928 CET5464653192.168.2.41.1.1.1
                  Mar 26, 2025 20:27:06.524482012 CET53546461.1.1.1192.168.2.4
                  TimestampSource IPDest IPTrans IDOP CodeNameTypeClassDNS over HTTPS
                  Mar 26, 2025 20:27:06.435339928 CET192.168.2.41.1.1.10x54d0Standard query (0)otelrules.svc.static.microsoftA (IP address)IN (0x0001)false
                  TimestampSource IPDest IPTrans IDReply CodeNameCNameAddressTypeClassDNS over HTTPS
                  Mar 26, 2025 20:26:02.500158072 CET1.1.1.1192.168.2.40xaf2dNo error (0)svc.ha-teams.office.comsvc.ms-acdc-teams.office.comCNAME (Canonical name)IN (0x0001)false
                  Mar 26, 2025 20:26:02.500158072 CET1.1.1.1192.168.2.40xaf2dNo error (0)svc.ms-acdc-teams.office.com52.123.247.81A (IP address)IN (0x0001)false
                  Mar 26, 2025 20:26:02.500158072 CET1.1.1.1192.168.2.40xaf2dNo error (0)svc.ms-acdc-teams.office.com52.123.251.29A (IP address)IN (0x0001)false
                  Mar 26, 2025 20:26:02.500158072 CET1.1.1.1192.168.2.40xaf2dNo error (0)svc.ms-acdc-teams.office.com52.123.251.26A (IP address)IN (0x0001)false
                  Mar 26, 2025 20:26:02.500158072 CET1.1.1.1192.168.2.40xaf2dNo error (0)svc.ms-acdc-teams.office.com52.123.247.79A (IP address)IN (0x0001)false
                  Mar 26, 2025 20:26:02.937736034 CET1.1.1.1192.168.2.40x71e4No error (0)bg.microsoft.map.fastly.net199.232.38.172A (IP address)IN (0x0001)false
                  Mar 26, 2025 20:27:06.524482012 CET1.1.1.1192.168.2.40x54d0No error (0)otelrules.svc.static.microsoftotelrules-bzhndjfje8dvh5fd.z01.azurefd.netCNAME (Canonical name)IN (0x0001)false
                  Mar 26, 2025 20:27:06.524482012 CET1.1.1.1192.168.2.40x54d0No error (0)otelrules-bzhndjfje8dvh5fd.z01.azurefd.netstar-azurefd-prod.trafficmanager.netCNAME (Canonical name)IN (0x0001)false
                  Mar 26, 2025 20:27:06.524482012 CET1.1.1.1192.168.2.40x54d0No error (0)star-azurefd-prod.trafficmanager.netshed.dual-low.s-part-0013.t-0009.t-msedge.netCNAME (Canonical name)IN (0x0001)false
                  Mar 26, 2025 20:27:06.524482012 CET1.1.1.1192.168.2.40x54d0No error (0)shed.dual-low.s-part-0013.t-0009.t-msedge.nets-part-0013.t-0009.t-msedge.netCNAME (Canonical name)IN (0x0001)false
                  Mar 26, 2025 20:27:06.524482012 CET1.1.1.1192.168.2.40x54d0No error (0)s-part-0013.t-0009.t-msedge.net13.107.246.41A (IP address)IN (0x0001)false
                  • otelrules.svc.static.microsoft
                  Session IDSource IPSource PortDestination IPDestination PortPIDProcess
                  0192.168.2.44973013.107.246.414436300C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  TimestampBytes transferredDirectionData
                  2025-03-26 19:27:06 UTC226OUTGET /rules/excel.exe-Production-v19.bundle HTTP/1.1
                  Connection: Keep-Alive
                  Accept-Encoding: gzip
                  User-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)
                  Host: otelrules.svc.static.microsoft
                  2025-03-26 19:27:07 UTC493INHTTP/1.1 200 OK
                  Date: Wed, 26 Mar 2025 19:27:06 GMT
                  Content-Type: text/plain
                  Content-Length: 1114783
                  Connection: close
                  Vary: Accept-Encoding
                  Cache-Control: public
                  Last-Modified: Mon, 24 Mar 2025 13:40:54 GMT
                  ETag: "0x8DD6AD97FEF19EF"
                  x-ms-request-id: c143ef55-001e-005a-3b72-9ec3d0000000
                  x-ms-version: 2018-03-28
                  x-azure-ref: 20250326T192706Z-17cccd5449bzd7mthC1EWRrdxw0000000hdg00000000n7sw
                  x-fd-int-roxy-purgeid: 0
                  X-Cache-Info: L1_T2
                  X-Cache: TCP_HIT
                  Accept-Ranges: bytes
                  2025-03-26 19:27:07 UTC15891INData Raw: 31 30 30 30 34 32 76 32 2b 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 30 30 30 34 32 22 20 56 3d 22 32 22 20 44 43 3d 22 53 4d 22 20 45 4e 3d 22 4f 66 66 69 63 65 2e 55 58 2e 44 65 73 6b 74 6f 70 2e 4f 66 66 69 63 65 54 68 65 6d 65 2e 41 70 70 2e 49 6e 69 74 22 20 41 54 54 3d 22 63 34 33 38 38 63 39 37 37 32 39 37 34 31 33 62 62 30 35 34 62 61 64 31 61 63 66 30 61 64 65 31 2d 63 63 35 38 65 35 33 65 2d 66 35 61 34 2d 34 66 33 37 2d 62 30 64 32 2d 39 61 38 30 37 39 65 33 34 34 32 30 2d 36 38 37 39 22 20 44 43 61 3d 22 50 53 55 22 20 78 6d 6c 6e 73 3d 22 22 3e 0d 0a 20 20 3c 53 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 31 22 20 49 64 3d 22 63 6d 39 79 35
                  Data Ascii: 100042v2+<?xml version="1.0" encoding="utf-8"?><R Id="100042" V="2" DC="SM" EN="Office.UX.Desktop.OfficeTheme.App.Init" ATT="c4388c977297413bb054bad1acf0ade1-cc58e53e-f5a4-4f37-b0d2-9a8079e34420-6879" DCa="PSU" xmlns=""> <S> <UTS T="1" Id="cm9y5
                  2025-03-26 19:27:07 UTC16384INData Raw: 20 2f 3e 0d 0a 20 20 3c 2f 54 3e 0d 0a 3c 2f 52 3e 0d 0a 3c 24 21 23 3e 31 30 30 31 31 37 76 30 2b 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 30 30 31 31 37 22 20 56 3d 22 30 22 20 44 43 3d 22 53 4d 22 20 54 3d 22 53 75 62 72 75 6c 65 22 20 44 43 61 3d 22 50 53 55 22 20 78 6d 6c 6e 73 3d 22 22 3e 0d 0a 20 20 3c 53 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 31 22 20 49 64 3d 22 38 79 6c 6c 66 22 20 2f 3e 0d 0a 20 20 3c 2f 53 3e 0d 0a 20 20 3c 43 20 54 3d 22 57 22 20 49 3d 22 30 22 20 4f 3d 22 66 61 6c 73 65 22 3e 0d 0a 20 20 20 20 3c 56 20 56 3d 22 43 6c 69 63 6b 22 20 54 3d 22 57 22 20 2f 3e 0d 0a 20 20 3c 2f 43 3e 0d 0a 20 20 3c 43 20 54 3d 22 55 33 32
                  Data Ascii: /> </T></R><$!#>100117v0+<?xml version="1.0" encoding="utf-8"?><R Id="100117" V="0" DC="SM" T="Subrule" DCa="PSU" xmlns=""> <S> <UTS T="1" Id="8yllf" /> </S> <C T="W" I="0" O="false"> <V V="Click" T="W" /> </C> <C T="U32
                  2025-03-26 19:27:07 UTC16384INData Raw: 0d 0a 20 20 3c 2f 43 3e 0d 0a 20 20 3c 54 3e 0d 0a 20 20 20 20 3c 53 20 54 3d 22 32 22 20 2f 3e 0d 0a 20 20 20 20 3c 53 20 54 3d 22 33 22 20 2f 3e 0d 0a 20 20 3c 2f 54 3e 0d 0a 3c 2f 52 3e 0d 0a 3c 24 21 23 3e 31 30 37 38 31 76 31 2b 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 30 37 38 31 22 20 56 3d 22 31 22 20 44 43 3d 22 53 4d 22 20 54 3d 22 53 75 62 72 75 6c 65 22 20 78 6d 6c 6e 73 3d 22 22 3e 0d 0a 20 20 3c 53 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 31 22 20 49 64 3d 22 62 67 6f 34 74 22 20 2f 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 32 22 20 49 64 3d 22 62 68 6c 76 79 22 20 2f 3e 0d 0a 20 20 3c 2f 53 3e 0d 0a 20 20 3c 43 20 54 3d 22 49 33 32
                  Data Ascii: </C> <T> <S T="2" /> <S T="3" /> </T></R><$!#>10781v1+<?xml version="1.0" encoding="utf-8"?><R Id="10781" V="1" DC="SM" T="Subrule" xmlns=""> <S> <UTS T="1" Id="bgo4t" /> <UTS T="2" Id="bhlvy" /> </S> <C T="I32
                  2025-03-26 19:27:07 UTC16384INData Raw: 0a 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 4f 20 54 3d 22 47 54 22 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 31 22 20 46 3d 22 30 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 56 20 56 3d 22 31 30 30 30 22 20 54 3d 22 55 33 32 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 2f 4f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 4f 20 54 3d 22 4c 45 22 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c
                  Data Ascii: <L> <O T="GT"> <L> <S T="1" F="0" /> </L> <R> <V V="1000" T="U32" /> </R> </O> </L> <R> <O T="LE"> <
                  2025-03-26 19:27:07 UTC16384INData Raw: 20 49 3d 22 32 32 22 20 4f 3d 22 66 61 6c 73 65 22 20 4e 3d 22 46 6c 79 6f 75 74 56 69 64 65 6f 43 61 6c 6c 56 69 64 65 6f 22 3e 0d 0a 20 20 20 20 3c 43 3e 0d 0a 20 20 20 20 20 20 3c 53 20 54 3d 22 32 36 22 20 2f 3e 0d 0a 20 20 20 20 3c 2f 43 3e 0d 0a 20 20 3c 2f 43 3e 0d 0a 20 20 3c 43 20 54 3d 22 55 33 32 22 20 49 3d 22 32 33 22 20 4f 3d 22 66 61 6c 73 65 22 20 4e 3d 22 46 6c 79 6f 75 74 53 61 53 22 3e 0d 0a 20 20 20 20 3c 43 3e 0d 0a 20 20 20 20 20 20 3c 53 20 54 3d 22 32 37 22 20 2f 3e 0d 0a 20 20 20 20 3c 2f 43 3e 0d 0a 20 20 3c 2f 43 3e 0d 0a 20 20 3c 43 20 54 3d 22 55 33 32 22 20 49 3d 22 32 34 22 20 4f 3d 22 66 61 6c 73 65 22 20 4e 3d 22 46 6c 79 6f 75 74 4f 76 65 72 66 6c 6f 77 22 3e 0d 0a 20 20 20 20 3c 43 3e 0d 0a 20 20 20 20 20 20 3c 53 20 54
                  Data Ascii: I="22" O="false" N="FlyoutVideoCallVideo"> <C> <S T="26" /> </C> </C> <C T="U32" I="23" O="false" N="FlyoutSaS"> <C> <S T="27" /> </C> </C> <C T="U32" I="24" O="false" N="FlyoutOverflow"> <C> <S T
                  2025-03-26 19:27:07 UTC16384INData Raw: 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 30 39 30 37 22 20 56 3d 22 30 22 20 44 43 3d 22 53 4d 22 20 45 4e 3d 22 4f 66 66 69 63 65 2e 4f 75 74 6c 6f 6f 6b 2e 44 65 73 6b 74 6f 70 2e 4e 44 42 2e 55 6e 6b 6e 6f 77 6e 2e 43 6f 72 72 75 70 74 69 6f 6e 22 20 41 54 54 3d 22 64 38 30 37 36 30 39 32 37 36 37 34 34 32 34 35 62 61 66 38 31 62 66 37 62 63 38 30 33 33 66 36 2d 32 32 36 38 65 33 37 34 2d 37 37 36 36 2d 34 39 37 36 2d 62 65 34 34 2d 62 36 61 64 35 62 64 64 63 35 62 36 2d 37 38 31 33 22 20 53 3d 22 31 30 30 22 20 44 43 61 3d 22 50 53 55 22 20 78 6d 6c 6e 73 3d 22 22 3e 0d 0a 20 20 3c 53 3e 0d 0a 20 20 20 20 3c 45 74 77 20 54 3d 22 31 22 20 45 3d 22 33 39 35 22 20 47 3d 22 7b 32 61 64 66 38 65 32 33 2d 30 61 66 39 2d
                  Data Ascii: coding="utf-8"?><R Id="10907" V="0" DC="SM" EN="Office.Outlook.Desktop.NDB.Unknown.Corruption" ATT="d807609276744245baf81bf7bc8033f6-2268e374-7766-4976-be44-b6ad5bddc5b6-7813" S="100" DCa="PSU" xmlns=""> <S> <Etw T="1" E="395" G="{2adf8e23-0af9-
                  2025-03-26 19:27:07 UTC16384INData Raw: 22 54 65 6c 65 6d 65 74 72 79 53 68 75 74 64 6f 77 6e 22 20 2f 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 33 22 20 49 64 3d 22 62 70 66 79 31 22 20 2f 3e 0d 0a 20 20 20 20 3c 46 20 54 3d 22 34 22 3e 0d 0a 20 20 20 20 20 20 3c 4f 20 54 3d 22 47 54 22 3e 0d 0a 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 33 22 20 46 3d 22 50 68 6f 74 6f 53 69 7a 65 49 6e 42 79 74 65 73 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 56 20 56 3d 22 30 22 20 54 3d 22 55 36 34 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 52 3e 0d 0a 20 20 20 20 20 20 3c 2f 4f 3e 0d 0a 20 20 20 20 3c 2f 46 3e 0d 0a 20 20 3c 2f 53 3e 0d 0a 20 20 3c 43 20 54 3d 22 55
                  Data Ascii: "TelemetryShutdown" /> <UTS T="3" Id="bpfy1" /> <F T="4"> <O T="GT"> <L> <S T="3" F="PhotoSizeInBytes" /> </L> <R> <V V="0" T="U64" /> </R> </O> </F> </S> <C T="U
                  2025-03-26 19:27:07 UTC16384INData Raw: 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 34 22 20 46 3d 22 65 76 65 6e 74 49 64 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 56 20 56 3d 22 31 33 35 22 20 54 3d 22 49 33 32 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 52 3e 0d 0a 20 20 20 20 20 20 3c 2f 4f 3e 0d 0a 20 20 20 20 3c 2f 46 3e 0d 0a 20 20 20 20 3c 46 20 54 3d 22 37 22 3e 0d 0a 20 20 20 20 20 20 3c 4f 20 54 3d 22 45 51 22 3e 0d 0a 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 35 22 20 46 3d 22 74 63 69 64 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 56 20
                  Data Ascii: <L> <S T="4" F="eventId" /> </L> <R> <V V="135" T="I32" /> </R> </O> </F> <F T="7"> <O T="EQ"> <L> <S T="5" F="tcid" /> </L> <R> <V
                  2025-03-26 19:27:07 UTC16384INData Raw: 0d 0a 20 20 20 20 3c 46 20 54 3d 22 31 30 22 3e 0d 0a 20 20 20 20 20 20 3c 4f 20 54 3d 22 45 51 22 3e 0d 0a 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 33 22 20 46 3d 22 46 69 6c 65 50 72 6f 74 65 63 74 69 6f 6e 53 74 61 74 65 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 3c 56 20 56 3d 22 35 22 20 54 3d 22 55 33 32 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 3c 2f 52 3e 0d 0a 20 20 20 20 20 20 3c 2f 4f 3e 0d 0a 20 20 20 20 3c 2f 46 3e 0d 0a 20 20 3c 2f 53 3e 0d 0a 20 20 3c 43 20 54 3d 22 55 33 32 22 20 49 3d 22 30 22 20 4f 3d 22 66 61 6c 73 65 22 20 4e 3d 22 43 6f 75 6e 74 4f 66 54 68 72 6f 77 6e 45 78 63 65 70 74 69 6f 6e 22 3e 0d
                  Data Ascii: <F T="10"> <O T="EQ"> <L> <S T="3" F="FileProtectionState" /> </L> <R> <V V="5" T="U32" /> </R> </O> </F> </S> <C T="U32" I="0" O="false" N="CountOfThrownException">
                  2025-03-26 19:27:07 UTC16384INData Raw: 20 20 20 20 20 20 20 20 20 20 20 3c 53 20 54 3d 22 35 22 20 46 3d 22 72 65 73 75 6c 74 73 5f 49 73 4e 75 6c 6c 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 56 20 56 3d 22 66 61 6c 73 65 22 20 54 3d 22 42 22 20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 4f 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 2f 4c 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3c 52 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 4f 20 54 3d 22 45 51 22 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 4c 3e 0d 0a 20 20 20 20
                  Data Ascii: <S T="5" F="results_IsNull" /> </L> <R> <V V="false" T="B" /> </R> </O> </L> <R> <O T="EQ"> <L>


                  Session IDSource IPSource PortDestination IPDestination PortPIDProcess
                  1192.168.2.44973113.107.246.414436300C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  TimestampBytes transferredDirectionData
                  2025-03-26 19:27:13 UTC214OUTGET /rules/rule120603v8s19.xml HTTP/1.1
                  Connection: Keep-Alive
                  Accept-Encoding: gzip
                  User-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)
                  Host: otelrules.svc.static.microsoft
                  2025-03-26 19:27:13 UTC494INHTTP/1.1 200 OK
                  Date: Wed, 26 Mar 2025 19:27:13 GMT
                  Content-Type: text/xml
                  Content-Length: 2128
                  Connection: close
                  Vary: Accept-Encoding
                  Cache-Control: public, max-age=604800, immutable
                  Last-Modified: Tue, 09 Apr 2024 00:26:04 GMT
                  ETag: "0x8DC582BA41F3C62"
                  x-ms-request-id: 0fe88ecf-101e-007a-32da-9b047e000000
                  x-ms-version: 2018-03-28
                  x-azure-ref: 20250326T192713Z-17cccd5449bh49mhhC1EWRu7400000000hdg00000000mtft
                  x-fd-int-roxy-purgeid: 0
                  X-Cache: TCP_HIT
                  Accept-Ranges: bytes
                  2025-03-26 19:27:13 UTC2128INData Raw: ef bb bf 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 32 30 36 30 33 22 20 56 3d 22 38 22 20 44 43 3d 22 53 4d 22 20 45 4e 3d 22 4f 66 66 69 63 65 2e 53 79 73 74 65 6d 2e 53 79 73 74 65 6d 48 65 61 6c 74 68 4d 65 74 61 64 61 74 61 41 70 70 6c 69 63 61 74 69 6f 6e 41 64 64 69 74 69 6f 6e 61 6c 22 20 41 54 54 3d 22 63 64 38 33 36 36 32 36 36 31 31 63 34 63 61 61 61 38 66 63 35 62 32 65 37 32 38 65 65 38 31 64 2d 33 62 36 64 36 63 34 35 2d 36 33 37 37 2d 34 62 66 35 2d 39 37 39 32 2d 64 62 66 38 65 31 38 38 31 30 38 38 2d 37 35 32 31 22 20 53 50 3d 22 43 72 69 74 69 63 61 6c 42 75 73 69 6e 65 73 73 49 6d 70 61 63 74 22 20 45 3d 22 66 61 6c 73 65 22 20 44 4c 3d
                  Data Ascii: <?xml version="1.0" encoding="utf-8"?><R Id="120603" V="8" DC="SM" EN="Office.System.SystemHealthMetadataApplicationAdditional" ATT="cd836626611c4caaa8fc5b2e728ee81d-3b6d6c45-6377-4bf5-9792-dbf8e1881088-7521" SP="CriticalBusinessImpact" E="false" DL=


                  Session IDSource IPSource PortDestination IPDestination PortPIDProcess
                  2192.168.2.44973213.107.246.414436300C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  TimestampBytes transferredDirectionData
                  2025-03-26 19:27:13 UTC214OUTGET /rules/rule120607v1s19.xml HTTP/1.1
                  Connection: Keep-Alive
                  Accept-Encoding: gzip
                  User-Agent: Microsoft Office/16.0 (Windows NT 10.0; Microsoft Excel 16.0.16827; Pro)
                  Host: otelrules.svc.static.microsoft
                  2025-03-26 19:27:13 UTC491INHTTP/1.1 200 OK
                  Date: Wed, 26 Mar 2025 19:27:13 GMT
                  Content-Type: text/xml
                  Content-Length: 204
                  Connection: close
                  Cache-Control: public, max-age=604800, immutable
                  Last-Modified: Tue, 09 Apr 2024 00:26:35 GMT
                  ETag: "0x8DC582BB6C8527A"
                  x-ms-request-id: fe09a350-901e-0048-3adf-9cb800000000
                  x-ms-version: 2018-03-28
                  x-azure-ref: 20250326T192713Z-17cccd5449bgvc9thC1EWR7dt00000000he000000000ntph
                  x-fd-int-roxy-purgeid: 0
                  X-Cache: TCP_HIT
                  X-Cache-Info: L1_T2
                  Accept-Ranges: bytes
                  2025-03-26 19:27:13 UTC204INData Raw: ef bb bf 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 0d 0a 3c 52 20 49 64 3d 22 31 32 30 36 30 37 22 20 56 3d 22 31 22 20 44 43 3d 22 53 4d 22 20 54 3d 22 53 75 62 72 75 6c 65 22 20 45 52 3d 22 31 32 30 36 30 33 22 20 78 6d 6c 6e 73 3d 22 22 3e 0d 0a 20 20 3c 53 3e 0d 0a 20 20 20 20 3c 55 54 53 20 54 3d 22 31 22 20 49 64 3d 22 62 62 70 7a 73 22 20 41 3d 22 39 34 30 74 63 20 39 78 35 6a 73 22 20 2f 3e 0d 0a 20 20 3c 2f 53 3e 0d 0a 20 20 3c 54 3e 0d 0a 20 20 20 20 3c 53 20 54 3d 22 31 22 20 2f 3e 0d 0a 20 20 3c 2f 54 3e 0d 0a 3c 2f 52 3e
                  Data Ascii: <?xml version="1.0" encoding="utf-8"?><R Id="120607" V="1" DC="SM" T="Subrule" ER="120603" xmlns=""> <S> <UTS T="1" Id="bbpzs" A="940tc 9x5js" /> </S> <T> <S T="1" /> </T></R>


                  050100s020406080100

                  Click to jump to process

                  050100s0.0050100150MB

                  Click to jump to process

                  • File
                  • Registry

                  Click to dive into process behavior distribution

                  Click to jump to process

                  Target ID:0
                  Start time:15:25:57
                  Start date:26/03/2025
                  Path:C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
                  Wow64 process (32bit):true
                  Commandline:"C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" "C:\Users\user\Desktop\XRealStats.xlam"
                  Imagebase:0x180000
                  File size:53'161'064 bytes
                  MD5 hash:4A871771235598812032C822E6F68F19
                  Has elevated privileges:true
                  Has administrator privileges:true
                  Programmed in:C, C++ or other language
                  Reputation:high
                  Has exited:false
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.

                  Target ID:16
                  Start time:15:27:06
                  Start date:26/03/2025
                  Path:C:\Windows\splwow64.exe
                  Wow64 process (32bit):false
                  Commandline:C:\Windows\splwow64.exe 12288
                  Imagebase:0x7ff6ac620000
                  File size:163'840 bytes
                  MD5 hash:77DE7761B037061C7C112FD3C5B91E73
                  Has elevated privileges:true
                  Has administrator privileges:true
                  Programmed in:C, C++ or other language
                  Reputation:high
                  Has exited:false
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
                  There is hidden Windows Behavior. Click on Show Windows Behavior to show it.

                  No disassembly