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-769043%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-769043%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20JMP%20%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%E6%88%91%E5%8F%AA%E8%83%BD%E5%BC%84%E6%B8%85%E6%A5%9A%E5%A6%82%E4%BD%95%E5%9C%A8%E5%90%8C%E4%B8%80%E5%88%97%E4%B8%AD%E9%80%B2%E8%A1%8C%E8%A8%88%E7%AE%97%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3E%E7%AC%AC%E4%B8%80%E7%9A%84%3C%2FTD%3E%3CTD%3E%E7%AC%AC%E4%BA%8C%3C%2FTD%3E%3CTD%3E%E7%AC%AC%E4%B8%89%3C%2FTD%3E%3CTD%3E%E5%B1%A5%E6%AD%B7%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E2.450712%3C%2FTD%3E%3CTD%3E2.441128%3C%2FTD%3E%3CTD%3E2.430674%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1.267139%3C%2FTD%3E%3CTD%3E1.258429%3C%2FTD%3E%3CTD%3E1.260132%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E2053.459%3C%2FTD%3E%3CTD%3E2062.341%3C%2FTD%3E%3CTD%3E2067.839%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1.752283%3C%2FTD%3E%3CTD%3E1.761982%3C%2FTD%3E%3CTD%3E1.763598%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1.108177%3C%2FTD%3E%3CTD%3E1.113778%3C%2FTD%3E%3CTD%3E1.115453%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E1.232238%3C%2FTD%3E%3CTD%3E1.225236%3C%2FTD%3E%3CTD%3E1.232238%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E2.471146%3C%2FTD%3E%3CTD%3E2.465444%3C%2FTD%3E%3CTD%3E2.456794%3C%2FTD%3E%3CTD%3E%20%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-769043%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E5%9F%BA%E7%A4%8E%E8%B3%87%E6%96%99%E5%88%86%E6%9E%90%E8%88%87%E5%BB%BA%E6%A8%A1%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-769064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-769064%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E6%AD%A3%E5%9C%A8%E5%B0%8B%E6%89%BE%E2%80%9CStd%20Dev%E2%80%9D%E5%87%BD%E6%95%B8%E3%80%82%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F65667i35EDCFC0392B3195%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Jordan_Hiller_0-1719513951606.png%22%20alt%3D%22Jordan_Hiller_0-1719513951606.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fstatistical-functions.shtml%23%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F18.0%2F%23page%2Fjmp%2Fstatistical-functions.shtml%23%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E5%8F%A6%E8%AB%8B%E5%8F%83%E9%96%B1%E9%9A%A8%E9%99%84%E7%9A%84%E6%95%B8%E6%93%9A%E8%A1%A8%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-769065%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-769065%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E7%9A%84%E6%84%8F%E6%80%9D%E6%98%AF%E6%8C%89%E8%A1%8C%E5%97%8E%EF%BC%9F%E4%BE%8B%E5%A6%82%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20Std%20Dev%20%E5%87%BD%E6%95%B8%E4%B8%A6%E5%88%97%E5%87%BA%E5%88%97%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EStd%20Dev(%3Afirst%2C%20%3Asecond%2C%20third)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-769069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-769069%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E5%98%97%E8%A9%A6%E8%A8%88%E7%AE%97%E6%AF%8F%E8%A1%8C%E7%9A%84%E8%AE%8A%E7%95%B0%E4%BF%82%E6%95%B8%EF%BC%8C%E5%89%87%E7%82%BA%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22txnelson_0-1719514502263.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1719514502263.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1719514502263.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F65669iA67D6187A709414F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22txnelson_0-1719514502263.png%22%20alt%3D%22txnelson_0-1719514502263.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enames%20default%20to%20here(1)%3B%0Adt%3D%0ANew%20Table(%20%22example%22%2C%0A%09Add%20Rows(%207%20)%2C%0A%09New%20Column(%20%22first%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.4507119999999998%2C%201.267139%2C%202053.4589999999998%2C%201.752283%2C%201.108177%2C%0A%09%09%091.2322379999999999%2C%202.4711460000000001%5D%0A%09%09)%0A%09)%2C%0A%09New%20Column(%20%22second%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.441128%2C%201.258429%2C%202062.3409999999999%2C%201.7619819999999999%2C%0A%09%09%091.1137779999999999%2C%201.225236%2C%202.4654440000000002%5D%0A%09%09)%0A%09)%2C%0A%09New%20Column(%20%22third%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.4306739999999998%2C%201.260132%2C%202067.8389999999999%2C%201.763598%2C%201.115453%2C%0A%09%09%091.2322379999999999%2C%202.4567939999999999%5D%0A%09%09)%0A%09)%0A)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20new%20column(%22CV%22%2C%20formula(%20stddev(%3Afirst%2C%3Asecond%2C%3Athird)%2Fmean(%3Afirst%2C%3Asecond%2C%3Athird)))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E6%83%B3%E8%A8%88%E7%AE%97%E5%AE%8C%E6%95%B4%E8%B3%87%E6%96%99%E8%A1%A8%E7%9F%A9%E9%99%A3%E7%9A%84%20STD%EF%BC%8C%E5%89%87%E7%82%BA%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enames%20default%20to%20here(1)%3B%0Adt%3D%0ANew%20Table(%20%22example%22%2C%0A%09Add%20Rows(%207%20)%2C%0A%09New%20Column(%20%22first%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.4507119999999998%2C%201.267139%2C%202053.4589999999998%2C%201.752283%2C%201.108177%2C%0A%09%09%091.2322379999999999%2C%202.4711460000000001%5D%0A%09%09)%0A%09)%2C%0A%09New%20Column(%20%22second%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.441128%2C%201.258429%2C%202062.3409999999999%2C%201.7619819999999999%2C%0A%09%09%091.1137779999999999%2C%201.225236%2C%202.4654440000000002%5D%0A%09%09)%0A%09)%2C%0A%09New%20Column(%20%22third%22%2C%0A%09%09Numeric%2C%0A%09%09Set%20Values(%0A%09%09%09%5B2.4306739999999998%2C%201.260132%2C%202067.8389999999999%2C%201.763598%2C%201.115453%2C%0A%09%09%091.2322379999999999%2C%202.4567939999999999%5D%0A%09%09)%0A%09)%0A)%3B%0A%0AtotalSTD%20%3D%20stddev(dt%5B0%2C0%5D)%3B%0Ashow(totalSTD)%3B%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-772680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E5%A6%82%E4%BD%95%E8%A8%88%E7%AE%97%E5%A4%9A%E5%88%97%E7%9A%84%E6%A8%99%E6%BA%96%E5%B7%AE%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-772680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%8D%81%E5%88%86%E6%84%9F%E8%AC%9D%E4%BD%A0%E7%9A%84%E5%B9%AB%E5%8A%A9%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
emmablue
Level III

