cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-100825%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EC%C3%A1lculo%20manual%20del%20estad%C3%ADstico%20de%20prueba%20de%20Shapiro-Wilk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-100825%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHola%20a%20todos%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%C2%BFAlguien%20sabe%20c%C3%B3mo%20implementar%20el%20c%C3%A1lculo%20manual%20de%20la%20estad%C3%ADstica%20de%20prueba%20de%20Shapiro-Wilk%20en%20JMP%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%C2%BFUtilizando%20scripts%20JSL%20y%20%2F%20o%20f%C3%B3rmulas%20de%20columna%3F%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3ES%C3%A9%20que%20JMP%20realiza%20este%20c%C3%A1lculo%20de%20forma%20nativa%20en%20Analizar%26gt%3B%20Distribuci%C3%B3n%20y%20luego%20Ajuste%20continuo%26gt%3B%20Normal%26gt%3B%20Bondad%20de%20ajuste%2C%20pero%20estoy%20intentando%20reproducir%20el%20valor%20calculado%20del%20estad%C3%ADstico%20de%20prueba%20para%20comprender%20su%20base%20con%20mayor%20profundidad.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHay%20varias%20pistas%20%C3%BAtiles%20en%20las%20referencias%20en%20l%C3%ADnea%2C%20pero%20tengo%20algunas%20dificultades%20para%20juntar%20las%20piezas%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FShapiro%25E2%2580%2593Wilk_test%23cite_note-8%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2FShapiro%25E2%2580%2593Wilk_test%23cite_note-8%3C%2FA%3E%3C%2FP%3E%3CP%3EEsta%20es%20la%20base%20que%20se%20resume%20muy%20bien%20en%20el%20enlace%20de%20Wikepedia%20anterior%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22directly%20from%20wiki.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15032iC95B53270BB39F76%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22directly%20from%20wiki.JPG%22%20alt%3D%22directly%20from%20wiki.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ETambi%C3%A9n%20algunas%20pistas%20%C3%BAtiles%20aqu%C3%AD%20utilizando%20MS%20Excel.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.real-statistics.com%2Ftests-normality-and-symmetry%2Fstatistical-tests-normality-symmetry%2Fshapiro-wilk-test%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.real-statistics.com%2Ftests-normality-and-symmetry%2Fstatistical-tests-normality-symmetry%2Fshapiro-wilk-test%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-105759%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%A1lculo%20manual%20de%20la%20estad%C3%ADstica%20de%20prueba%20de%20Shapiro-Wilk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-105759%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EGracias%2C%20esto%20es%20excelente.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-105371%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%A1lculo%20manual%20de%20la%20estad%C3%ADstica%20de%20prueba%20de%20Shapiro-Wilk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-105371%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10483%22%20target%3D%22_blank%22%3E%20%40PatrickGiuliano%20%3C%2FA%3E%20No%20estoy%20seguro%20de%20por%20qu%C3%A9%20querr%C3%ADa%20hacer%20esto%20manualmente%2C%20cuando%20tiene%20un%20JMP%20que%20puede%20producir%20las%20estad%C3%ADsticas%20y%20puede%20extraerlo%20de%20un%20informe.%26nbsp%3B%20Una%20simulaci%C3%B3n%20en%20la%20que%20el%20tama%C3%B1o%20de%20la%20muestra%20es%20el%20mismo%2C%20por%20lo%20que%20los%20coeficientes%20de%20peso%20son%20los%20mismos%2C%20lo%20que%20significa%20que%20los%20pesos%20se%20calculan%20una%20vez%20y%20se%20usan%20muchas%20veces%2C%20podr%C3%ADa%20ser%20un%20buen%20escenario%20para%20hacerlo%20a%20mano%20%2F%20en%20matriz.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDicho%20esto%2C%20encontr%C3%A9%20referencias%20para%20los%20coeficientes%20y%20un%20algoritmo%20para%20obtenerlos.%26nbsp%3B%20Las%20referencias%20son%20reportadas%20en%20el%20script%20adjunto.%20Aqu%C3%AD%20est%C3%A1n%20los%20resultados%20de%20dos%20pruebas%20con%20N%20%3D%2040.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20499px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20499px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15074i933853B6B38086FF%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-105250%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%A1lculo%20manual%20de%20la%20estad%C3%ADstica%20de%20prueba%20de%20Shapiro-Wilk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-105250%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIgnora%20esto%20...%20No%20le%C3%AD%20tu%20solicitud%20muy%20de%20cerca%20...%20lo%20siento%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRIKE%3EJMP%20calcula%20la%20prueba%20de%20Shapiro-Wilk.%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRIKE%3EAbra%20una%20tabla%20de%20datos.%3C%2FSTRIKE%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRIKE%3EVaya%20a%20Ayuda%26gt%3B%20%C3%8Dndice%20de%20estad%C3%ADsticas%26gt%3B%20encuentre%20la%20prueba%20de%20normalidad%20de%20Shapiro-Wilk%20a%20la%20izquierda%2C%20luego%20presione%20lanzar%3C%2FSTRIKE%3E%3C%2FLI%3E%0A%3CLI%3E%3CSTRIKE%3ESeleccione%20las%20columnas%20de%20su%20tabla%20para%20ser%20probado%3C%2FSTRIKE%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRIKE%3ELa%20prueba%20est%C3%A1%20disponible%20en%20JMP%20PRO%2012%20y%20superior.%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CP%3E%3CSTRIKE%3E%26nbsp%3B%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CP%3E%3CSTRIKE%3EEs%20la%20prueba%20de%20Goodnes%20of%20Fit%20para%20un%20ajuste%20normal.%20El%20JSL%20es%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EDistribution(%0A%20Continuous%20Distribution(%0A%20%20Column(%20%3Aheight%20)%2C%0A%20%20Fit%20Distribution(%20Normal(%20Goodness%20of%20Fit(%201%20)%20)%20)%0A%20)%0A)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20397px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20397px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F15068iC85969CB10A752CC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102189%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%A1lculo%20manual%20de%20la%20estad%C3%ADstica%20de%20prueba%20de%20Shapiro-Wilk%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102189%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EAqu%C3%AD%20hay%20un%20enlace%20que%20realiza%20un%20c%C3%A1lculo%20paso%20a%20paso%20que%20puede%20usar.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fblog.excelmasterseries.com%2F2015%2F05%2Fhow-to-create-completely-automated_4.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fblog.excelmasterseries.com%2F2015%2F05%2Fhow-to-create-completely-automated_4.html%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

