cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Tod0931
New Member

对已知数据列进行抽样,统计其均值分布的脚本

从已知数据列中进行放回(或不放回)抽样,再统计每个样本的均值及分布,这个脚本如何编辑?例如,有2000个数据,每次随机抽取20个数据计算其均值,一共抽取100次,计算这100个样本的均值以及分布状况;

2 REPLIES 2
jthi
Super User

Re: 对已知数据列进行抽样,统计其均值分布的脚本

What do you mean by calculating distribution?

-Jarmo
hogi
Level XIII

Re: 对已知数据列进行抽样,统计其均值分布的脚本

Here is a script to take 100 subsets and calculate the mean:

dt = Open( "$SAMPLE_DATA/Aircraft Incidents.jmp" );
:Latitude << Format("Best");
dt << Select Where( Is Missing( :Latitude ) ) << Delete Rows;

runs = 100;
//runs= 100000; results = new table("results", add rows (runs), new column ("mean")); rows = index (1, nrows(dt)); for each({i},index(1,runs), myRows = Random Shuffle( rows)[1::20]; data = dt[myRows, "Latitude"]; results[i,"mean"]=Mean(data); ); my Mean = Col Mean(:mean); Show(myMean);

... and the mean of the means.

 

And with this script, you can use the Distribution platform to fit the 100 mean values with "all" available distributions:

dist = results << Distribution(Continuous Distribution(Column( :mean ));	);
dist << Fit All

hogi_0-1766783776928.png

Recommended Articles