how to calculate standard deviation across multiple columns?

Is it possible to use JMP to calculate standard deviation across multiple columns? I could only figure out how to do the calculation in the same column. 

 

firstsecondthirdCV
2.4507122.4411282.430674 
1.2671391.2584291.260132 
2053.4592062.3412067.839 
1.7522831.7619821.763598 
1.1081771.1137781.115453 
1.2322381.2252361.232238 
2.4711462.4654442.456794 
3 ACCEPTED SOLUTIONS

Accepted Solutions

Re: how to calculate standard deviation across multiple columns?

You're looking for the "Std Dev" function.

 

Jordan_Hiller_0-1719513951606.png

 

https://www.jmp.com/support/help/en/18.0/#page/jmp/statistical-functions.shtml#

 

See attached data table as well.

View solution in original post

jthi
Super User

Re: how to calculate standard deviation across multiple columns?

Do you mean by row? You can for example use Std Dev function and list the columns

Std Dev(:first, :second, third)
-Jarmo

View solution in original post

txnelson
Super User

Re: how to calculate standard deviation across multiple columns?

If you are attempting to calculate the Coefficient of Variation for each row, it would be:

txnelson_0-1719514502263.png

names default to here(1);
dt=
New Table( "example",
	Add Rows( 7 ),
	New Column( "first",
		Numeric,
		Set Values(
			[2.4507119999999998, 1.267139, 2053.4589999999998, 1.752283, 1.108177,
			1.2322379999999999, 2.4711460000000001]
		)
	),
	New Column( "second",
		Numeric,
		Set Values(
			[2.441128, 1.258429, 2062.3409999999999, 1.7619819999999999,
			1.1137779999999999, 1.225236, 2.4654440000000002]
		)
	),
	New Column( "third",
		Numeric,
		Set Values(
			[2.4306739999999998, 1.260132, 2067.8389999999999, 1.763598, 1.115453,
			1.2322379999999999, 2.4567939999999999]
		)
	)
);

