"제외된" 행 무시안녕하세요,
나는 여전히 JSL "고비"를 극복하려고 노력하고 있으므로 근본적인 질문을 용서하십시오.
문제:
- 샘플 접미사 a1, a2 및 a3이 있는 3회 반복에 대한 데이터 세트를 포함하는 샘플 테이블이 있습니다.
- 경우에 따라 복제본 중 하나를 "제외됨" 상태로 설정해야 합니다(아래 예는 a2임).
- 테이블을 열고 제외되지 않은 세트에만 계산을 적용하는 배치 스크립트를 작성 중입니다.
- 그러나 세 가지 모두의 데이터가 아직 고려 중이기 때문에 내 시도(아래 참조)에 아직 도달하지 못했습니다.
- 제외되지 않은 행을 식별한 다음 접미사 검색을 적용하려면 "and" 문이 필요할 수 있습니다.
모든 입력은 가장 감사할 것입니다.
고마워 닐
states = Current Data Table() << Get Row States();
For( i = 1, i <= N Rows( states ), i++,
rs = As Row State( states[i] );
if (Excluded(rs)==0,
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));
);
)
품질 및 프로세스 엔지니어링Re: "제외된" 행 무시확실히 표로 만드는 플랫폼과 요약 JSL 기능을 모두 살펴보십시오. 두 가지 모두 답변을 상당히 빨리 얻을 수 있다고 생각합니다.
Re: "제외된" 행 무시감사합니다!
나는 이것을 시도하고 어떻게되는지 볼 것입니다.
원래 의도는 각 세트(a1, a2 및 a3)에 대해 한 행에서 다공성을 가져와 평균을 얻는 것이었습니다. 다공성은 각 복제에 대해 동일하지만 3개의 개별 포인트와 평균을 추출하는 더 쉬운 방법을 찾을 수 없습니다.
입력해 주셔서 다시 한 번 감사드립니다.
닐
Re: "제외된" 행 무시다음은 홍채 데이터 테이블의 각 종을 살펴보고 해당 기준과 일치하는 행의 평균을 계산하는 업데이트된 스크립트입니다.즉, 이제 여러분이 무엇을 하고 있는지 더 잘 이해했으므로 이 문제를 다르게 처리하고 대신 해당 값을 찾기 위해 tabulate를 사용할 것입니다.
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
species list = {"setosa", "versicolor", "virginica"};
//For each species
for(s=1, s<= n items (species list), s++,
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == species list[s]));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list, use that to find which rows to average
mn = mean( :Sepal length[speciesmatches << get keys] );
//output averages to the log
write(species list[s] || " mean = " || char(mn) || "\!n")
);
표를 사용하는 옵션:
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//New column with the check for each value
New Column("Species_", Character, "Nominal", Formula(If(Contains(:Species, "se"), "se", Contains(:Species, "ve"), "ve", Contains(:Species, "vi"), "vi")));
//tabulate to find averages - script copied from 'source' of data table after selecting
//'make into data table' from tabulate platform, then inserted dt reference
dtTab = (dt << Tabulate(
Set Format( Mean( :Sepal length( 10, 4 ) ) ),
Add Table(
Column Table( Analysis Columns( :Sepal length ), Statistics( Mean ) ),
Row Table( Grouping Columns( :Species_ ) )
)
)) << Make Into Data Table;
//Now get values from the table
dtTab:"Mean(Sepal length)"n[dtTab << Get Rows Where(:Species_ == "se")];Re: "제외된" 행 무시어,
입력해 주셔서 감사합니다. 나는 아직 약간의 초보자이지만 연관 배열 개념을 찔렀습니다. 코드가 표시되고 "키 가져오기"까지 작동합니다. 그러나 필요한 계산(나열된 마지막 6줄)을 수행하기 위해 "speciesmatches"에서 필요한 정보를 얻는 방법을 여전히 확신하지 못합니다. 제외된 집합을 포함하는 일반적인 테이블의 이미지를 가져왔습니다.
닐
dt = Open( path );
// Find row that were excluded and load into list
Exc_row = dt << Get Excluded Rows;
dt << Select Rows( Exc_row );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(Contains(:Sample,"a1") |Contains(:Sample,"a2") |Contains(:Sample,"a3")));
//get excluded rows
Exc_row = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, Exc_row);
//get the matching rows as a list
speciesmatches << get keys;
// What needs to be done to get mean of three (or 2 sets in the case of exclusion see table image)
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));<BR />
c1 = Column("Image A pore area (%)");
mean1 = Mean(c1[a1[1]], c1[a2[1]], c1[a3[1]]);
Re: "제외된" 행 무시제외된 행 목록을 반복하지만 매번 동일한 분석을 수행하는 것처럼 보입니다. 실제로는 제외된 행 목록을 어디에서나 참조하지 않습니다.다음은 일치하는 행과 제외된 행을 가져온 다음 제외된 행을 목록에서 제거하는 문제를 해결할 수 있는 한 가지 방법입니다.
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == "setosa"));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list
speciesmatches << get keys;