문제
JMP에서 분석을 실행하고 플랫폼 보고서에서 일부 통계를 추출하려고 합니다. 그런 다음 해당 통계를 사용자 지정 보고서 창에 배치하여 데이터 테이블 및 플랫폼 보고서를 닫은 후에도 유지할 수 있습니다.
해결책
분석 보고서의 보고서 계층에 대한 참조를 얻고 JSL 메시지를 사용하여 통계를 추출할 수 있습니다.
이 예에서는 이변량 플랫폼 보고서가 생성되고 보고서 계층에 대한 참조를 얻습니다( 보고하다 ). 해당 참조를 사용하여 이변량 보고서에서 변수와 문자열을 추출할 수 있습니다. 그런 다음 새 사용자 정의 보고서 창이 생성되고 보고서에서 추출된 통계 및 문자열로 채워집니다. 마지막으로 데이터 테이블이 닫히면 이변량 보고서가 닫히지만 사용자 정의 보고서 창은 계속 열려 있습니다.
Names Default To Here(1);
sd = Open( "$SAMPLE_DATA/Lipid Data.JMP" );
biv = sd << Bivariate( // biv is the analysis layer.
Y( :Triglycerides ),
X( :LDL ),
Density Ellipse( 0.95, {Line Color( {213, 72, 87} )} ),
Fit Line( {Line Color( {57, 177, 67} )} )
);
/* Get a reference to the report layer. */
reportbiv = biv << Report;
// Make sure the "Bivariate Normal Ellipse" outline
// in the Bivariate report is open. You can then see which
// content to extract into the Custom report.
reportbiv[Outline Box( "Bivariate Normal Ellipse P=0.950" )] << Close( 0 );
// Extract the correlation coefficient.
corrvalue = reportbiv[Outline Box( "Bivariate Normal Ellipse P=0.950" )][Number Col Box( "Correlation" )] << Get( 1 );
// Extract the numeric values from the Summary of Fit report as a matrix.
sumfit = reportbiv[Outline Box( "Summary of Fit" )][Number Col Box( 1 )] << Get as Matrix;
// Extract the Term column of the Parameter Estimates report as a list of strings.
term = reportbiv[Outline Box( "Parameter Estimates" )][String Col Box( "Term" )] << Get();
// Extract the Parameter Estimates values as a matrix.
parmests = reportbiv[Outline Box( "Parameter Estimates" )][Table Box( 1 )] << Get as Matrix;
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
/* The Lineup box defines a two-column layout, each of which contains a Text Box. */
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[2] ), ),
tb = Table Box(
/* Display an empty string in the first column and the text in the second column. */
String Col Box( " ", {"Sample Size: ", "Adjusted RSquare: ", "RSquare: ", "Correlation:"} ),
/* Insert a 30 pixel x 30 pixel spacer between the columns. */
Spacer Box( Size( 30, 30 ) ),
/* Display an empty string in the first column and the statistics in the second column. */
Number Col Box( " ", sumfit[{5,2,1}] |/ corrvalue )
),
/* Insert a 1 x 30 spacer. */
Spacer Box( Size( 0, 30 ) ),
Table Box(
/* Display the cloned String Col Box and insert the Parameter Estimates and Standard Error values. */
String Col Box( "Term", term ),
Number Col Box( "Estimate", parmests[0,1] ),
Number Col Box( "Standard Error", parmests[0,2] )
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Heading Column Borders( 0 ); // Turn off table column borders.
Close( sd ); // Close the data table.
논의
JMP 플랫폼 보고서에는 플랫폼 레이어와 보고서 레이어라는 두 개의 레이어가 있습니다. 플랫폼 계층에 대한 참조인 JSL 개체가 있는 경우 해당 개체에 분석과 관련된 메시지를 보낼 수 있습니다. 이들은 일반적으로 빨간색 삼각형 메뉴에 있는 옵션입니다. 보고서 계층에 대한 참조인 JSL 개체가 있는 경우 보고서 자체와 관련된 해당 개체에 메시지를 보낼 수 있습니다. 이러한 메시지는 값이나 이미지를 추출하고, 선택을 변경하고, 개요 노드를 열고 닫는 등의 작업을 수행할 수 있습니다.
또한보십시오
이 기사는 JMP 문서의 예 .
이 코드를 따라 다른 보고서에서 사용하려고 했습니다.
내 의도는 여러 모델을 실행하고 여기에 표시된 방식으로 중요한 결과를 표로 요약하는 것입니다.
다음은 내가 목표로 하는 것을 보여주는 샘플 데이터 세트에 대한 간단한 예입니다.
우선 모델의 P-값을 추출하려고 했습니다. 그래서 두 번째 모델을 주석 처리하고 다음 코드를 작성했습니다.
Open("$SAMPLE_DATA/Detergent.jmp");
Model1 = Fit Model(
Y( :previous use ),
Effects( :softness ),
Personality( "Nominal Logistic" ),
Run(
Positive Level( "yes" ),
Likelihood Ratio Tests( 1 ),
Wald Tests( 1 ),
Odds Ratios( 1 ),
ROC Curve( 1 )
)
);
reportMod = Model1 << Report;
FMchi = reportMod[Outline Box( "Whole Model Test" )][Number Col Box( "Prob>ChiSq" )] << Get( 1 );
dlg = New Window( "Custom Report11",
Outline Box( "Selected Values",
Table Box(
String Col Box( "Pvalue", FMchi )
)
)
);
/*
Model2=Fit Model(
Y( :previous use ),
Effects( :count ),
Personality( "Nominal Logistic" ),
Run(
Positive Level( "yes" ),
Likelihood Ratio Tests( 1 ),
Wald Tests( 0 ),
Odds Ratios( 1 ),
ROC Curve( 1 ),
Logistic Plot( 1 )
)
);내가 원하는 최종 테이블은 다음과 같습니다.
기인하다 | 전체 모델 테스트 | 알스퀘어 (U) | N | 추정 | 문제>ChiSq | 교차비 | AUC |
연성 | 1.000 | 0.000 | 24 | 0 | 1.000 | 1.000 | 0.500 |
세다 | 0.5268 | 0.012 | 24 | 0.0183 | 0.5301 | 1.01847 | 0.5625 |
다음은 추출된 데이터를 강조 표시한 보고서의 스크린샷입니다.
(속성 부드러움에서 매개변수 추정 및 오즈비의 경우 저널에서 첫 번째 행만 가져왔습니다.)




원본 리포트 창이 뜨는데 추가 리포트 창이 열리지도 않습니다.
모든 팁이 적용됩니다.
티아, 일라이