dt << new column("CV", formula( stddev(:first,:second,:third)/mean(:first,:second,:third)));

If you want to calculate the STD for the complete data table matrix it would be

names default to here(1);
dt=
New Table( "example",
	Add Rows( 7 ),
	New Column( "first",
		Numeric,
		Set Values(
			[2.4507119999999998, 1.267139, 2053.4589999999998, 1.752283, 1.108177,
			1.2322379999999999, 2.4711460000000001]
		)
	),
	New Column( "second",
		Numeric,
		Set Values(
			[2.441128, 1.258429, 2062.3409999999999, 1.7619819999999999,
			1.1137779999999999, 1.225236, 2.4654440000000002]
		)
	),
	New Column( "third",
		Numeric,
		Set Values(
			[2.4306739999999998, 1.260132, 2067.8389999999999, 1.763598, 1.115453,
			1.2322379999999999, 2.4567939999999999]
		)
	)
);

totalSTD = stddev(dt[0,0]);
show(totalSTD);
)
Jim

View solution in original post

3 REPLIES 3

Re: how to calculate standard deviation across multiple columns?

You're looking for the "Std Dev" function.

 

Jordan_Hiller_0-1719513951606.png

 

https://www.jmp.com/support/help/en/18.0/#page/jmp/statistical-functions.shtml#

 

See attached data table as well.

jthi
Super User

Re: how to calculate standard deviation across multiple columns?

Do you mean by row? You can for example use Std Dev function and list the columns

Std Dev(:first, :second, third)
-Jarmo
txnelson
Super User

Re: how to calculate standard deviation across multiple columns?

If you are attempting to calculate the Coefficient of Variation for each row, it would be:

txnelson_0-1719514502263.png

names default to here(1);
dt=
New Table( "example",
	Add Rows( 7 ),
	New Column( "first",
		Numeric,
		Set Values(
			[2.4507119999999998, 1.267139, 2053.4589999999998, 1.752283, 1.108177,
			1.2322379999999999, 2.4711460000000001]
		)
	),
	New Column( "second",
		Numeric,
		Set Values(
			[2.441128, 1.258429, 2062.3409999999999, 1.7619819999999999,
			1.1137779999999999, 1.225236, 2.4654440000000002]
		)
	),
	New Column( "third",
		Numeric,
		Set Values(
			[2.4306739999999998, 1.260132, 2067.8389999999999, 1.763598, 1.115453,
			1.2322379999999999, 2.4567939999999999]
		)
	)
);

dt << new column("CV", formula( stddev(:first,:second,:third)/mean(:first,:second,:third)));

If you want to calculate the STD for the complete data table matrix it would be

names default to here(1);
dt=
New Table( "example",
	Add Rows( 7 ),
	New Column( "first",
		Numeric,
		Set Values(
			[2.4507119999999998, 1.267139, 2053.4589999999998, 1.752283, 1.108177,
			1.2322379999999999, 2.4711460000000001]
		)
	),
	New Column( "second",
		Numeric,
		Set Values(
			[2.441128, 1.258429, 2062.3409999999999, 1.7619819999999999,
			1.1137779999999999, 1.225236, 2.4654440000000002]
		)
	),
	New Column( "third",
		Numeric,
		Set Values(
			[2.4306739999999998, 1.260132, 2067.8389999999999, 1.763598, 1.115453,
			1.2322379999999999, 2.4567939999999999]
		)
	)
);

totalSTD = stddev(dt[0,0]);
show(totalSTD);
)
Jim

Recommended Articles