World Statistics Day was yesterday, but we’re celebrating all week long! This celebration means acknowledging the impact statistics has on our world. Who is your favorite statistician? Share with us who they are and why they top your favorites list.
Choose Language Hide Translation Bar
JMP 함수를 활용한 Week Number 산출

주차(Week Number)를 만들기 위해서 아래와 같은  가상의 Data Table을 만든다.

New Table( "JMP Blog",
	Add Rows( 1097 ),
	New Column( "Date",
		Format( "yyyy-mm-dd", 12 ),
		Input Format( "yyyy-mm-dd" ),
		Set Selected

week number1.png

위와 같이 생성된 Data Table에서 다음과 같은 몇번의 함수작업을 통해 최종적인 주차(Week Number)를 구할 수 있다.

col= New Column("Month Abb", character, Formula(Substr( Format( :Date, "Monddyyyy" ), 1, 3 )));
col= New column("Week Num", character, Formula(Floor( (Day( :Date ) - Day Of Week( :Date ) - 1) / 7 + 2 )));
col= New Column("temp",formula(num(:Week Num)));
column(dt, "temp") << delete formula;
column(dt, "temp") << Data Type ( Character);
col= New Column("Weeks",character,<< set each value("W"));
col= New Column("Week Number", character, formula(:Month Abb || "-" || :temp || :Weeks));

최종 데이터 테이블은 다음과 같이 주어진다.

Week Number.png

완성된 JMP Data Table과 Sample Script를 첨부합니다.

Article Labels

    There are no labels assigned to this post.

Article Tags