Manual Calculation of the Shapiro-Wilk Test Statistic

Hello Everyone, 

 

Does anyone know how to implement manual calculation of the Shapiro-Wilk test statistic in JMP? 

     Using JSL script and/ or column formulas?  

I know that JMP natively does this calculation natively in Analyze>Distribution and then Continuous Fit>Normal>Goodness of Fit, but I'm trying to reproduce the calculated value of the test statistic in order to understand it's basis with greater depth.

 

There are a number of useful clues in references online, but I'm having some difficulty putting the pieces together: 

https://en.wikipedia.org/wiki/Shapiro%E2%80%93Wilk_test#cite_note-8

Here's the basis for it summarized nicely from Wikepedia link above: 

directly from wiki.JPG

Also some helpful clues here using MS Excel.  

http://www.real-statistics.com/tests-normality-and-symmetry/statistical-tests-normality-symmetry/sha...

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Manual Calculation of the Shapiro-Wilk Test Statistic

@PatrickGiuliano I am not sure why you would want to do this manually, when you have JMP that can produce the statistics and you can extract it from a report.  A simulation where the sample size is the same so the weight coefficients are the same, meaning the weights are calculated once and used many times, might be a good scenario for doing this by hand/matrix.

 

That said, I found references for the coefficients and an algorithm to get them.  The references are reported in the attached script. Here are the results of two tests with N=40. 

image.png

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Manual Calculation of the Shapiro-Wilk Test Statistic

Here is a link that does a step by step calculation that you might be able to use.

http://blog.excelmasterseries.com/2015/05/how-to-create-completely-automated_4.html

Jim
gzmorgan0
Super User (Alumni)

Re: Manual Calculation of the Shapiro-Wilk Test Statistic

Ignore this...I did not read your request very closely...sorry

 

JMP calculates the Shapiro-Wilk's test.

  • Open a data table.
  • Go to Help > Statistics Index> find Shapiro-Wilk test for normality on the left, then press launch
  • Select which columns of your table to be tested

The test is available in JMP PRO 12 and higher.

 

It is the Goodnes of Fit test for a Normal Fit. The JSL is

Distribution(
	Continuous Distribution(
		Column( :height ),
		Fit Distribution( Normal( Goodness of Fit( 1 ) ) )
	)
);

 

 

image.png

gzmorgan0
Super User (Alumni)

Re: Manual Calculation of the Shapiro-Wilk Test Statistic

@PatrickGiuliano I am not sure why you would want to do this manually, when you have JMP that can produce the statistics and you can extract it from a report.  A simulation where the sample size is the same so the weight coefficients are the same, meaning the weights are calculated once and used many times, might be a good scenario for doing this by hand/matrix.

 

That said, I found references for the coefficients and an algorithm to get them.  The references are reported in the attached script. Here are the results of two tests with N=40. 

image.png

Re: Manual Calculation of the Shapiro-Wilk Test Statistic

Thank you this is excellent.

Recommended Articles