Recent

Author Topic: LazStats - A new statistics package  (Read 18399 times)

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: LazStats - A new statistics package
« Reply #15 on: March 30, 2020, 11:31:10 am »
I think there is a possible bug in LazStats BlkANOVAUnit or ANOVATestUnit, namely it seems that Post-Hoc comparisons are not working with One-Way ANOVA in LazStats.
I couldn't figure out what is the reason, can somebody please take a look?

Test dataset is here:
https://drive.google.com/file/d/1qsJE1sOHFYYkizcK7W0nbiTgpAQK2dUn/view?usp=sharing
"Etch Rate (A/min)" is a dependent response variable, while "RF Power (W)" is independent input variable.

My LazStats source code (CodeTyphon version) is here:
https://drive.google.com/file/d/1FnAZqaZrhwBYgr9luYSytCucRhi_nmmt/view?usp=sharing

Could somebody please test it?
Attached screenshot of similar output from JASP software, with Post-Hoc comparisons - these are expected results...

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: LazStats - A new statistics package
« Reply #16 on: March 30, 2020, 11:45:21 am »
Thanks. I just refactored the unit to my current standard. But I cannot find the position in the code, there is no comment "get independent variable columns" in my copy, only a "get dependent variaible columns". Except for this difference, a few lines later there are lines which seem to match. Just to make sure: What is the name of the procedure? TLSMregForm.ComputeBtnClick? Near the beginning after the bunch of SetLength instructions?

Did you happen to find the help file related to this form? The pdf usually contains a tested example of OpenStat which allows me to check the routine.

If there is not help file and no demo can you submit a sample file with the expected results?
it's in procedure TLSMregForm.ComputeBtnClick(Sender: TObject);
yeah, comment was added by me...
you can use the  file (9_23_results.tab), link here: https://drive.google.com/file/d/1qsJE1sOHFYYkizcK7W0nbiTgpAQK2dUn/view?usp=sharing.
Result of least squares multiple regression should be:
"
Least Squares Multiple Regression by Bill Miller


Product-Moment Correlations Matrix with   20 cases.


Variables
           RF Power (W)Etch Rate (A/min)
RF Power (W)       1,000        0,940
Etch Rate (A/min)       0,940        1,000




Means with   20 valid cases.

Variables RF Power (W)Etch Rate (A/min)
               190,000      617,750


Standard Deviations with   20 valid cases.

Variables RF Power (W)Etch Rate (A/min)
                22,942       61,648

Variance Y =   3800,513 SSY = 7704511,000  SDY =     61,648

Least Squares Multiple Regression by Bill Miller


Product-Moment Correlations Matrix with   20 cases.


Variables
           RF Power (W)Etch Rate (A/min)
RF Power (W)       1,000        0,940
Etch Rate (A/min)       0,940        1,000




Means with   20 valid cases.

Variables RF Power (W)Etch Rate (A/min)
               190,000      617,750


Standard Deviations with   20 valid cases.

Variables RF Power (W)Etch Rate (A/min)
                22,942       61,648

Variance Y =   3800,513 SSY = 7704511,000  SDY =     61,648

MEANS with   20 valid cases.

Variables RF Power (W)    Intercept
               190,000        1,000


VARIANCES with   20 valid cases.

Variables RF Power (W)    Intercept
               526,316        0,000


STD. DEV.S with   20 valid cases.

Variables RF Power (W)    Intercept
                22,942        0,000


SSY =   72209,75, SSreg =   63857,29, SSres =    8352,46
R2 = 0,8843, F =   137,62, D.F. = 1 18, Prob>F = 0,0000
Standard Error of Estimate =    21,54

  Variable     Beta      B         Std.Err.  t         prob     VIF       TOL
RF Power (W)     0,940     2,527     0,215    11,731     0,000     1,000     1,000
 Intercept     0,000   137,620    41,211     3,339     0,004    20,000     0,050
 
SOURCE     DF         SS        MS        F      Prob.>F
Regression  1  63857,290 63857,290     137,6159
Residual   19   8352,460   464,026
Total      19  72209,750

R2 = 0,8843,  F =   137,62,  D.F. = 1 18  Prob.>F = 0,0000
Adjusted R2 = 0,8779
Standard Error of Estimate =    21,54

  Variable     Beta      B         Std.Err.  t         prob     VIF       TOL
RF Power (W)     0,940     2,527     0,215    11,731     0,000     1,000     1,000
 Intercept     0,000   137,620    41,211     3,339     0,004    20,000     0,050
 
SOURCE     DF         SS        MS        F      Prob.>F
Regression  1  63857,290 63857,290     137,6159
Residual   19   8352,460   464,026
Total      19  72209,750

R2 = 0,8843,  F =   137,62,  D.F. = 1 18  Prob.>F = 0,0000
Adjusted R2 = 0,8779
Standard Error of Estimate =    21,54
Entry requirements met


wp

  • Hero Member
  • *****
  • Posts: 11858
Re: LazStats - A new statistics package
« Reply #17 on: March 30, 2020, 01:27:29 pm »
Thank you. Now I understand why your change was necessary. I added your file to the data folder (as LSMR.laz).

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: LazStats - A new statistics package
« Reply #18 on: March 30, 2020, 02:36:10 pm »
Regarding post-hoc comparisons (not working with one-way ANOVA properly),
you can test it with the same input file.
Expected results should be something like these (see Scheffe and Tukey columns) from JASP software (screenshot attached).

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: LazStats - A new statistics package
« Reply #19 on: March 30, 2020, 02:51:30 pm »
@Bart: I could move it to ccr/applications...

I think that would be nice.
It makes contributing much easier IMO.

Bart

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: LazStats - A new statistics package
« Reply #20 on: March 30, 2020, 11:27:41 pm »
OK - I moved my LazStats adaption now to CCR. It is in folder applications/lazstats. Download via SVN or create a zipped snapshot: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/applications/lazstats/

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: LazStats - A new statistics package
« Reply #21 on: March 30, 2020, 11:39:13 pm »
I think it would be nice to include the license statement in the ReadMe file. So it is clear to have a GPL'ed project and units
« Last Edit: March 30, 2020, 11:40:50 pm by af0815 »
regards
Andreas

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: LazStats - A new statistics package
« Reply #22 on: March 31, 2020, 12:30:31 am »
I doubt that the application is GPL - this is not mentioned anywhere in the files (as far as I could see). In the documentation file "Introduction.pdf", Bill writes, however:

Quote
"While I reserve the copyright protection of these packages, I make no restriction on their distribution or use. It is common courtesy, of course, to give me credit if you use these resources. Because I do not warrant them in any manner, you should insure yourself that the routines you use are adequate for your purposes."

This text is now contained in the README file.

I had contacted Bill by mail already some time ago, but did not get a response.


Sorry for the confusion. Bart had referred to the license.lfm, and this is where GPL2+ is clearly mentioned.
« Last Edit: March 31, 2020, 01:38:32 pm by wp »

 

TinyPortal © 2005-2018