DATA-05 · DATA SCIENCE

결측·중복·이상값과 원자료를 보존하는 정제Missingness, repetition, outliers and source-preserving cleaning

표시·가정 비교·검증된 정정을 구별하는 실제 코드Actual code distinguishing review flags, comparisons and verified corrections

실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions

기초Foundations

1. 없애기 전에 무엇이 다른지 묻는다1. Ask what differs before removing anything

표에 빈 칸이 있고 같은 숫자가 반복되며 아주 큰 값도 있습니다. 세 가지를 모두 “나쁜 자료”라고 부르면 서로 다른 문제를 놓칩니다. 빈 칸은 미관측일 수 있고, 같은 값은 다른 관측에서 나올 수 있으며, 큰 값은 실제 중요한 사건일 수 있습니다. 먼저 어떤 근거로 무엇을 표시했는지 적습니다.

앞 장의 읽기 계약을 이어 받아 원값·출처 키·가용 분모를 보존합니다. 가정 자료에서 0과 결측을 구별한 뒤 실제 720개 국가년, 3,613명 원행, 1,599개 와인 기록과 원 코드 407의 두 점포 원행을 확인합니다. 표시·작업 사본·제외 비교·검증된 정정의 지위를 나눕니다.

브라우저는 실제 실행해 보관한 Python/R 기록을 선택해 보여 줍니다. 입력 메모가 코드로 실행되지는 않습니다. 내려받은 코드는 실제 언어의 새 프로세스에서 실행하며, 운영체제·버전·입력·옵션과 성공·오류 출력을 함께 읽습니다.

A table has blanks, repeated numbers and unusually large values. Calling all three “bad data” hides different questions. A blank may be unavailable; equal values can belong to different observations; a large value can be a real event. State the evidence and the review rule before taking action.

Carry the previous chapter’s import contract forward: preserve source values, provenance keys and available denominators. Start with a toy distinction between zero and missingness, then inspect 720 actual country-years, 3,613 person rows, 1,599 wine records and two original store-code 407 records. Separate flags, working copies, exclusion comparisons and verified corrections.

The browser selects archived actual Python/R runs; prediction notes are never executed. Downloaded source runs in a fresh real process. Read versions, inputs, settings and actual successes or errors together.

기초Foundations

2. 관측 0과 미관측은 같은 값이 아니다2. Observed zero and missingness are different states

전화 실패 횟수 0은 실패가 없었다는 관측일 수 있습니다. 임금 칸이 미관측이면 임금이 0이었다는 관측이 아닙니다. 0을 지우거나 빈 칸을 모두 0으로 채우는 규칙은 서로 반대 방향으로 분모와 평균을 바꿉니다.

미관측도 하나의 이유만 갖지는 않습니다. 조사하지 않음·응답 없음·해당 없음·읽기 실패는 다를 수 있습니다. 원자료에 이유가 없다면 이유까지 알아낸 것처럼 분류하지 않습니다. 자료형의 결측 표식과 실제 발생 원인을 구별해 기록합니다.

A recorded zero call-failure count can mean no failures occurred. An unavailable wage is not an observed wage of zero. Dropping zeros or replacing every blank with zero changes denominators and summaries in different ways.

Missingness can have different origins: not collected, nonresponse, not applicable or conversion failure. If the source gives no reason, do not pretend to know one. A language’s missing marker and the substantive cause of missingness are separate facts.

기초Foundations

3. None·NA와 변환 실패의 경로를 보존한다3. Retain None, NA and conversion-failure paths

작은 Python 예에서는 미관측을 None으로, R 예에서는 NA_real_로 둡니다. 이 두 언어의 모든 자료형이 같은 방식으로 결측을 처리하는 것은 아닙니다. 예를 들어 어떤 함수는 오류를 내고 어떤 함수는 결측을 전파하거나 제외 옵션을 요구합니다.

문자열을 수로 바꾸다가 실패한 경우에는 원 문자열과 실패 표지를 함께 남깁니다. 변환 때문에 생긴 미관측을 출처에서 원래 비어 있던 칸과 합치면 어디서 정보가 사라졌는지 추적하기 어렵습니다. 이 장의 실제 검증 예제는 선언한 횟수·코드·키 조건을 점검하며, 임의의 모든 문자열 변환기를 구현하지 않습니다.

The small Python examples use None; R uses NA_real_. This does not make every language type or function handle missingness identically. Some operations fail, some propagate missingness, and others need an explicit exclusion option.

When numerical conversion fails, retain source text alongside a failure flag. Merging newly failed conversions with originally unavailable cells obscures where information was lost. The actual validation examples check declared counts, codes and keys; they are not general parsers for arbitrary input text.

기초Foundations

4. 분모를 먼저 고정하고 평균을 계산한다4. Fix the denominator before calculating a mean

가정 값은 (0,2,미관측,4)입니다. 전체 원행은 4개이고 가용값은 3개입니다. 가용값 평균은 2입니다. 미관측을 가정 0으로 채운 비교에서는 합은 같아도 분모가 4가 되어 1.5입니다. 두 수는 같은 계산의 표현 차이가 아닙니다.

nsource=4,navailable=3xˉavailable=6/3=2xˉzero=6/4=1.5\begin{gathered}n_{\rm source}=4,\quad n_{\rm available}=3\\\bar x_{\rm available}=6/3=2\\\bar x_{\rm zero}=6/4=1.5\end{gathered}

두 번째 계산은 원래 관측하지 않은 값을 0으로 가정한 것입니다. 원 진실을 복구한 것은 아닙니다. 원자료와 비교 사본을 구별하고 분모 변경을 결과 옆에 적습니다.

Toy values are zero, two, missing and four. There are four source rows but three available values. The available mean is two. Replacing missingness by an assumed zero leaves the sum unchanged but changes the denominator, giving 1.5. These are different calculations.

nsource=4navailable=3xˉavailable=2xˉzero=1.5\begin{gathered}n_{\rm source}=4\\n_{\rm available}=3\\\bar x_{\rm available}=2\\\bar x_{\rm zero}=1.5\end{gathered}

The second result assumes a value for an unobserved cell; it does not recover its truth. Keep the source and comparison copy distinct, with their denominators next to the result.

기초Foundations

5. 가용값 요약 코드를 한 줄씩 따라간다5. Trace the available-value summary code

다음은 실제 실행한 Python 가정 예의 전체 코드와 출력입니다. x is not None은 0을 남기며, if not values에 해당하는 빈 가용 집합에서는 평균을 0으로 만들지 않고 미정의 상태를 반환합니다. 이 프로그램은 원파일을 덮어쓰지 않습니다.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import csv,json,sys
from fractions import Fraction
def load(path):
    with open(path,encoding="utf-8-sig",newline="") as handle:
        return list(csv.DictReader(handle))
def mean(values):
    return None if not values else sum(values)/len(values)
def shown(value):
    return None if value is None else str(value)
values=[Fraction(0),Fraction(2),None,Fraction(4)]
source_total=4
valid=[x for x in values if x is not None]
reported=valid if 'available'=="available" else [Fraction(0) if x is None else x for x in values]
print(json.dumps({"sourceTotalRows":source_total,"selectedOriginalRows":len(values),"availableN":len(valid),"sourceMissingN":len(values)-len(valid),"reportedDenominator":len(reported),"reportedMeanExact":shown(mean(reported)),"zeroFillAppliedOnlyToComparison":'available'!="available","missingTruthRecovered":False,"sourceModified":False}))
{"sourceTotalRows": 4, "selectedOriginalRows": 4, "availableN": 3, "sourceMissingN": 1, "reportedDenominator": 3, "reportedMeanExact": "2", "zeroFillAppliedOnlyToComparison": false, "missingTruthRecovered": false, "sourceModified": false}

R에서는 !is.na(values)로 가용값을 고르고 같은 분모를 확인합니다. 언어를 바꿔도 원값의 지위와 질문의 분모가 자동으로 바뀌지는 않습니다. 실습에서 두 실제 기록의 코드와 출력을 대조하세요.

This is the complete source and output of an actual Python toy run. The test x is not None retains zero. If no values are available, the helper returns an undefined mean rather than zero. The program overwrites no source file.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import csv,json,sys
from fractions import Fraction
def load(path):
    with open(path,encoding="utf-8-sig",newline="") as handle:
        return list(csv.DictReader(handle))
def mean(values):
    return None if not values else sum(values)/len(values)
def shown(value):
    return None if value is None else str(value)
values=[Fraction(0),Fraction(2),None,Fraction(4)]
source_total=4
valid=[x for x in values if x is not None]
reported=valid if 'available'=="available" else [Fraction(0) if x is None else x for x in values]
print(json.dumps({"sourceTotalRows":source_total,"selectedOriginalRows":len(values),"availableN":len(valid),"sourceMissingN":len(values)-len(valid),"reportedDenominator":len(reported),"reportedMeanExact":shown(mean(reported)),"zeroFillAppliedOnlyToComparison":'available'!="available","missingTruthRecovered":False,"sourceModified":False}))
{"sourceTotalRows": 4, "selectedOriginalRows": 4, "availableN": 3, "sourceMissingN": 1, "reportedDenominator": 3, "reportedMeanExact": "2", "zeroFillAppliedOnlyToComparison": false, "missingTruthRecovered": false, "sourceModified": false}

R selects availability with !is.na(values). Changing languages does not change the observational status of values or the question’s denominator. Compare both actual records in the lab.

기초Foundations

6. 빈 자료와 모두 미관측인 자료도 구별한다6. Distinguish empty data from all-missing data

원행이 하나도 없는 표와 원행은 4개인데 값이 모두 미관측인 표는 다릅니다. 둘 다 가용값 평균은 정의되지 않지만, 전체 원행 수와 미관측 수가 다릅니다. 평균 자리에 0을 쓰면 이 두 상태와 실제 0 평균까지 섞입니다.

전체·가용·미관측 수를 함께 보고하고, 필요한 열이 아예 없는 경우도 따로 검사합니다. 이후 조인에서는 키가 없는 것과 키는 있지만 값이 미관측인 것이 달라집니다. 다음 장에서 이 차이가 조회 결과를 어떻게 바꾸는지 실제 표로 확인합니다.

A table with no source rows differs from a four-row table whose values are all missing. Neither has an available-value mean, but their source and missing counts differ. Reporting zero mixes both states with a genuinely observed mean of zero.

Report source, available and unavailable counts together, and separately check whether a required column exists at all. The next chapter shows how an absent key differs from a matched key with a missing value.

기초Foundations

7. 가용값 평균이 전체 대상 평균을 알려 주는가7. Does an available mean identify the full target?

가용값 평균은 실제 가용값의 요약입니다. 미관측이 많은 집단을 제외했을 때 전체 대상의 평균과 같다고 보장하려면 추가 정보나 가정이 필요합니다. “결측을 제외했다”라는 함수 옵션은 그 가정을 증명하지 않습니다.

실제 국가 자료의 네 미관측 GDP는 VNM 1980~1983입니다. 이 네 칸을 원 관측 0으로 바꾸지 않습니다. Card의 3,613명 중 가용 로그 3,010개의 평균도 그 가용 집합의 요약입니다. 결측 메커니즘·대체·민감도의 통계적 정당화는 뒤의 통계 장과 연결하지만, 이 장에서는 알 수 없는 평균을 알아냈다고 하지 않습니다.

An available-value mean summarizes available values. Equating it with the full target after excluding unavailable groups requires additional information or assumptions. A function option that drops missingness does not prove those assumptions.

The four unavailable GDP cells are Vietnam in 1980–1983; preserve them as unavailable. The mean of 3,010 available Card logs among 3,613 source rows describes that available set. Later statistics chapters examine mechanisms, imputation and sensitivity; this chapter does not claim to recover the unknown full mean.

기초Foundations

8. 실습 A · 같은 합과 달라진 분모8. Lab A · the same sum with different denominators

가정 4값, 실제 국가 1980년, 실제 사람 로그를 선택합니다. 가용값 요약과 명시적 0채움 비교를 먼저 예상하세요. 국가 입력 파일은 720행을 보존하고 이 고정 예에서만 1980년의 16개 국가년을 고릅니다. 사람 예는 원 3,613행을 유지합니다.

실제 Python의 정확 분수와 R의 수치 근사 출력을 나누어 읽습니다. 브라우저 공개 버튼은 보관 기록 조회이며 원파일 변경이나 새 대체 실행이 아닙니다. 0채움 비교를 고르더라도 원 결측 상태는 보존됩니다.

Select the four-value toy, actual country records for 1980, or actual person logs. Predict the available summary and explicit zero-fill comparison. The country file retains 720 rows; this fixed example selects sixteen country-years for 1980. The person example retains 3,613 source rows.

Distinguish Python’s exact-fraction output from R numerical approximations. Reveal selects an archived record; it does not modify a source file or execute new imputation. Original missingness remains preserved.

기초Foundations

9. 같은 숫자는 같은 관측이라는 뜻인가9. Do equal numbers mean the same observation?

두 학생이 같은 키를 가질 수 있습니다. 두 와인 기록의 수치도 같을 수 있습니다. 값이 같다는 것은 선택한 열에서 값이 일치한다는 뜻이며, 실제 같은 개체를 두 번 잘못 적었다는 뜻까지 포함하지 않습니다.

반복을 조사할 때 무엇을 비교했는지 정합니다. 모든 원 열, 몇 개 입력 열, 원 식별 코드, 원행 키는 서로 다른 비교 기준입니다. 원행 키는 보관 위치를 추적할 뿐 영구 개체 ID나 통계적 독립성을 자동으로 보증하지 않습니다.

Two students can have the same height. Two wine records can have equal measurements. Equality on selected fields does not establish that one real unit was accidentally entered twice.

Declare the comparison: all source fields, a subset of inputs, an original code or a source-row key. These define different rules. A source-row key traces the archive without automatically establishing a persistent entity ID or statistical independence.

기초Foundations

10. 반복 코드와 고유 원행을 나눈다10. Separate repeated codes from unique source rows

NJ/PA 점포 원 코드 407은 원행 42와 168에 있습니다. 두 원행은 주·체인·FTE 값이 다릅니다. 코드 숫자가 같다고 한 행을 지우면 다른 원 기록을 잃습니다. 같은 코드가 두 번 있다는 사실과 같은 원행이 복사되었다는 주장은 다릅니다.

정렬할 때 원행 키와 모든 값을 함께 움직입니다. 열 하나만 정렬하면 원래의 전후 짝이나 변수 간 관계를 새로 만들어 버릴 수 있습니다. 고유성·결측·한 키의 대응 수를 검사한 뒤 결합하고, 원자료의 실제 관계를 알고 있는지도 별도로 적습니다.

Original NJ/PA store code 407 appears at source rows 42 and 168. State, chain and FTE values differ. Dropping one row because the codes match loses a distinct source record. Repeated codes and copied records are different claims.

Sort source keys and whole records together. Sorting a single column can invent before/after pairings or cross-variable relationships. Check uniqueness, missingness and match counts before joining, while separately stating what is known about the real relationship.

기초Foundations

11. 숫자 값 조합의 비교 규칙을 선언한다11. Declare a numerical-signature rule

이번 와인 비교는 이화학 11열과 quality를 합한 12개 수치의 정확한 값 조합을 씁니다. 예를 들어 문자열 1.0과 1.00은 원 표기는 달라도 이 규칙에서는 같은 수입니다. 반면 원 문자열 자체를 비교하는 규칙은 다르게 나눌 수 있습니다. 원 소수 문자열과 선택한 규칙을 둘 다 남깁니다.

Python 프로그램은 원 소수를 Fraction으로 읽어 조합을 만듭니다. R의 보관 예는 이 실제 파일의 제한된 소수값을 수치로 읽고 조합을 만듭니다. 두 기록의 같은 집계 결과가 모든 가능한 고정밀 소수에서 R과 정확 유리수가 같다는 증명은 아닙니다.

The wine comparison uses the numerical values of eleven physicochemical fields plus quality. Strings 1.0 and 1.00 have different spellings but equal numbers under this rule. Comparing original strings can define a different partition. Retain both source decimals and the declared rule.

Python constructs signatures with Fraction from source decimals. The archived R example numerically reads this file’s limited decimals before grouping. Matching counts here do not prove that binary 64 and exact fractions agree for every possible high-precision input.

기초Foundations

12. 기록 수·값 조합 수·추가 반복 수를 따로 센다12. Count records, signatures and additional occurrences separately

실제 레드 와인 1,599행에는 12개 수치 기준 1,359개 값 조합이 있습니다. 같은 조합이 두 번 이상 나오는 조합은 220개이고, 각 조합의 첫 기록을 넘어선 추가 기록 수는 240개입니다. 220과 240은 다른 것을 셉니다.

등장 횟수 1·2·3·4인 조합 수는 각각 1,139·204·12·4입니다. 다음 두 합으로 원 기록 수와 조합 수를 각각 확인합니다. 조합 번호를 실제 병의 식별자로 바꾸어 읽지 않습니다.

1139+204+12+4=13591139+2(204)+3(12)+4(4)=1599204+2(12)+3(4)=240\begin{gathered}1139+204+12+4=1359\\1139+2(204)+3(12)+4(4)=1599\\204+2(12)+3(4)=240\end{gathered}

The 1,599 actual red-wine rows contain 1,359 twelve-value signatures. There are 220 signatures occurring more than once, but 240 occurrences beyond the first occurrence of each signature. These count different things.

Multiplicities one through four have 1,139, 204, 12 and four signatures. Count signatures and records separately; a signature label is not an observed bottle identifier.

1139+204+12+4=13591139+408+36+16=1599204+24+12=240\begin{gathered}1139+204+12+4=1359\\1139+408+36+16=1599\\204+24+12=240\end{gathered}
기초Foundations

13. 실제 코드에서 표지와 가정 축약을 구별한다13. Separate flags from illustrative collapse in actual code

실제 실행 코드는 각 값 조합에 대응하는 원행 번호들을 모읍니다. 표지 모드는 원행을 모두 남기고 반복 횟수를 붙입니다. 가정 축약 모드는 각 조합의 첫 원행 번호만 비교 대상으로 고르지만 원파일은 바꾸지 않습니다. 첫 행을 고르는 규칙이 출처에서 검증된 정정이라는 주장은 하지 않습니다.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import csv,json,sys
from fractions import Fraction
def load(path):
    with open(path,encoding="utf-8-sig",newline="") as handle:
        return list(csv.DictReader(handle))
def mean(values):
    return None if not values else sum(values)/len(values)
def shown(value):
    return None if value is None else str(value)
ids=[1,2,3]
signatures=[(Fraction(2),),(Fraction(2),),(Fraction(5),)]
rule="one toy numeric value"
groups={}
for source_id,key in zip(ids,signatures): groups.setdefault(key,[]).append(source_id)
counts=[len(groups[key]) for key in signatures]
first_ids=[group[0] for group in groups.values()]
proposed_ids=ids if 'flag'=="flag" else first_ids
print(json.dumps({"originalN":len(ids),"signatureCount":len(groups),"repeatedSignatureCount":sum(len(g)>1 for g in groups.values()),"additionalOccurrences":len(ids)-len(groups),"maximumMultiplicity":max(counts),"rule":rule,"firstSourceIDs":ids[:8],"firstMultiplicities":counts[:8],"proposedSelectedN":len(proposed_ids),"firstProposedSourceIDs":proposed_ids[:8],"collapseIsSourceVerifiedCorrection":False,"originalSourceModified":False}))
{"originalN": 3, "signatureCount": 2, "repeatedSignatureCount": 1, "additionalOccurrences": 1, "maximumMultiplicity": 2, "rule": "one toy numeric value", "firstSourceIDs": [1, 2, 3], "firstMultiplicities": [2, 2, 1], "proposedSelectedN": 3, "firstProposedSourceIDs": [1, 2, 3], "collapseIsSourceVerifiedCorrection": false, "originalSourceModified": false}

가정 값 (2,2,5)의 원행은 3개, 조합은 2개입니다. 첫 두 값이 실제 같은 개체라는 정보는 없습니다. 와인에서도 같은 구별을 적용하고, 원행 목록을 따라 어느 기록이 비교에서 빠지는지 확인합니다.

The actual program groups source-row numbers by signature. Flag mode retains all rows and attaches multiplicities. Illustrative collapse selects the first row of each signature for comparison, without changing the source. Selecting a first occurrence is not a source-verified correction.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import csv,json,sys
from fractions import Fraction
def load(path):
    with open(path,encoding="utf-8-sig",newline="") as handle:
        return list(csv.DictReader(handle))
def mean(values):
    return None if not values else sum(values)/len(values)
def shown(value):
    return None if value is None else str(value)
ids=[1,2,3]
signatures=[(Fraction(2),),(Fraction(2),),(Fraction(5),)]
rule="one toy numeric value"
groups={}
for source_id,key in zip(ids,signatures): groups.setdefault(key,[]).append(source_id)
counts=[len(groups[key]) for key in signatures]
first_ids=[group[0] for group in groups.values()]
proposed_ids=ids if 'flag'=="flag" else first_ids
print(json.dumps({"originalN":len(ids),"signatureCount":len(groups),"repeatedSignatureCount":sum(len(g)>1 for g in groups.values()),"additionalOccurrences":len(ids)-len(groups),"maximumMultiplicity":max(counts),"rule":rule,"firstSourceIDs":ids[:8],"firstMultiplicities":counts[:8],"proposedSelectedN":len(proposed_ids),"firstProposedSourceIDs":proposed_ids[:8],"collapseIsSourceVerifiedCorrection":False,"originalSourceModified":False}))
{"originalN": 3, "signatureCount": 2, "repeatedSignatureCount": 1, "additionalOccurrences": 1, "maximumMultiplicity": 2, "rule": "one toy numeric value", "firstSourceIDs": [1, 2, 3], "firstMultiplicities": [2, 2, 1], "proposedSelectedN": 3, "firstProposedSourceIDs": [1, 2, 3], "collapseIsSourceVerifiedCorrection": false, "originalSourceModified": false}

The toy values (2,2,5) have three source records and two signatures. Nothing identifies the first two records as one real unit. Carry that distinction into the wine example and trace every selected or omitted source-row key.

기초Foundations

14. 조합별 한 행은 관측별 한 행과 가중치가 다르다14. One row per signature changes weighting

가정 값 (2,2,5)의 기록별 평균은 3이고 조합별 한 값 (2,5)의 평균은 3.5입니다. 두 번째 계산은 같은 관측 요약을 더 정확하게 만든 것이 아니라 조합별 균등 가중치라는 다른 대상을 계산합니다. 반대로 원래 조합의 등장 횟수를 가중치로 유지하면 기록별 평균을 복원할 수 있습니다.

xˉrecords=(2+2+5)/3=3xˉsignatures=(2+5)/2=3.5\begin{gathered}\bar x_{\rm records}=(2+2+5)/3=3\\\bar x_{\rm signatures}=(2+5)/2=3.5\end{gathered}

와인의 quality는 순서형 점수입니다. 이 수치 평균 자체도 점수 간격을 수치로 사용하는 기술 요약이라는 범위를 남깁니다. 실제 병 개수·품질 개선·소비자 선호 효과를 이 평균 차이에서 만들어 내지 않습니다.

Toy records (2,2,5) average three, while the two signatures (2,5) average 3.5. The latter changes the target to equal weighting of signatures. It is not automatically a more accurate version of the same summary. Retaining multiplicity weights can recover the record-weighted mean.

xˉrecords=3xˉsignatures=3.5\begin{gathered}\bar x_{\rm records}=3\\\bar x_{\rm signatures}=3.5\end{gathered}

Wine quality is ordered; its numerical mean is a descriptive choice using score gaps. A change in that mean does not establish bottle counts, quality improvement or a consumer preference effect.

심화Extension

15. 심화: 동등류를 만들 때 버리는 정보도 적는다15. Advanced: state the information lost in equivalence classes

선택한 값 조합이 같은 두 기록을 동등하다고 정하면 원행 집합을 동등류로 나눌 수 있습니다. 같은 값 조합이라는 관계는 반사·대칭·추이를 만족합니다. 그러나 이 수학적 분할이 현실의 “같은 측정 개체”라는 관계와 같다는 보장은 없습니다.

조합 하나만 남기면 원행의 등장 횟수나 원 코드·관측 맥락을 잃을 수 있습니다. 원행 목록과 가중치를 보존하면 일부 요약을 복원할 수 있지만, 아예 주어지지 않은 개체 ID를 복원한 것은 아닙니다. 동등성의 기준과 가능한 역복원 범위를 함께 기록합니다.

Equality of selected signatures partitions source rows into equivalence classes: the relation is reflexive, symmetric and transitive. This mathematical partition need not equal the substantive relation “the same measured entity.”

Keeping one signature can lose multiplicity, source codes or context. Retained source-row lists and weights can reconstruct some summaries, but cannot recover an entity identifier that was never supplied. State the equivalence rule and the scope of possible reconstruction.

기초Foundations

16. 실습 B · 같음의 기준을 먼저 읽는다16. Lab B · inspect the equality rule first

가정 숫자 3행, 실제 와인 12개 수치 조합, 실제 원 코드 407을 선택합니다. 기록 수와 조합 수를 먼저 예상하고 표지·가정 축약의 선택 원행 수를 비교하세요. 원 코드 407의 가정 축약은 서로 다른 두 원행 중 하나를 잃는 시연이지 올바른 정제가 아닙니다.

실습은 고정 실제 실행 기록을 조회합니다. 원행을 삭제하지 않으며 값 일치만으로 실제 반복 입력 오류라고 판정하지 않습니다. 다음 장에서는 비고유 코드로 조인했을 때 생기는 교차 조합을 직접 확인합니다.

Select three toy numerical records, the actual twelve-field wine signatures, or original store code 407. Predict records and signatures, then compare flagging with illustrative collapse. Collapsing code 407 loses one of two distinct source rows; it is not a valid correction.

The lab selects fixed actual runs. It neither deletes source records nor classifies equal values as proven accidental entries. The next chapter examines crossed combinations created by a nonunique-code join.

기초Foundations

17. 멀리 있는 값은 검토 질문의 출발점이다17. A distant value starts a review question

아주 큰 임금이 보이면 단위 오해·입력 오류·실제 큰 값 등 여러 설명이 가능합니다. 단순히 평균과 멀다는 이유만으로 어느 설명인지 정해지지 않습니다. 출처·시점·측정 방식·원문을 확인하고, 무엇을 근거로 검토 표시했는지 남깁니다.

이 장의 “이상값 표지”는 선언한 수치 규칙의 바깥이라는 뜻입니다. 검증된 원자료 오류나 자동 삭제 명령이 아닙니다. 원자료 제공자가 이미 극단값을 정리한 변수인지도 확인합니다. Card의 원 로그 변수는 이미 출처에서 극단값을 정리한 변수입니다.

An unusually high wage can reflect a unit mismatch, an entry error or a genuinely large observation. Distance from a mean alone does not choose an explanation. Inspect provenance, timing, measurement and source text, retaining the evidence for each review flag.

An outlier flag here means outside a declared numerical rule. It is neither a verified source error nor an automatic deletion command. Check prior processing too: the Card source log variable was already trimmed by its provider.

기초Foundations

18. 다섯 수에서 사분위와 울타리를 손으로 구한다18. Find quartiles and fences for five values by hand

가정 유효값을 (0,1,2,3,100)으로 정렬하고 이 장의 type 7 규칙을 씁니다. 25% 위치는 두 번째 값 1이고 75% 위치는 네 번째 값 3입니다. 사분위 범위 IQR은 2입니다. 1.5 IQR을 양쪽으로 더한 검토 울타리는 −2와 6입니다.

Q1=1,Q3=3IQR=Q3−Q1=2L=Q1−1.5IQR=−2U=Q3+1.5IQR=6\begin{gathered}Q_1=1,\quad Q_3=3\\\mathrm{IQR}=Q_3-Q_1=2\\L=Q_1-1.5\mathrm{IQR}=-2\\U=Q_3+1.5\mathrm{IQR}=6\end{gathered}

100은 위 울타리 밖이지만 여전히 원 가정값입니다. 실제 검토에서 오류 근거가 없다면 원값을 보존하고 표지를 추가합니다. 다음 절은 위치가 정수 사이일 때의 규칙을 명시합니다.

Sort toy values (0,1,2,3,100) and use this chapter’s type 7 convention. The quarter positions select one and three, giving IQR two. Extending by 1.5 IQR produces fences −2 and six.

Q1=1,Q3=3IQR=2L=−2,U=6\begin{gathered}Q_1=1,\quad Q_3=3\\\mathrm{IQR}=2\\L=-2,\quad U=6\end{gathered}

One hundred is outside the upper fence but remains a source toy value. Without evidence of an error, retain it and add a review flag. The next section specifies interpolation between ordered positions.

심화Extension

19. 사분위의 구현 관례를 식으로 명시한다19. Specify the quantile convention mathematically

가용값 n≥1개를 x₍₁₎≤…≤x₍ₙ₎로 정렬하고 0≤p≤1이라 합시다. type 7은 1부터 세는 위치 h를 만들고 이웃 두 순서값 사이를 선형 보간합니다. 끝 p=1에서는 마지막 값만 사용합니다.

h=1+(n−1)pj=⌊h⌋,γ=h−jQ7(p)=(1−γ)x(j)+γx(min⁡(j+1,n))\begin{gathered}h=1+(n-1)p\\j=\lfloor h\rfloor,\quad \gamma=h-j\\Q_7(p)=(1-\gamma)x_{(j)}\\\quad+\gamma x_{(\min(j+1,n))}\end{gathered}

n=1이면 모든 p에서 그 유일값이고 n=0이면 정의되지 않습니다. R의 실제 코드는 type=7, fuzz=0을 명시합니다. Python 코드는 원 소수와 p를 정확 분수로 계산합니다. 다른 통계 프로그램의 기본 분위수 관례와 자동으로 같다고 가정하지 않습니다.

Sort n≥1 available values as x₍₁₎≤…≤x₍ₙ₎ and choose 0≤p≤1. Type 7 uses a one-based position and linear interpolation; p=1 selects the last value.

h=1+(n−1)pj=⌊h⌋,γ=h−jQ7(p)=(1−γ)x(j)+γx(min⁡(j+1,n))\begin{gathered}h=1+(n-1)p\\j=\lfloor h\rfloor,\quad \gamma=h-j\\Q_7(p)=(1-\gamma)x_{(j)}\\\quad+\gamma x_{(\min(j+1,n))}\end{gathered}

A singleton gives its sole value for every p; an empty set has no quantile here. Recorded R source explicitly uses type=7, fuzz=0; Python uses exact source fractions. Another tool’s default convention need not agree.

기초Foundations

20. 울타리 위·아래의 엄격 비교를 정한다20. Declare strict comparisons at the fences

표지는 x<L 또는 x>U로 정의합니다. x=L 또는 x=U는 이번 규칙에서 바깥 표지가 아닙니다. 표에 표시한 소수 울타리는 반올림일 수 있으므로 경계에 아주 가까운 값을 그림의 표시 숫자만으로 분류하지 않습니다.

IQR=0도 가능한 상태입니다. 가정 (1,1,1,1,9)의 type 7 사분위는 둘 다 1이므로 두 울타리도 1입니다. 규칙은 9를 표시하지만 이 사실이 반복된 1이나 큰 9의 측정 오류를 검증하지는 않습니다. 충분히 작은 표본이나 이산 코드에는 규칙이 어떤 질문에 유용한지도 따로 판단합니다.

Flag values satisfying x<L or x>U. Equality with either fence is not outside under this rule. Rounded displayed fences can obscure near-boundary comparisons; use the underlying calculation rather than the plot label alone.

IQR can be zero. For toy values (1,1,1,1,9), type 7 gives both quartiles and fences equal to one. The rule flags nine without establishing that either repeated ones or nine are measurement errors. Assess whether the rule suits a small sample or discrete code.

심화Extension

21. 비선형 변환 뒤 울타리가 같다고 가정하지 않는다21. Do not assume nonlinear transformations preserve fences

양수 배수 a와 이동 b로 y=ax+b를 일관되게 적용하면 순서와 type 7 선형 보간도 그대로 변환됩니다. IQR은 a배이고 울타리도 같은 아핀 변환을 따릅니다. 반면 로그처럼 비선형인 변환은 순서를 보존해도 선형 보간과 교환되지 않을 수 있습니다.

가정 양수 (1,2,4,8)의 원 Q₁은 1.75입니다. 먼저 로그를 취하고 type 7 Q₁을 계산한 뒤 지수화하면 2의 3/4승≈1.681793입니다. 따라서 로그 척도에서 만든 울타리를 원 척도의 같은 울타리라고 부르지 않습니다. Card 로그의 표지는 로그 변수에 대해 정의한 규칙입니다.

A consistent affine map y=ax+b with a>0 transforms order and type 7 interpolation accordingly. IQR scales by a and fences transform with the same map. A nonlinear map such as logarithm can preserve ranks while failing to commute with linear interpolation.

For toy positive values (1,2,4,8), the original lower quartile is 1.75. Taking logs first and exponentiating the lower type 7 quartile gives 2^(3/4)≈1.681793. Log-scale fences therefore need not reproduce original-scale fences. The Card flags are defined for its log variable.

기초Foundations

22. 큰 값 하나가 요약을 바꾸는 방식을 비교한다22. Compare how one large value affects summaries

가정 (0,1,2,3,M)에서 M≥3이면 중앙값은 2입니다. 평균은 (6+M)/5이므로 M을 크게 할수록 제한 없이 커집니다. 이 예는 두 요약의 민감도가 다르다는 계산입니다. 어떤 요약이 질문의 표적인지는 별도로 정해야 합니다.

M=100의 원 평균은 21.2이고 그 값을 제외한 네 값의 평균은 1.5입니다. 차이가 크다는 이유만으로 제외가 옳다는 결론은 나오지 않습니다. 큰 실제 값에 관심이 있는 질문에서는 오히려 그 값을 버리면 표적을 놓칠 수 있습니다.

For toy values (0,1,2,3, M) with M≥3, the median stays two while the mean (6+M)/5 grows without bound. This computes different sensitivities; the question must still determine the target.

At M=100 the original mean is 21.2; excluding it gives 1.5. A large difference does not prove exclusion correct. A question about genuinely large observations can lose its target by removing them.

기초Foundations

23. 실제 로그 3010개에서 표지 수와 원행 수를 맞춘다23. Reconcile actual log flags with source-row counts

실제 Card 원행은 3,613개이고 로그 가용값은 3,010개입니다. 명시한 type 7·1.5 IQR 규칙은 아래 22개·위 16개를 표시하고 2,972개는 울타리 안에 둡니다. 원 결측 603개는 이 표지 계산에서 가용 수치로 쓰지 않지만 원행에서는 보존합니다.

22+2972+16=30103010+603=3613\begin{gathered}22+2972+16=3010\\3010+603=3613\end{gathered}

원 Q₁≈5.976985, Q₃≈6.563503이며 울타리는 약 5.097208과 7.443280입니다. 실제 Python 기록에는 정확 분수도 있습니다. 38개가 확인된 입력 오류라는 뜻은 아니고, 다른 분포·다른 창·다른 사분위 정의에서는 표지가 달라질 수 있습니다.

The 3,613 Card source rows include 3,010 available logs. The declared type 7/1.5 IQR rule flags 22 below and sixteen above, leaving 2,972 inside. The 603 original missing logs are excluded from numerical quartiles but retained as source rows.

22+2972+16=30103010+603=3613\begin{gathered}22+2972+16=3010\\3010+603=3613\end{gathered}

Quartiles are approximately 5.976985 and 6.563503, with fences near 5.097208 and 7.443280. Actual Python records retain exact fractions. Thirty-eight flags do not establish thirty-eight input errors; reference populations, windows and conventions can change the flags.

기초Foundations

24. 실습 C · 원값·표지·제외 비교를 나란히 읽는다24. Lab C · compare source values, flags and exclusion summaries

가정 5값과 실제 로그를 선택하고 표지 모드·가정 제외 비교를 바꿉니다. 원행 수·가용값·아래/위 표지·비교 분모를 먼저 예상하세요. 울타리 계산과 원 평균, 가정 제외 뒤 평균을 서로 다른 항목으로 읽습니다.

제외 비교는 원파일을 수정하지 않습니다. 표지를 실제 오류 판정이나 자동 정정이라고 설명하지 않으며, 이미 출처에서 정리한 로그라는 지위와 원 결측 수를 함께 보존합니다.

Select five toy values or actual logs, then compare flag mode and illustrative exclusion. Predict source count, availability, lower/upper flags and the comparison denominator. Distinguish fences, original mean and post-exclusion comparison mean.

The comparison changes no source file. A review flag is not an error verdict or automatic correction. Retain original missing counts and the fact that the source variable was already trimmed.

기초Foundations

25. 검사는 어떤 약속을 검사하는지 적는다25. State which contract a check tests

검사에는 열 존재·행 수·자료형·가용성·범위·코드 집합·키 유일성처럼 다른 대상이 있습니다. 한 가지 검사를 통과했다고 다른 검사까지 한 것은 아닙니다. 실제 이 장의 가정 검증 프로그램은 키 유일성, 횟수의 가용성과 비음수, 상태 코드 {0,1}을 검사합니다.

이 프로그램이 모든 정수성·최대값·현실 가능성까지 검사한다고 말하지 않습니다. 그런 약속이 질문에 필요하면 검사를 추가해야 합니다. 실행 코드와 설명에서 실제 검사한 범위를 정확히 맞추는 것이 중요합니다.

Checks can concern required fields, shape, types, availability, ranges, code sets or unique keys. Passing one does not imply the others were tested. The actual toy validation programs check key uniqueness, available nonnegative counts and status membership in {0,1}.

They do not claim to test every integrality condition, maximum or real-world possibility. Add those checks when required by the question. Match the explanation to the checks actually implemented.

기초Foundations

26. 참·거짓 검사로 유효 0을 지우지 않는다26. Do not discard valid zeros through truth tests

가정 상태 코드는 0=아니오,1=예입니다. 가정 횟수도 0이 허용됩니다. “거짓처럼 취급되는 값”을 모두 버리는 코드는 유효 0과 결측을 섞을 수 있습니다. 결측 검사와 코드 집합 검사를 따로 씁니다.

실제 고객 요금 수준 0~9 같은 사전에서도 같은 구별이 필요합니다. 다만 이번 검증 실행의 두 행은 교육용 가정 자료이며 실제 고객 파일을 새로 측정한 결과가 아닙니다. 같은 기호 0도 각 변수의 사전 의미를 따라 읽습니다.

Toy status code zero means no; one means yes. A toy count can also validly equal zero. Discarding every value treated as false can mix valid zeros with missingness. Use separate missingness and code-domain checks.

The same distinction matters for source dictionaries such as customer charge levels zero through nine. However, these two validation rows are explicitly hypothetical, not new customer observations. Interpret zero through each variable’s own contract.

기초Foundations

27. 고유 키 약속은 값 조합 약속과 다르다27. A unique-key contract differs from value equality

가정 키 a와 b는 두 원 기록을 추적하도록 정했습니다. b를 a로 바꿔 고유성 검사를 실패시키는 것은 이 정한 계약을 점검하는 시연입니다. 실제 원 코드 407이 반복된다는 이유만으로 원자료가 같은 고유성 계약을 어겼다고 단정하지 않습니다. 원 코드가 고유 키로 선언되었는지를 먼저 확인해야 합니다.

코드·원행 키·값 조합의 역할을 사전에 적고 키가 필요한 단계마다 검사합니다. 뒤에서 조인 수를 예측할 때 이 역할이 출력 행 수를 결정합니다. 고유하지 않은 열을 조용히 고유하다고 취급하지 않습니다.

Toy keys a and b are declared to trace separate records. Replacing b with a deliberately fails that declared contract. This does not mean repeated real store code 407 violated an identical source contract: first establish whether the source code was declared unique.

Document roles of codes, provenance keys and signatures, then check the required key at each operation. These roles determine join cardinality later. Do not silently treat a nonunique field as unique.

기초Foundations

28. 통과한 스키마와 진실한 측정을 구별한다28. Separate schema conformity from measurement truth

가정 상태 0과1이 모두 허용 범위에 있다고 해서 실제 응답이 정직했는지 알 수는 없습니다. 기록된 숫자가 그럴듯해도 단위·시점·개체 대응이 틀릴 수 있습니다. 반대로 검사가 실패했을 때 원값이 틀렸는지 검사 규칙이 잘못되었는지도 살펴야 합니다.

유효성은 선언한 계약에 대한 말이고 측정 정확성·대표성·인과는 다른 근거를 필요로 합니다. 검사에서 경고를 냈다는 이유만으로 값을 몰래 바꾸지 않습니다. 규칙·근거·검토 결과와 결정 시점을 남깁니다.

Status values inside the declared code set do not prove truthful real responses. Plausible numbers can still have wrong units, timing or record correspondence. When a check fails, investigate both the source value and the rule itself.

Conformity is relative to a declared contract; accuracy, representativeness and causality need separate evidence. A warning is not permission to silently replace a value. Retain the rule, evidence, review outcome and decision timing.

기초Foundations

29. 오류를 실제로 내는 작은 검증 코드를 읽는다29. Read small checks that actually produce errors

다음은 정상 가정 입력을 실제 실행한 Python 코드입니다. 같은 코드의 고정 오류 시나리오에서는 음수 횟수·미정의 코드·중복 키·미관측 횟수 중 하나를 바꿉니다. 검사를 실패시키면 성공 요약을 출력하지 않고 실제 오류와 비영 종료 상태를 남깁니다.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import json
rows=[{"id":"a","count":0,"status":0},{"id":"b","count":2,"status":1}]

assert len({r["id"] for r in rows})==len(rows),"unique toy key required"
assert all(r["count"] is not None for r in rows),"count must be available"
assert all(r["count"]>=0 for r in rows),"nonnegative count required"
assert all(r["status"] in (0,1) for r in rows),"status code must be zero or one"
print(json.dumps({"declaredToyContractPassed":True,"rows":rows,"observationalTruthCertified":False}))
{"declaredToyContractPassed": true, "rows": [{"id": "a", "count": 0, "status": 0}, {"id": "b", "count": 2, "status": 1}], "observationalTruthCertified": false}

Python assert는 최적화 옵션으로 비활성화될 수 있습니다. 이번 보관 실행은 최적화하지 않은 일반 Python입니다. 항상 강제할 입력 계약이 필요한 실제 배포 코드에서는 명시적 예외 검사도 고려합니다. R 예제는 stop으로 실패를 명시합니다.

This Python program actually ran on a valid toy input. Fixed error scenarios alter one negative count, unknown code, repeated key or unavailable count. A failed check records its actual error and nonzero exit, without printing a successful summary.

import sys
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
import json
rows=[{"id":"a","count":0,"status":0},{"id":"b","count":2,"status":1}]

assert len({r["id"] for r in rows})==len(rows),"unique toy key required"
assert all(r["count"] is not None for r in rows),"count must be available"
assert all(r["count"]>=0 for r in rows),"nonnegative count required"
assert all(r["status"] in (0,1) for r in rows),"status code must be zero or one"
print(json.dumps({"declaredToyContractPassed":True,"rows":rows,"observationalTruthCertified":False}))
{"declaredToyContractPassed": true, "rows": [{"id": "a", "count": 0, "status": 0}, {"id": "b", "count": 2, "status": 1}], "observationalTruthCertified": false}

Python assert can be disabled by optimization options. The archived runs use ordinary nonoptimized Python. For an input contract that must always be enforced in deployment, consider explicit exception checks. The R example explicitly fails with stop.

기초Foundations

30. 실패를 평균 0이나 빈 성공표로 바꾸지 않는다30. Do not replace failures by zero or an empty success table

파일을 못 읽거나 키 검사에 실패한 경우에는 원인을 고친 뒤 다시 실행합니다. 실패 기록을 평균 0으로 채우면 실제 계산된 0과 구분할 수 없습니다. 실패했는데 이전 화면의 성공 결과를 그대로 두는 것도 잘못된 증거를 보여 줄 수 있습니다.

실습은 유효한 선택을 벗어나면 이전 결과를 지우고 교정 가능한 입력을 남깁니다. 보관한 오류 시나리오를 공개하면 실제 오류 출력과 종료 상태를 보여 줍니다. 오류 이름·경로를 다른 언어의 것처럼 꾸미지 않습니다.

Repair a missing input or failed key check before rerunning. Replacing a failed summary by zero confuses failure with a calculated zero. Keeping an old successful display after a new failure can likewise misrepresent evidence.

The lab clears stale output after invalid selections and allows correction. Revealing an archived failure shows its actual error and exit status. It does not invent another language’s error name or path.

기초Foundations

31. 검토표의 수가 원행 수와 맞는지 확인한다31. Reconcile review categories with source counts

한 원행에 정확히 한 상태를 붙였다면 상태별 수의 합은 전체 원행 수여야 합니다. 실제 사람 표의 아래·안·위·미관측 네 상태는 서로 겹치지 않고 전부를 덮도록 만들었습니다. 22+2972+16+603=3613을 확인합니다.

여러 표지가 겹칠 수 있다면 합을 전체라고 부르면 안 됩니다. 한 행이 결측 표지와 중복 코드 표지를 동시에 가질 수 있는 일반 검토표에서는 표지별 수·고유 표시 행 수·교집합을 나눠 셉니다. 수가 맞는다는 사실만으로 표지 원인까지 검증된 것은 아닙니다.

If exactly one state is assigned per source row, state counts must sum to the source count. The person table’s lower, inside, upper and missing states form a disjoint partition: 22+2972+16+603=3613.

Overlapping flags cannot simply be summed as a total. A general record might have both missingness and a repeated-code flag. Count individual flags, distinct flagged rows and intersections separately. A correct count identity still does not verify the flags’ causes.

기초Foundations

32. 실습 D · 정상 입력과 네 가지 실패를 구별한다32. Lab D · distinguish valid input and four failures

고정된 정상 가정 입력과 음수 횟수·미정의 상태 코드·중복 키·미관측 횟수를 선택합니다. 어느 검사가 먼저 실패할지 예상하고 실제 Python/R 오류를 확인하세요. 선택은 원자료를 편집하거나 임의 코드를 실행하지 않습니다.

검증 예의 적용 범위는 선언한 네 종류의 조건입니다. 실제 자료의 전 범위나 모든 가능한 오류를 검증한 것은 아닙니다. 입력 약속과 검사의 필요성을 설명한 뒤 다음 묶음에서 단계 순서·원본 보존·감사 기록을 연결합니다.

Select the fixed valid toy or a negative count, unknown status code, repeated key or unavailable count. Predict the first failing check and inspect the actual Python/R error. This selection edits no source data and executes no arbitrary code.

The examples concern their declared condition types. They do not certify all real datasets or every possible error. Explain the contract before proceeding to operation order, source preservation and audit records.

기초Foundations

33. 같은 남은 값도 단계 순서에 따라 표지가 다르다33. The same retained values can have different flags

가정 원값은 (0,1,2,3,100)이고 x>1인 기록만 비교에 남긴다고 정합니다. 먼저 전체 다섯 값에서 울타리를 만들면 [−2,6]이고 남은 (2,3,100)에서 100이 표시됩니다. 먼저 세 값을 고르고 울타리를 다시 만들면 type 7 Q₁=2.5, Q₃=51.5입니다.

IQRselected=49Lselected=−71Uselected=125\begin{gathered}\mathrm{IQR}_{\rm selected}=49\\L_{\rm selected}=-71\\U_{\rm selected}=125\end{gathered}

이제 100은 그 새 울타리 안입니다. 남은 원행과 값은 같아도 표지의 기준 집합이 다릅니다. 어느 순서가 질문에 맞는지 정하고 순서와 기준 집합을 함께 기록합니다.

Start with toy values (0,1,2,3,100) and retain x>1 for comparison. Fences from all five values are [−2,6], flagging one hundred among retained values (2,3,100). Filtering first and recomputing gives type 7 quartiles 2.5 and 51.5.

IQRselected=49Lselected=−71Uselected=125\begin{gathered}\mathrm{IQR}_{\rm selected}=49\\L_{\rm selected}=-71\\U_{\rm selected}=125\end{gathered}

One hundred is inside the new fences. Identical retained source rows can therefore carry different flags because the reference set changed. Choose and report the order appropriate to the question.

기초Foundations

34. 원본과 메모리의 비교 사본을 구별한다34. Separate the source from an in-memory comparison

원값을 보존한 채 새 표지 열이나 선택 원행 목록을 만듭니다. 원 파일·원 소수 문자열·원행 키는 그대로 두고, 가정 0채움·가정 제외·조합별 첫 행 선택은 이름을 붙인 비교 대상으로 둡니다. 비교 결과가 원 관측으로 되돌아간 것처럼 설명하지 않습니다.

이번 실제 프로그램은 원 CSV를 읽고 메모리에서 요약·표지·선택 목록을 계산한 뒤 JSON 결과를 출력합니다. 정제 CSV를 원본에 덮어쓰는 프로그램이 아닙니다. 이후 별도 작업 파일을 내보내면 입력·출력 경로와 형식·키 보존 검사도 함께 기록해야 합니다.

Add review columns or selected-key lists while retaining source values. Preserve original files, decimal strings and provenance keys. Name zero-fill, exclusion and first-signature-row comparisons explicitly rather than presenting them as recovered observations.

The actual programs read CSVs, compute summaries or selections in memory and print JSON. They do not overwrite source files with cleaned CSVs. A later export needs its own input/output paths, serialization and key-preservation checks.

기초Foundations

35. 표지·보류·정정의 근거를 나누어 기록한다35. Record evidence for flags, pending review and corrections

검토표에 원행 키, 원값, 적용 규칙, 표지 이유, 확인한 출처, 결정과 새 값의 근거를 적을 수 있습니다. 아직 모르면 보류 상태를 남깁니다. 한 숫자가 크다는 이유와 원문에 소수점이 잘못 입력됐다는 확인은 다른 근거입니다.

검증된 단위 환산처럼 근거가 있는 변환도 원값과 환산 계수를 남깁니다. 미확인 화학 단위나 미관측 값은 익숙한 값으로 채우지 않습니다. 실제 사례의 38개 표지와 240개 추가 반복은 오류 확정 목록이 아닙니다.

A review log can retain source key, original value, rule, reason, checked source, decision and evidence for any proposed replacement. Keep a pending state when unresolved. A large number and a verified misplaced decimal are different evidence.

Even a justified unit conversion retains original values and its multiplier. Do not replace unknown units or unavailable values with familiar guesses. The 38 flags and 240 additional repetitions are not lists of established errors.

기초Foundations

36. 단계마다 보존한 것과 바꾼 것을 검사한다36. Check what each step preserves and changes

표지 추가 단계라면 원행 수·키·원값이 같아야 하고 새 표지만 늘어납니다. 가정 제외 비교라면 선택 원행 수는 줄 수 있으므로 원행 수가 같아야 한다고 검사하면 틀립니다. 대신 선택 목록이 원 키의 부분집합인지, 제외 이유와 분모가 맞는지 확인합니다.

조합별 집계라면 등장 횟수 합이 원행 수인지, 같은 값이 서로 다른 집계로 빠지지 않았는지 검사합니다. 무엇을 불변량으로 삼을지는 연산의 목적에 달려 있습니다. 그럴듯한 평균 하나보다 키·분모·전체값 대응을 함께 점검합니다.

A flag-only step should preserve source count, keys and values while adding flags. An exclusion comparison can legitimately reduce selected count, so requiring unchanged count would be the wrong check. Instead verify the selected-key subset, reasons and denominator.

For signature aggregation, verify that multiplicities sum to source count and equal signatures are consistently assigned. An invariant depends on the intended operation. Check keys, counts and value correspondence rather than relying on one plausible mean.

심화Extension

37. 심화: 제외가 평균을 바꾸는 항등식을 쓴다37. Advanced: write the mean identity behind exclusion

유효 원값 n=m+r개를 남긴 m≥1개와 제외한 r≥1개로 나눕니다. 각 집합의 평균을 μₖ,μᵣ라 하면 원 평균은 두 평균의 개수 가중 평균입니다. 차이는 어느 값들을 제외했는지에 의해 정해집니다.

xˉ=mμk+rμrm+rμk−xˉ=rm+r(μk−μr)\begin{gathered}\bar x=\frac{m\mu_k+r\mu_r}{m+r}\\\mu_k-\bar x=\frac{r}{m+r}(\mu_k-\mu_r)\end{gathered}

큰 값만 제외해 μᵣ가 더 크면 남긴 평균이 내려가는 것은 산술입니다. 이것이 오차를 줄였다는 통계적 보장이나 전체 모집단의 진실을 복구했다는 뜻은 아닙니다. r=0이면 제외 평균을 억지 정의하지 않고 원 평균 그대로인 별도 경계로 둡니다.

Partition n=m+r valid source values into m≥1 retained and r≥1 omitted values, with means μₖ and μᵣ. The source mean is their count-weighted average.

xˉ=mμk+rμrm+rμk−xˉ=rm+r(μk−μr)\begin{gathered}\bar x=\frac{m\mu_k+r\mu_r}{m+r}\\\mu_k-\bar x=\frac{r}{m+r}(\mu_k-\mu_r)\end{gathered}

Removing a group with a larger mean lowers the retained mean by arithmetic. It does not establish reduced estimation error or recovered population truth. If nothing is omitted, retain the original mean without inventing an omitted-group mean.

심화Extension

38. 두 번 해도 같다는 검사가 충분하지는 않다38. Repeating a transformation unchanged is not enough

작업을 두 번 적용해도 결과가 같으면 멱등적이라고 부를 수 있습니다. 예를 들어 모두 0으로 바꾸는 함수도 두 번 해도 0이므로 멱등적입니다. 따라서 이 성질만으로 정제가 올바르다고 증명할 수 없습니다.

T(x)=0T(T(x))=T(x)\begin{gathered}T(x)=0\\T(T(x))=T(x)\end{gathered}

다시 실행 가능성은 중요하지만, 실제로 어떤 값과 정보가 보존되는지 별도로 검사합니다. 고정 입력·규칙·버전·환경에서 같은 출력을 얻은 것과 측정 의미가 정확하다는 주장을 나눕니다. 계산 재현이 출처의 진실성을 대신하지 않습니다.

A transformation is idempotent if repeating it changes nothing. A function replacing every input by zero has that property too. Idempotence alone cannot certify a valid correction.

T(x)=0T(T(x))=T(x)\begin{gathered}T(x)=0\\T(T(x))=T(x)\end{gathered}

Reproducibility matters, but separately check retained information and values. Matching outputs under fixed inputs, rules, versions and settings differs from establishing measurement meaning. Computational reproducibility does not replace source evidence.

기초Foundations

39. 자료를 보고 바꾼 규칙은 그 사실도 남긴다39. Disclose rules changed after inspecting the data

평균이나 예측 오차가 마음에 들 때까지 울타리를 바꾸면 많은 선택 중 결과가 좋은 규칙을 골랐을 수 있습니다. 그 탐색을 숨기고 처음부터 고정한 규칙처럼 보고하지 않습니다. 질문·규칙·변경 이유와 시점을 남기고 탐색 결과의 적용 범위를 설명합니다.

예측 평가에서는 뒤에서 쓸 검증·시험 자료의 정보를 얼마나 보았는지도 중요합니다. 모든 분할을 본 뒤 변환 기준을 맞춘 절차와 훈련 자료만 쓴 절차는 정보 조건이 다릅니다. 더 낮은 같은 자료의 손실만으로 미지 자료의 성능까지 증명하지 않습니다. 이 문제는 DATA11 이후에 실제 분할로 이어집니다.

Changing fences until a mean or prediction error looks attractive can select a favorable result among many attempted rules. Disclose that search instead of presenting the rule as fixed in advance. Record the question, rule, reason and timing of revisions.

Prediction evaluation also depends on access to validation or test information. Fitting preprocessing after inspecting all splits differs from using training data alone. Lower loss on the inspected data does not prove future performance. DATA11 onward develops actual split examples.

기초Foundations

40. 실습 E · 선택 순서와 기준 집합을 추적한다40. Lab E · trace operation order and reference sets

가정 (0,1,2,3,100)에서 x>1인 원행을 고르는 두 순서를 비교합니다. 먼저 전체 기준으로 표지한 뒤 고르거나, 먼저 고르고 그 집합에서 다시 표지합니다. 원행 번호·남은 값·울타리 기준 수·표지를 나란히 확인하세요.

원행 3,4,5의 값은 두 경우 모두 (2,3,100)입니다. 표지 차이는 다른 측정이 생겨서가 아니라 규칙의 기준 집합이 달라서입니다. 실습은 이 두 고정 프로그램의 실제 기록을 조회하며 임의 파이프라인을 실행하지 않습니다.

Compare two orders for retaining x>1 from toy values (0,1,2,3,100): flag against the full reference first, or filter first and recompute flags. Inspect source IDs, retained values, reference count and flags together.

Both retain source rows three, four and five with values (2,3,100). The flags differ because their reference sets differ, not because new measurements appeared. The browser queries two actual fixed programs rather than executing arbitrary pipelines.

기초Foundations

41. 실제 720개 국가년에서 원 결측 네 칸을 보존한다41. Preserve four source nulls among 720 actual country-years

World Bank 선택 16국×45년(1980~2024)에는 원 국가년 행이 720개 있습니다. 1인당 실질 GDP의 값은 716개에 가용하고 VNM 1980~1983의 네 칸은 원 미관측입니다. 값이 있다는 것도 통계 공표열의 가용성을 뜻하며 모든 칸을 한 번에 직접 측정한 개인 관측으로 바꾸지 않습니다.

연도별로 계획 국가 수 16, 실제 가용 수, 원 결측 수를 나눕니다. 1980년에는 가용 15개와 미관측 1개입니다. 가용 평균과 0채움 비교의 분모는 각각 15와16입니다. 원 결측에 GDP 0을 관측했다고 표시하지 않습니다. 선택한 국가 집합의 평균을 세계 전체나 개인소득 분포로 일반화하지 않습니다.

Sixteen selected World Bank countries over 1980–2024 give 720 source country-years. Real GDP per capita is available in 716; four Vietnamese cells in 1980–1983 are unavailable. Availability concerns the published statistical series, not new direct measurements of individuals.

For each year distinguish sixteen planned countries, available values and source nulls. In 1980 the available and zero-filled comparison denominators are fifteen and sixteen. Do not label the unavailable GDP as an observed zero or generalize the selected-country mean to the world or personal income distributions.

기초Foundations

42. 실제 원 로그와 선택 표지를 함께 보존한다42. Preserve actual source logs alongside chosen review flags

Card 원자료의 로그는 1976년 시간당 임금(센트)의 출처 극단값 정리 변수입니다. 원 소수 문자열과 원행 번호, 교육 연수·원 인원코드를 보존합니다. 로그 가용 3,010개와 원 결측 603개를 나누고, 38개 검토 표지는 별도 열입니다.

원 코드와 위치가 실제 사람의 영구 신원을 보증하지는 않습니다. 가용 로그 평균은 임금의 산술평균과도 다릅니다. 가정 표지 제외 비교를 보더라도 원행 전체와 원 평균을 다시 확인할 수 있도록 남깁니다. 제공자의 원 정리와 이번 추가 검토 규칙도 다른 단계입니다.

The Card log is the source-trimmed 1976 hourly wage variable in cents. Retain source decimal strings, row positions, schooling and original person codes. Separate 3,010 available logs from 603 missing logs; thirty-eight chosen review flags occupy an additional field.

Codes and positions do not guarantee persistent personal identities. A mean log also differs from arithmetic mean wage. Preserve all source rows and the original mean beside exclusion comparisons. The provider’s trimming and this additional review rule are different processing stages.

기초Foundations

43. 와인 값 조합과 점포 코드는 서로 다른 사례이다43. Wine signatures and store codes concern different source units

레드 와인 1,599행의 12개 수치 조합은 1,359개입니다. 원파일의 기업·브랜드·개별 병 식별 정보가 부족하므로 240개 추가 반복을 확인된 중복 입력이라고 부르지 않습니다. 원행을 모두 남기고 조합의 첫 원행·모든 해당 원행·등장 횟수를 추적합니다.

같은 묶음의 원 코드 407 예는 와인과 다른 NJ/PA 점포 자료입니다. 원행 42와168을 둘 다 보존하는 이유를 값 조합 반복과 연결해 생각하되 두 자료의 관측 단위를 섞지 않습니다. 품질 평균 변화와 점포 FTE 변화는 단위·대상·의미가 다릅니다.

The 1,599 red-wine rows contain 1,359 twelve-value signatures. Limited firm, brand and bottle identifiers prevent classifying 240 additional repetitions as proven accidental entries. Retain all rows and track each signature’s first source row, full source-row list and multiplicity.

The code 407 example comes from a different NJ/PA establishment dataset. Connect its two preserved rows to the distinction between value repetition and record identity, while keeping observational units separate. A quality-score mean and an FTE change have different units and meanings.

기초Foundations

44. 읽기부터 비교 결과까지 근거 사슬을 남긴다44. Retain the evidence chain from import to comparison

한 결과에는 입력 출처·해시, 읽기 계약, 원행과 가용 수, 적용 규칙·순서, 코드·버전·관련 환경, 출력·경고·오류와 검사 범위를 연결합니다. 정제 결정을 내렸다면 원값·제안값·근거·시점·선택 원행을 함께 남깁니다.

이번 새 실행 기록은 Python 3.12.14와 R 4.5.1의 46개 고정 프로세스입니다. R은 --vanilla로 시작하고 코드에 JSON 숫자 표시와 Windows 문자 설정을 명시했습니다. 실제 기록의 재실행 일치, 원자료 셀 비교, 브라우저 표시 검토는 서로 다른 근거입니다.

Link input provenance and hash, import contract, source and available counts, rule/order, source code/version/settings, output/errors and check scope. A cleaning decision additionally retains original and proposed values, evidence, timing and selected source keys.

The new catalog contains 46 fixed actual processes in Python 3.12.14 and R 4.5.1. R starts with --vanilla; source explicitly states JSON number formatting and Windows character settings. Matching reruns, source-cell comparisons and browser presentation checks are distinct evidence.

심화Extension

45. 심화: 같은 가용값으로 다른 전체 평균이 가능하다45. Advanced: the same available values allow different full means

가정 원행 네 개 중 가용값은 (0,2,4)이고 한 값 M만 미관측입니다. M=0과 M=100은 같은 가용값을 보여 주지만 전체 평균은 각각 1.5와26.5입니다. 따라서 가용값만으로 미관측을 포함한 평균을 정하지 못합니다.

xˉfull(M)=6+M4M=0⇒xˉfull=1.5M=100⇒xˉfull=26.5\begin{gathered}\bar x_{\rm full}(M)=\frac{6+M}{4}\\M=0\Rightarrow\bar x_{\rm full}=1.5\\M=100\Rightarrow\bar x_{\rm full}=26.5\end{gathered}

만약 M∈[L,U]라는 외부 가정을 추가하면 평균도 [(6+L)/4,(6+U)/4]에 있습니다. 이 경계는 가정에 따른 민감도 범위이지 자료가 입증한 지지집합이나 신뢰구간이 아닙니다. 실제 미관측 값을 새로 채운 것도 아닙니다.

Suppose four source rows have available values (0,2,4) and one unavailable value M. Both M=0 and M=100 fit the same available data, but full means are 1.5 and 26.5. Availability alone does not identify the full mean.

xˉfull(M)=6+M4xˉfull(0)=1.5xˉfull(100)=26.5\begin{gathered}\bar x_{\rm full}(M)=\frac{6+M}{4}\\\bar x_{\rm full}(0)=1.5\\\bar x_{\rm full}(100)=26.5\end{gathered}

An additional assumption M∈[L, U] implies a corresponding mean interval. That is an assumption-dependent sensitivity range, not established support or a confidence interval. It does not fill an actual missing source cell.

기초Foundations

46. 실습 F · 원행·가용분모·표지 목록을 함께 읽는다46. Lab F · inspect source rows, denominators and flag lists

국가의 연도별 분모, 사람의 원행과 로그 표지, 와인의 값 조합과 해당 원행을 선택합니다. 내부에 company라는 모델 이름이 있어도 실제 와인 생산 기업을 식별한 것은 아닙니다. 원 코드 407 예는 별도 점포 자료라는 점도 확인하세요.

선택은 고정 공개 기록 조회입니다. 원 결측을 채우거나 표지 행을 삭제하지 않습니다. 서로 다른 단위와 선택 표적을 나누고, 가정 비교와 원 사실의 경계를 동료에게 설명해 보세요.

Select annual country denominators, person rows and log flags, or wine signatures and their corresponding source records. An internal company model name does not identify wine firms. The separate code 407 records concern establishments.

This queries fixed public records without imputing missing cells or deleting flagged rows. Explain the different units, targets and boundaries between source facts and assumed comparisons.

기초Foundations

47. 실제 자료 사례와 원문을 함께 확인한다47. Inspect actual cases and primary source records

국가 사례 · 빈 칸 네 개를 0으로 바꾸면 어떤 질문이 되는가?

선택 16개국의 World Bank 실제 1980~2024년 GDPpc 표는 국가×연도 720행입니다. 원 API와 대조하면 베트남(VNM)의 1980~1983년 네 값이 null이고 나머지 716개는 가용입니다. null은 GDP가 0이라는 관측이 아닙니다. 국가·연도 행 자체를 보존하고 값의 가용 여부를 별도 열로 기록합니다. 원 단위는 2015년 불변 USD/인이고 선택 16국은 세계를 무작위로 뽑은 표본이 아닙니다.

실제 가용 분모와 고의 0 채움 시연 · 평균 소수 반올림
연도예정 행가용 값결측가용 국가 평균고의 0 채움 평균
19801615114,645.75313,730.394
19811615114,883.61813,953.392
19821615114,886.53913,956.130
19831615115,086.86814,143.939
19841616014,738.45314,738.453
20241616031,100.23931,100.239

1980~1983년 가용 평균의 분모는 15입니다. 결측을 0으로 바꾼 평균은 같은 합을 16으로 나누므로 가용 평균의 정확히 15/16이 됩니다. 이는 원자료가 알려 준 16국 평균이 아니라 존재하지 않던 0을 넣은 다른 계산입니다. 그렇다고 15국 평균이 결측 국가를 포함한 16국의 참평균이라고 증명된 것도 아닙니다. 대체·보간을 하려면 정보와 가정을 추가하고 관측값과 대체값을 구별해야 합니다.

먼저 생각한 뒤 풀이 보기: 가용 값만 계산하면 결측 문제가 완전히 해결됐나요?

아닙니다. 지금 가용 15국을 기술하는 분모는 정확해졌지만 결측 국가까지 대표하는지는 별도 문제입니다. 값이 없는 이유·시점·대상 범위를 확인하고 결과의 질문을 정확히 적어야 합니다. 결측 행을 지워 놓고 원래부터 15국이었다고 쓰지 않습니다.

사람 사례 · 극단값 표시는 오류 판정이나 삭제 명령이 아니다

Card 원 3,613행 중 1976년 시간당 임금(센트)의 원자료 극단값 정리 로그는 3,010개 가용·603개 결측입니다. 연구자가 이미 정리해 제공한 변수를 사용한다는 점을 먼저 기록합니다. 여기에 수업용 검토 규칙을 하나 더 적용하되 38개의 표시를 새로 발견한 입력 오류라고 부르지 않습니다. 원행과 원 소수를 모두 남기며 본문 비교는 추가 삭제를 권하지 않습니다.

가용 로그를 정렬하고 R quantile의 type=7과 같은 선형 보간 규칙을 명시했습니다. 0부터 세는 정렬 위치 t=(n−1)p에서 아래·위 값을 가중 평균합니다. 이 규칙으로 Q1=5.9769846225, Q3=6.56350267이며 1.5×IQR 바깥을 검토 대상으로 표시합니다. 다른 사분위수 규칙이나 다른 척도에서 같은 표시가 나온다고 가정하지 않습니다. R의 기본 boxplot이 사용하는 경계와 이 명시한 quantile 규칙도 무조건 같다고 하지 않습니다.

IQR=Q3−Q1L=Q1−1.5IQRU=Q3+1.5IQR\begin{aligned}\mathrm{IQR}&=Q_3-Q_1\\L&=Q_1-1.5\mathrm{IQR}\\U&=Q_3+1.5\mathrm{IQR}\end{aligned}
명시한 검토 규칙 · 경계는 정확한 소수, 평균은 반올림
항목값
아래 경계 L5.09720755125
위 경계 U7.44327974125
아래 표시22
위 표시16
경계 안2972
원 가용 로그 평균6.261831918
표시 38개를 제외한 비교 평균6.264726213
먼저 생각한 뒤 풀이 보기: 경계 밖에 있는 사람의 임금은 틀렸다고 고쳐도 되나요?

아닙니다. 드문 실제 임금·대상 집단의 이질성·측정 문제 등 여러 이유가 가능하며 표시만으로 구별하지 못합니다. 원 증빙과 변수 정의를 확인하고, 확인된 오류의 수정과 분석 대상 제한을 다른 결정으로 기록하세요. 원자료를 덮어쓰지 말고 새 값·사유·근거·적용 범위를 별도 기록합니다.

먼저 생각한 뒤 풀이 보기: 38개를 제외했더니 평균이 조금 바뀌었으니 더 정확해졌나요?

수치가 바뀌었다는 사실만으로 정확성이 개선됐다고 하지 않습니다. 원 가용 3,010개를 기술하는 질문이 경계 안 2,972개를 기술하는 질문으로 바뀌었습니다. 로그 척도에서의 표시를 원 임금 척도 규칙과 같다고 보거나 exp(평균 로그)를 산술 평균 임금으로 읽지도 않습니다.

제품·점포 사례 · 같은 값과 같은 식별자를 각각 점검하기

포르투갈 Vinho Verde 레드 와인 실제 1,599행의 12개 숫자 값을 정확한 유리수로 비교하면 서로 다른 값 조합은 1,359개입니다. 반복 조합은 220개이고 첫 등장 외에 240행이 더 있습니다. 원행 1과 5는 12개 값이 모두 같습니다. 그러나 원 자료에는 개별 제품의 고유 식별자·측정 시각이 없어 같은 개체를 잘못 두 번 입력한 것인지 서로 다른 제품이 같은 측정값을 가진 것인지 확정할 수 없습니다. 기업·브랜드도 식별되지 않습니다.

실제 12열 숫자 조합의 반복 구조
동일 조합 등장 횟수값 조합 수해당 원 기록 수
111391139
2204408
31236
4416

같은 조합을 한 번씩만 남기는 비교 계산을 하면 행 수는 1,359개가 되고 평균 품질 점수도 달라집니다. 원 1,599개 평균은 정확히 3004/533, 조합별 한 개 평균은 7642/1359입니다. 두 계산은 기록 빈도로 가중하는 방식이 달라서 다르며, 두 번째가 검증된 정답이라고 하지 않습니다. quality는 순서형 관능 점수이므로 이 숫자 평균 자체도 동일 간격으로 취급한 요약 선택입니다.

반대 방향의 함정도 실제 점포 자료에 있습니다. NJ/PA 원 코드407은 서로 다른 두 원행42·168에 있고 주·체인·전후 FTE가 다릅니다. 같은 코드를 보았다고 행 하나를 지우면 공개 원자료의 서로 다른 기록을 잃습니다. source_row_id는 보관한 원 파일 위치를 추적하는 키이며 독립성이나 영구적인 현실 개체 식별을 보증하지 않습니다. 정렬·조인 후에도 이 키를 보존하며 조인의 세부는 다음 장에서 다룹니다.

같은 코드407인 실제 두 기록 · 삭제하지 않음
원행 키원 코드주체인 코드전 FTE후 FTE
42407PA211.011.0
168407NJ412.014.5
먼저 생각한 뒤 풀이 보기: 와인 240행을 제거하고 코드407 하나도 지우면 깨끗한 자료가 되나요?

아닙니다. 무엇을 중복으로 정의했는지와 그 정의를 뒷받침하는 측정 식별 근거가 필요합니다. 값이 같다는 사실과 동일한 현실 개체·동일 시점이라는 사실은 다릅니다. 표시·원행 추적·근거 기록을 먼저 하고 확인할 수 없는 부분은 불확실성으로 남깁니다.

Country case · What question does filling four blanks with zero answer?

The selected sixteen-country World Bank GDPpc table contains 720 country-year records for 1980–2024. The original API has four null values: Vietnam, 1980–1983. The other 716 are available. A null is not an observed zero GDP. Preserve the country-year record and flag availability separately. Units are constant-2015 USD/person; these sixteen selected countries are not a random sample of the world.

Actual available denominators and deliberate zero-fill demonstration · rounded means
YearPlanned recordsAvailableMissingAvailable-country meanInvalid zero-filled mean
19801615114,645.75313,730.394
19811615114,883.61813,953.392
19821615114,886.53913,956.130
19831615115,086.86814,143.939
19841616014,738.45314,738.453
20241616031,100.23931,100.239

For 1980–1983, the available mean uses fifteen values. Zero filling divides the same sum by sixteen, making it exactly 15/16 of the available mean. It is a different calculation using an invented zero, not a known sixteen-country average. Nor does the available fifteen-country mean establish the true mean including the missing country. Imputation or interpolation requires additional information/assumptions and explicit separation from observations.

Think first, then reveal: Does computing only available values completely solve missingness?

No. It correctly describes the available fifteen countries, but does not establish representation of the missing country. Examine why values are unavailable and state the target. Do not delete a missing row and later describe the original frame as fifteen countries.

Person case · An outlier flag is neither an error verdict nor a deletion order

Of 3,613 Card records, 3,010 contain the source-trimmed log of 1976 hourly wages in cents/hour; 603 are unavailable. First record that the author already supplied a trimmed variable. Apply an additional teaching review rule without calling its thirty-eight flags newly discovered input errors. Preserve all original rows and decimals; the comparison below does not recommend further deletion.

Sort available logs and explicitly use linear interpolation matching R quantile(type=7). At zero-based position t=(n−1)p, interpolate between adjacent sorted values. This gives Q1=5.9769846225 and Q3=6.56350267; flag values outside 1.5 IQR. Other quartile rules or measurement scales need not give identical flags. Do not assume default R boxplot hinges always equal this explicitly selected quantile rule.

IQR=Q3−Q1L=Q1−1.5IQRU=Q3+1.5IQR\begin{aligned}\mathrm{IQR}&=Q_3-Q_1\\L&=Q_1-1.5\mathrm{IQR}\\U&=Q_3+1.5\mathrm{IQR}\end{aligned}
Explicit review rule · exact decimal fences, rounded means
ItemValue
Lower fence L5.09720755125
Upper fence U7.44327974125
Below flag22
Above flag16
Inside fences2972
Original available-log mean6.261831918
Illustrative mean excluding 38 flags6.264726213
Think first, then reveal: May we correct someone’s wage as wrong because it falls outside a fence?

No. Unusual real wages, heterogeneous groups or measurement problems can all produce flags. Check documentation and distinguish verified corrections from restrictions on an analysis population. Preserve original values and record any new value, reason, evidence and scope separately.

Think first, then reveal: If excluding 38 flags changes the mean slightly, is it more accurate?

A change does not establish improvement. The descriptive target changed from all 3,010 available records to 2,972 inside a chosen fence. A fence on logs need not equal a fence on wage levels, and exp(mean log wage) is not the arithmetic mean wage.

Product/establishment case · Check repeated values and repeated codes separately

Compare all twelve numeric values of 1,599 actual Portuguese Vinho Verde red-wine records as exact rationals. There are 1,359 distinct numeric signatures, including 220 repeated signatures and 240 records beyond each signature’s first occurrence. Source rows 1 and 5 match on all twelve values. Without unique product IDs or measurement times, the data do not establish whether these are accidental repeated entries or different products with equal measurements. Firms/brands are also unidentified.

Actual repetition of twelve-field numeric signatures
Occurrences per signatureSignaturesSource records
111391139
2204408
31236
4416

An illustrative one-record-per-signature calculation retains 1,359 rows and changes the numeric mean quality score. The full-record mean is exactly 3004/533; the signature-uniform mean is 7642/1359. Different occurrence weights produce different summaries, without establishing the second as a verified correction. Quality is an ordered sensory score, so its numeric mean itself treats score gaps as equal by choice.

Actual establishment data provide the opposite trap: original code 407 appears at source rows 42 and 168 with different states, chains and before/after FTE. Deleting one solely for its repeated code discards a distinct source record. source_row_id traces an archived file position; it guarantees neither statistical independence nor permanent real-world identity. Preserve it through sorting/joins; the next chapter studies joins in detail.

Two actual records sharing code 407 · both retained
Source row keyOriginal codeStateChain codeBefore FTEAfter FTE
42407PA211.011.0
168407NJ412.014.5
Think first, then reveal: Would removing 240 wine rows and one code 407 row make the data clean?

No. Define duplication and establish measurement-identity evidence. Equal values do not establish the same entity and time; equal codes do not necessarily identify one record. Preserve flags, source traces and decision evidence, leaving unresolved identity uncertain.

기초Foundations

48. 공식 문서의 정의와 이번 코드의 범위를 연결한다48. Connect primary definitions to this code’s scope

R quantile 문서에서 type 7과 결측·fuzz 옵션을 읽고 원고의 수학 정의와 보관 R 4.5.1 실행을 구별합니다. NIST Box Plot에서는 fences 부분의 IQR·1.5배 울타리 정의만 연결합니다. 인접 그림의 “significant effect”를 이 자료의 인과·유의성 판정으로 가져오지 않습니다.

Python assert 문서의 최적화 조건과 명시적 예외를 확인합니다. MIT Missing Semester의 필터·정규식·정렬·문자열 빈도 예는 도구 연결을 보여 줍니다. 텍스트 일치를 실제 관측 개체의 동일성으로 바꾸어 읽거나 원본을 무조건 덮어쓰지 않습니다.

한 사례를 골라 원행 수, 가용 분모, 표지 기준, 비교 대상과 아직 모르는 것을 말로 설명하세요. 다음 장은 표 사이의 키와 NULL을 실제 SQL로 연결하면서 정제한 이름이 올바른 관계까지 보장하는지 다시 묻습니다.

Python · R · 원자료·단위·가공·출처

Read type 7, missingness and fuzz in the R quantile documentation, distinguishing the mathematical definition from archived R 4.5.1. Use only the IQR/fence definition in NIST Box Plot; do not import an adjacent figure’s significance or causal wording into these cases.

Check optimization behavior in the Python assert reference. The MIT Missing Semester lesson connects filters, patterns, sorting and text frequencies. Text equality does not establish identical observational units, and working transformations need not overwrite originals.

Explain one case’s source count, available denominator, flag rule, comparison target and unknowns. The next chapter uses actual SQL keys and NULLs to ask whether imported names establish the intended relationships.

Python · R · Inputs, units, transformations and sources

Python·R 코드 실행 방법Run the Python/R companions

자료 묶음을 풀고 코드와 실제데이터 폴더를 함께 두세요. 터미널에서 코드 파일이 있는 폴더로 이동해 아래 명령을 실행합니다. 코딩이 처음이라면 손계산과 웹 실습을 먼저 하고, 데이터 사이언스 입문에서 코드를 배운 뒤 돌아와도 됩니다.Extract the bundle, keeping the scripts beside the data folder. In a terminal, enter the script folder and run the commands below. Beginners can complete hand calculations and browser labs first, returning to code after studying introductory data science.

python data05-reproduce.py
Rscript --vanilla --encoding=UTF-8 data05-reproduce.R

결과 파일은 각 코드에 지정된 결과 폴더에 저장됩니다. CSV 원자료는 덮어쓰지 않습니다.Result files are saved in the result directory specified by each script; the input CSVs are not overwritten.

영상·학자·함께 읽기Videos, thinkers and guided reading

본문의 질문을 넓히는 선택 학습입니다. 영상을 보기 전 질문을 먼저 읽고, 자신의 답을 쓴 뒤 해설과 비교하세요. 자료의 언어·선수 지식은 각 항목에 표시했습니다.Optional extensions to the chapter. Read the question first, write your answer, then compare with the explanation. Language and prerequisites are indicated below.

MIT Missing Semester · 변환 단계와 반복 빈도MIT Missing Semester · Transformation steps and repetition counts

MIT Missing Semester2020 · official lesson source

정규식의 반례와 sort·uniq -c로 반복 빈도를 세는 부분을 중심으로 봅니다. 로그 줄의 반복을 세는 예와 CSV 관측 개체의 동일성을 구별하고, CSV에는 정식 파서를 사용하세요. 설치 제거·인플레이스 덮어쓰기 예는 이 실습 범위가 아닙니다.Focus on regex counterexamples and sort/uniq -c counts. Repeated log text is not measurement identity; use a real parser for CSV. Uninstalling software or overwriting inputs is outside this exercise.

교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.

보고 읽은 뒤 답하기Respond after watching/reading 같은 줄의 빈도를 세면 무엇이 자동으로 증명되나요?What does counting equal lines automatically establish?

생각을 점검하는 해설Check your reasoning

지정한 텍스트 규칙에서의 반복 횟수만 확인합니다. 같은 현실 개체의 입력 오류라는 결론은 추가 식별 근거가 필요합니다.Only repetition under the specified text rule. An accidental duplicate measurement requires additional identity evidence.

존 튜키 · 도구를 쓰면서도 관측을 다시 묻기John Tukey · Use tools while questioning the observations

Princeton University · official memorial news

현대 통계 도구에 기여한 연구자의 대학 소개를 읽고, 요약·그림으로 표시한 특이점과 오류를 판정할 근거가 어떻게 다른지 생각해 보세요.Read the university’s account of a contributor to modern statistical tools, then distinguish unusual features in summaries/plots from evidence of errors.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 통계 도구가 표시한 점은 지우는 것이 원칙인가요?Should a statistically flagged point generally be deleted?

생각을 점검하는 해설Check your reasoning

아닙니다. 관측 단위·측정 절차·대상 범위와 원 증빙을 확인한 후 판단하고, 표시 규칙과 처리 사유를 기록합니다.No. Check units, measurement procedures, scope and original evidence, recording both the flag rule and any treatment reason.

NIST · IQR 경계를 정확히 계산하기NIST · Calculate IQR fences explicitly

NIST/SEMATECH handbook · Box plots with fences only

Box plots with fences의 Q1−1.5IQR, Q3+1.5IQR를 확인합니다. 주변의 효과·유의성 설명을 그림만으로 인과를 식별한다는 주장으로 읽지 않습니다. 본문의 type7 사분위수 선택과 결합해 실제 38개 표시를 재현하세요.Read only the fence construction, combining it with our explicitly chosen type7 quartiles. Do not read nearby effect/significance language as causal identification from a plot. Reproduce the thirty-eight flags.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 1.5IQR 경계는 모든 자료의 오류를 판정하는 법칙인가요?Is a 1.5IQR fence a universal error-detection law?

생각을 점검하는 해설Check your reasoning

아닙니다. 선택한 탐색·검토 규칙이며 실제 오류 판정에는 내용 근거가 더 필요합니다.No. It is a chosen exploratory/review rule, requiring substantive evidence before an error verdict.

R 공식 · 사분위수 계산 방식도 기록하기Official R · Record the quantile algorithm too

R stats quantile · type7 definition and missing-value argument

type=7의 보간 위치와 na.rm의 역할을 읽습니다. 온라인 설명 버전과 실제 실행한 R4.5.1을 구별하고, 다른 프로그램의 기본값이 같다고 가정하지 않습니다.Read type7 interpolation and na.rm. Distinguish online documentation from the actual R4.5.1 run, and do not assume another program has the same defaults.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading Q1이라고만 적으면 두 프로그램이 꼭 같은 값을 계산하나요?Does writing only Q1 guarantee identical output in two programs?

생각을 점검하는 해설Check your reasoning

아닙니다. 표본 사분위수에는 여러 정의가 있으므로 알고리즘·결측 처리·경계 포함 규칙을 명시합니다.No. Sample quantiles have multiple definitions; specify algorithm, missing-value treatment and boundary inclusion.

연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof

먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.

1. 유효한 0을 남기는 평균A mean retaining valid zero

가정 값 (0,2,미관측,4)에서 전체·가용·미관측 수와 가용값 평균을 구하세요.

For toy values (0,2, missing,4), find source, available and missing counts and the available mean.

풀이와 확인할 이유Solution and explanation

전체 4개, 가용 3개, 미관측 1개입니다. 평균은 (0+2+4)/3=2입니다. 0도 유효한 가정 관측이므로 분모에 포함합니다.

The counts are four, three and one. The available mean is two; valid zero contributes to its denominator.

2. 거짓처럼 취급되는 값을 버리면Discarding values treated as false

가정 Python 값 [0,2,None,4]에서 if x로 값을 남기는 경우와 x is not None으로 남기는 경우의 평균을 비교하세요.

For toy Python values [0,2,None,4], compare retaining values using if x and x is not None.

풀이와 확인할 이유Solution and explanation

첫 조건은 0과 None을 함께 버려 (2,4)의 평균 3을 만듭니다. 둘째는 (0,2,4)를 남겨 평균 2입니다. 자료사전의 유효 0과 결측은 같은 조건으로 제거하지 않습니다.

The first excludes both zero and None, giving mean three from (2,4). The second retains valid zero and gives mean two from (0,2,4).

3. 0채움 비교의 분모A zero-filled comparison denominator

가정 값 (0,2,미관측,4)의 미관측을 0으로 둔 비교 평균은 얼마인가요? 원래 미관측 값이 확인된 것인가요?

Replace missingness by an assumed zero in toy values (0,2, missing,4). Find the mean and explain its status.

풀이와 확인할 이유Solution and explanation

비교 값은 (0,2,0,4)이므로 평균은 6/4=1.5입니다. 원래 미관측 값을 알아낸 것이 아니라 가정한 값과 다른 분모를 사용했습니다. 원자료와 비교 사본을 구별합니다.

The comparison (0,2,0,4) averages 1.5. This assumes an unobserved value and changes the denominator; it does not recover its original truth.

4. 빈 표와 모두 미관측Empty and all-missing tables

원행 0개인 표 A와 원행 4개가 모두 미관측인 표 B의 가용 평균과 전체·미관측 수를 비교하세요.

Compare table A with no source rows and table B with four all-missing rows: means and source/missing counts.

풀이와 확인할 이유Solution and explanation

둘 다 가용 수가 0이라 가용 평균은 정의되지 않습니다. A의 전체·미관측 수는 0·0이고 B는 4·4입니다. 평균 0으로 통일하면 두 상태와 실제 0 평균을 혼동합니다.

Both have undefined available means. A has source/missing counts zero/zero; B has four/four. Reporting zero would also confuse them with a genuinely observed zero mean.

5. 가정 16행의 두 평균Two means for sixteen toy rows

가정 16행 중 15개가 가용하고 가용 합이 240000입니다. 가용 평균과 미관측 하나를 0으로 둔 비교 평균을 구하세요. 이 합은 실제 GDP 합이 아닌 가정값입니다.

Sixteen toy rows include fifteen available values summing to 240000. Find the available mean and one-zero-filled comparison mean. This sum is assumed, not an actual GDP total.

풀이와 확인할 이유Solution and explanation

가용 평균은 240000/15=16000이고 0채움 비교는 240000/16=15000입니다. 두 평균 비는 15/16입니다. 합이 그대로라고 대상 평균이 같아지는 것은 아닙니다.

They are 16000 and 15000. The zero-filled mean is 15/16 of the available mean; an unchanged sum does not imply an unchanged target.

6. 실제 국가년의 결측 수Unavailable actual country-years

실제 선택 16국×45년은 720행이고 GDP 가용값은 716개입니다. 원 결측 수와 알려진 위치 VNM 1980~1983의 개수가 맞나요?

Sixteen selected countries over 45 years produce 720 rows with 716 available GDP values. Reconcile the missing count with Vietnam 1980–1983.

풀이와 확인할 이유Solution and explanation

720−716=4개이고 1980,1981,1982,1983 네 칸과 일치합니다. 이것은 원 통계열의 가용성 점검이며 네 칸의 GDP가 0이라는 관측은 아닙니다.

There are four unavailable cells, matching those four years. This checks source availability without treating their GDP as observed zero.

7. 실제 사람 로그의 분모The actual person-log denominator

실제 원행 3613개 중 가용 로그 3010개입니다. 미관측 수를 구하고 가용 로그 평균의 분모가 3613인지 설명하세요.

Among 3613 source rows, 3010 logs are available. Find missingness and explain the available-mean denominator.

풀이와 확인할 이유Solution and explanation

미관측은 603개이고 가용 로그 평균의 분모는 3010입니다. 전체 3613으로 나누려면 미관측을 어떻게 다뤘는지 별도 규칙이 필요하며, 몰래 0을 넣은 다른 평균과 구별합니다.

There are 603 unavailable logs. The available mean divides by 3010; using 3613 requires a separately declared treatment of missingness.

8. 같은 가용값과 두 전체 평균The same available data and two full means

가정 원값 중 (0,2,4)만 가용하고 네 번째 M은 미관측입니다. M=0과 M=100에서 전체 평균을 비교하세요.

Only (0,2,4) are available among four toy values; M is missing. Compare full means for M=0 and M=100.

풀이와 확인할 이유Solution and explanation

각각 6/4=1.5와 106/4=26.5입니다. 같은 가용 기록과 다른 전체 평균이 가능하므로 추가 가정 없이 전체 평균을 식별하지 못합니다.

They are 1.5 and 26.5. Identical available records permit different full means, so availability alone does not identify that target.

9. 결측 원인의 정보Information about missingness reasons

원 CSV의 칸이 비어 있는데 이유 코드가 없습니다. 미응답·해당 없음·입력 실패 중 어느 것인지 확정해도 되나요?

A source CSV field is blank with no reason code. May it be classified conclusively as nonresponse, inapplicability or entry failure?

풀이와 확인할 이유Solution and explanation

확정할 근거가 없습니다. 원 미관측 표지와 모르는 원인을 그대로 남깁니다. 변환 과정에서 실패를 직접 관측했다면 그 실패 표지를 원래 빈 칸과 별도로 기록할 수 있습니다.

No. Preserve unavailable status and the unknown reason. A failure directly observed during conversion can be separately recorded instead of being conflated with an original blank.

10. 가용집합이 비면When no values are available

가정 평균 함수는 가용값이 하나도 없으면 None 또는 NULL을 반환합니다. 이를 0으로 바꾸면 어떤 구별이 사라지나요?

A toy mean helper returns None or NULL if no values are available. What is lost by replacing that result with zero?

풀이와 확인할 이유Solution and explanation

평균이 정의되지 않는 상태와 실제 평균 0을 혼동합니다. 전체 원행·가용·미관측 수를 별도 보고하고 함수의 미정의 결과를 성공한 0 계산으로 바꾸지 않습니다.

It confuses an undefined mean with an observed mean of zero. Report source, available and missing counts without turning undefined output into a successful zero calculation.

11. 세 기록과 두 조합Three records and two signatures

가정 값 (2,2,5)에서 기록 수·수치 조합 수·추가 반복 수를 구하세요.

For toy values (2,2,5), find records, numerical signatures and additional occurrences.

풀이와 확인할 이유Solution and explanation

기록은 3개, 수치 조합은 {2,5}의 2개이고 첫 등장 이후 추가 반복은 1개입니다. 같은 2가 실제 같은 개체의 중복 입력이라는 뜻은 아닙니다.

There are three records, two signatures and one occurrence beyond the first of its signature. Equal twos do not establish the same real entity.

12. 반복 조합 수와 추가 행 수Repeated signatures versus extra rows

실제 와인에서 2번 등장하는 조합 204개, 3번 12개, 4번 4개입니다. 반복 조합 수와 첫 등장 이후 추가 행 수를 구하세요.

Wine signatures occur twice for 204 groups, three times for twelve and four times for four. Count repeated signatures and rows beyond first occurrences.

풀이와 확인할 이유Solution and explanation

반복 조합은 204+12+4=220개입니다. 추가 행은 204+2×12+3×4=240개입니다. 서로 다른 단위를 세므로 220과240을 같은 수라고 쓰지 않습니다.

There are 220 repeated signatures and 240 additional rows. The counts describe different objects.

13. 등장 횟수로 원행 수 복원Recovering row counts from multiplicities

실제 와인의 등장 횟수 1·2·3·4인 조합 수가 1139·204·12·4입니다. 조합 수와 원행 수를 검산하세요.

Signature counts for multiplicities one through four are 1139,204,12,4. Verify signatures and records.

풀이와 확인할 이유Solution and explanation

조합 합은 1139+204+12+4=1359입니다. 등장 횟수 가중 합은 1139+408+36+16=1599입니다. 이 가중치는 기록 수를 복원하며 개별 병 ID를 알아낸 것은 아닙니다.

The unweighted sum is 1359 signatures; the multiplicity-weighted sum is 1599 records. This reconstructs counts without identifying bottles.

14. 같은 원 코드 407The same original code 407

실제 원행42와168은 store 코드407이 같지만 각 원행의 FTE변화는 0과2.5입니다. 코드가 같으니 한 행을 지우는 것이 검증된 정정인가요?

Actual rows 42 and 168 share store code 407 but have FTE changes zero and 2.5. Is deleting one a verified correction?

풀이와 확인할 이유Solution and explanation

아닙니다. 서로 다른 출처 행과 값이 있습니다. 코드가 고유하다는 가정부터 맞지 않으며 삭제 근거가 되지 않습니다. 두 원행과 다른 값·맥락을 보존합니다.

No. They are distinct source rows with different values. The repeated code is not a valid uniqueness assumption or deletion justification.

15. 같은 수와 다른 문자열Equal numbers, different strings

원 문자열 1.0과1.00을 수치 조합으로 비교할 때와 문자 그대로 비교할 때의 결과를 설명하세요.

Compare source strings 1.0 and 1.00 under numerical signatures and exact-text equality.

풀이와 확인할 이유Solution and explanation

정확한 수치로는 둘 다 1이라 같습니다. 문자열로는 자릿수 표기가 달라 다릅니다. 두 규칙 모두 원문과 기준을 명시해야 하며 숫자 같음이 같은 개체라는 뜻은 아닙니다.

Both numbers equal one; the strings differ. Declare the rule and retain source text. Numerical equality does not establish identical entities.

16. 고유 키 계약의 실패A failed unique-key contract

가정 원행 키가 a,a이고 값은 2,5입니다. 키가 고유해야 한다는 계약을 검사하면 어떤 결과인가요? 한 값을 삭제하면 되나요?

Toy keys are a, a with values two and five, under a declared unique-key contract. What follows, and may one value simply be deleted?

풀이와 확인할 이유Solution and explanation

고유성 검사는 실패합니다. 그러나 삭제할 행이나 올바른 키를 이 정보만으로 알 수는 없습니다. 원 키·원행 맥락과 계약을 조사하고 변경 근거를 남깁니다.

The check fails, but that alone does not identify a row to delete or the correct key. Investigate source correspondence and document any correction evidence.

17. 조합 가중치로 평균 복원Recovering a mean using multiplicities

가정 기록은 (2,2,5)입니다. 조합 2와5에 등장 횟수 2와1을 붙이면 원 기록 평균을 복원할 수 있나요?

Toy records are (2,2,5). Can weights two and one on signatures two and five recover the record mean?

풀이와 확인할 이유Solution and explanation

(2×2+1×5)/(2+1)=3으로 원 평균과 같습니다. 조합별 균등 평균 (2+5)/2=3.5와 다릅니다. 원 등장 횟수를 보존하는지 확인합니다.

The weighted mean is three, matching the records. Equal signature weighting gives 3.5 instead. Multiplicities determine the target.

18. 같은 평균과 틀린 짝A matching mean with wrong pairing

가정 전 값 (1,2), 후 값 (3,4)이 같은 위치끼리 짝입니다. 후 열만 뒤집을 때 변화 평균과 n분모 기술분산을 비교하세요.

Toy before values (1,2) pair by position with after values (3,4). Reverse only after. Compare change means and n-divisor variances.

풀이와 확인할 이유Solution and explanation

정상 변화는 (2,2)로 평균2·분산0입니다. 뒤집으면 (3,1)로 평균2·분산1입니다. 평균이 같아도 개별 짝과 분산이 달라지므로 평균 하나로 대응을 검증하지 못합니다.

Valid differences (2,2) have mean two and variance zero. Reversed differences (3,1) have the same mean but variance one. A matching mean cannot certify pairing.

19. 전체 행을 함께 정렬Sorting whole records together

가정 두 기록은 (원행42,변화0)과(원행168,변화2.5)입니다. 이 두 행만 변화 내림차순 정렬할 때 무엇을 함께 옮겨야 하나요?

Two toy records are (source 42, change 0) and (source 168, change 2.5). Sort only these two records by decreasing change.

풀이와 확인할 이유Solution and explanation

원행 키와 모든 원 필드를 함께 옮겨 168이 먼저 옵니다. 변화 열만 옮기고 원행 키를 두면 새로 틀린 대응을 만듭니다. 전체 파일의 다른 행에 대한 순서를 묻는 예가 아닙니다.

Move source keys and whole records together, placing 168 first. Moving only the change column invents a false correspondence. No order of other archive rows is implied.

20. 식별 정보가 없는 반복Repetitions without entity identifiers

와인 12개 숫자가 같은 두 행에 병 ID나 원 측정 개체 식별자가 없습니다. 확정할 수 있는 것과 없는 것을 나누세요.

Two wine rows share twelve numbers but lack bottle or measurement-unit identifiers. What can and cannot be concluded?

풀이와 확인할 이유Solution and explanation

선택한 수치 조합이 같다는 사실은 확인할 수 있습니다. 같은 병을 잘못 두 번 입력했는지, 독립 관측인지, 다른 병이 같은 값을 가졌는지는 이 정보만으로 확정하지 못합니다.

Their selected numerical signatures match. That alone cannot establish accidental repeated entry, independence or whether different bottles share the values.

21. 다섯 값의 사분위Quartiles of five values

가정 (0,1,2,3,100)에서 type7 Q₁,Q₃,IQR을 구하세요.

Find type 7 lower/upper quartiles and IQR for toy values (0,1,2,3,100).

풀이와 확인할 이유Solution and explanation

h=1+4p이므로 p=1/4에서 두 번째 값1, p=3/4에서 네 번째 값3입니다. IQR=2입니다. 관례를 바꾸면 작은 표본의 결과가 달라질 수 있습니다.

The one-based position is 1+4p, selecting one and three at quarter probabilities. IQR is two; conventions can differ in small samples.

22. 네 값의 선형 보간Interpolation for four values

가정 정렬값 (1,2,4,8)에서 type7 Q₁과Q₃을 구하세요. h=1+(n−1)p를 사용합니다.

For ordered toy values (1,2,4,8), use h=1+(n−1) p to find type 7 quartiles.

풀이와 확인할 이유Solution and explanation

Q₁의 h는1.75이므로 1+.75(2−1)=1.75입니다. Q₃의 h는3.25라서 4+.25(8−4)=5입니다. 두 경우 모두 지정한 이웃 순서값 사이의 보간입니다.

Positions 1.75 and 3.25 yield 1.75 and five by interpolation between adjacent ordered values.

23. 네 값의 울타리Fences for four values

가정 (1,2,4,8)의 type7 Q₁=7/4,Q₃=5입니다. 1.5IQR 아래·위 울타리를 구하고 8의 표지 여부를 말하세요.

Toy quartiles are Q₁=7/4 and Q₃=5 for (1,2,4,8). Find 1.5 IQR fences and classify eight.

풀이와 확인할 이유Solution and explanation

IQR=13/4이고 1.5IQR=39/8입니다. L=−25/8=−3.125,U=79/8=9.875입니다. 8은 안에 있으므로 바깥 표지가 아닙니다.

IQR is 13/4, giving fences −25/8 and 79/8. Eight is inside, so it is not flagged.

24. 울타리와 같은 값Values equal to a fence

가정 울타리는 L=0,U=10이며 바깥 규칙은 x<L 또는 x>U입니다. 값 (0,10,−1,11) 중 어떤 것이 표시되나요?

Toy fences are L=0, U=10, with flags x<L or x>U. Classify (0,10,−1,11).

풀이와 확인할 이유Solution and explanation

−1과11만 표시됩니다. 0과10은 울타리와 같으므로 이번 엄격 바깥 규칙에서는 표시되지 않습니다. 표시 반올림과 내부 비교도 구별합니다.

Only −1 and eleven are flagged. Equality with a fence is not outside under the declared strict rule.

25. IQR이 0인 예A zero IQR

가정 (1,1,1,1,9)의 type7 사분위와 울타리·표지를 구하세요.

Find type 7 quartiles, fences and flags for toy values (1,1,1,1,9).

풀이와 확인할 이유Solution and explanation

두 사분위는1,IQR은0이고 양 울타리도1입니다. 9는 바깥 표지입니다. 이 계산만으로 9나 반복된1이 입력 오류임을 입증하지 못합니다.

Both quartiles and fences equal one, with IQR zero. Nine is flagged, without establishing an entry error.

26. 양수 아핀 환산과 표지Positive affine conversion and flags

가정 울타리 [−2,6]와 변환 y=60x+5입니다. 같은 기준 집합에 이 변환을 적용한 울타리를 구하고 표지가 보존되는 이유를 설명하세요.

Toy fences are [−2,6]. Apply y=60x+5 consistently to the same reference set. Find transformed fences and explain flag preservation.

풀이와 확인할 이유Solution and explanation

새 울타리는 [−115,365]입니다. 양수 배수는 순서를 보존하고 type7 보간·IQR도 일관되게 환산됩니다. 따라서 x의 엄격 바깥 여부와 변환된 y의 바깥 여부가 같습니다.

They are [−115,365]. A positive affine map preserves order and transforms interpolation and IQR consistently, preserving strict outside classification.

27. 로그와 보간은 교환되는가Do logarithm and interpolation commute?

가정 양수 (1,2,4,8)의 type7 Q₁은1.75입니다. 로그값의 Q₁을 계산해 지수화하면 얼마이고 왜 다를까요?

The type 7 lower quartile of toy values (1,2,4,8) is 1.75. Exponentiate the lower quartile of their logs and compare.

풀이와 확인할 이유Solution and explanation

로그 순서값은 0,log2,2log2,3log2입니다. Q₁=.75log2이고 지수화하면 2^(3/4)≈1.681793입니다. 비선형 변환은 선형 보간과 일반적으로 교환되지 않습니다.

The log quartile is .75 log 2, whose exponential is 2^(3/4)≈1.681793. Nonlinear transformation generally does not commute with linear interpolation.

28. 큰 값 하나와 요약One large value and the summaries

가정 (0,1,2,3,100)의 평균·중앙값과 100을 제외한 네 값의 평균을 구하세요.

For toy values (0,1,2,3,100), find mean, median and the comparison mean after excluding one hundred.

풀이와 확인할 이유Solution and explanation

원 평균은106/5=21.2, 중앙값은2, 제외 비교 평균은6/4=1.5입니다. 요약이 크게 달라지는 것은 산술이며 제외가 올바른 정정이라는 증거는 아닙니다.

They are 21.2, two and 1.5. Large changes are arithmetic consequences, not proof that exclusion is a valid correction.

29. 실제 표지 비율의 분모Denominators of actual flag shares

실제 가용 로그3010개 중 아래22·위16개가 표시됐고 전체 원행은3613개입니다. 가용값 중 표지 비율과 전체 원행 중 비율을 구별하세요.

There are 22 lower and sixteen upper flags among 3010 available logs and 3613 source rows. Distinguish the two flag shares.

풀이와 확인할 이유Solution and explanation

표지는38개입니다. 가용값 중 비율은38/3010=19/1505, 전체 원행 중 비율은38/3613입니다. 둘은 질문과 분모가 다르며 어느 비율도 검증된 오류율이 아닙니다.

Thirty-eight flags give shares 38/3010 and 38/3613 respectively. They answer different denominator questions; neither is a verified-error rate.

30. 표지가 실제 사건일 수 있다A flag can mark a real event

명시한 IQR 규칙이 실제 큰 값을 표시했습니다. 원문과 단위 검사에서 입력 오류 근거를 찾지 못했다면 자동 삭제해야 하나요?

An IQR rule flags an actual large value, but source and unit checks find no error evidence. Must it be automatically deleted?

풀이와 확인할 이유Solution and explanation

자동 삭제할 근거가 없습니다. 원값과 표지·조사 결과를 보존하고 질문에 필요한 처리와 민감도 비교를 명시합니다. 드문 실제 사건을 없애면 관심 표적을 잃을 수도 있습니다.

No automatic deletion follows. Retain the value, flag and review outcome, and state any question-specific comparison. Removing a rare real event can remove the target of interest.

31. 정상 가정 입력의 검사Checks on a valid toy input

가정 두 행의 키는 a,b, 횟수는0,2, 상태는0,1입니다. 키 유일성·횟수 가용성과 비음수·상태{0,1} 검사를 통과하나요? 실제 진실성도 입증되나요?

Two toy rows have keys a, b, counts zero, two and status codes zero, one. Do unique-key, available nonnegative-count and status-domain checks pass? Do they establish truth?

풀이와 확인할 이유Solution and explanation

선언한 검사들은 통과합니다. 그러나 이 두 행은 가정 예이고, 스키마에 맞는다는 사실은 실제 측정 진실성이나 대표성을 입증하지 않습니다.

They pass those declared checks. The rows are hypothetical, and schema conformity does not establish measurement truth or representativeness.

32. 미정의 상태 코드An unknown status code

가정 상태 코드가0 또는1이어야 하는데3이 들어왔습니다. 숫자로 읽기 성공했으므로 유효한가요?

A toy status must belong to {0,1}, but three is supplied. Is successful numerical reading enough?

풀이와 확인할 이유Solution and explanation

아닙니다. 숫자 변환과 코드 집합 적합성은 다른 검사입니다. 원값3과 실패 이유를 남기고 출처 근거 없이 0이나1로 바꾸지 않습니다.

No. Parsing and domain membership are different checks. Preserve the value and failure reason instead of guessing zero or one.

33. 고유성 실패와 삭제 결정Uniqueness failure and deletion

가정 검증은 키가 고유해야 한다고 선언했고 두 키가 모두 a입니다. 오류가 나면 두 번째 행을 자동으로 지워도 되나요?

A toy contract requires unique keys but both supplied keys are a. Does a failed check justify deleting the second row automatically?

풀이와 확인할 이유Solution and explanation

검사 실패는 선언한 계약의 불일치를 알려 줍니다. 어느 키나 행이 잘못됐는지까지 정하지는 않습니다. 원문과 관측 대응을 조사하고 정정 근거를 기록해야 합니다.

It establishes a contract mismatch, not which row or key is wrong. Investigate source correspondence and retain correction evidence.

34. 미관측 횟수와 0An unavailable count and zero

가정 검증은 횟수의 가용성을 요구합니다. 한 횟수가 None/NA입니다. 검사를 통과시키려고 0을 넣으면 어떤 새 가정을 하나요?

A toy check requires available counts, but one is None/NA. What assumption is added by inserting zero merely to pass?

풀이와 확인할 이유Solution and explanation

미관측을 실제 횟수0으로 대체하는 가정입니다. 그 값을 원래 관측했다고 할 수 없습니다. 원 결측·실패 이유를 보존하고 대체를 하려면 별도의 근거·비교 범위를 명시합니다.

It assumes the unavailable count equals zero. Preserve original missingness and the failure reason; any replacement needs separately stated evidence and scope.

35. 횟수의 음수A negative count

가정 변수는 비음수 횟수이고 −1이 들어왔습니다. 실제 변화량은 음수가 가능하므로 이 값도 허용해야 하나요?

A declared nonnegative toy count is −1. Since changes can be negative, must this count be accepted too?

풀이와 확인할 이유Solution and explanation

이번 변수는 변화량이 아니라 비음수 횟수로 선언했습니다. 따라서 검사는 실패합니다. 다른 변수의 허용 범위를 가져와 계약을 바꾸지 않습니다. 순변화라면 별도의 정의와 검사가 필요합니다.

No. This field is a count rather than a net change. Apply its declared domain; a change variable requires a different definition and check.

36. 아직 검사하지 않은 정수성Integrality not yet checked

가정 검사는 횟수가 미관측이 아니고 0이상인지만 확인하며 정수성은 검사하지 않습니다. 횟수0.5는 이 두 검사를 통과하나요? 정수 횟수 계약까지 확인됐나요?

Toy checks require a count to be available and nonnegative but do not test integrality. Does 0.5 pass, and has an integer-count contract been verified?

풀이와 확인할 이유Solution and explanation

0.5는 가용하고 비음수이므로 두 검사를 통과합니다. 정수성은 아직 확인하지 않았습니다. 실제로 그 계약이 필요하면 별도 검사를 추가해야 하며 기존 성공의 범위를 과장하지 않습니다.

It passes the two stated checks, but integrality remains untested. Add the required check instead of overstating what the existing success establishes.

37. assert의 실행 조건Execution conditions for assert

Python 문서에 따라 최적화 옵션이 assert를 비활성화할 수 있습니다. 가정 입력 계약을 모든 배포 실행에서 강제하려면 무엇을 고려해야 하나요?

Python optimization can disable assert statements. What should be considered when an input contract must be enforced in every deployment run?

풀이와 확인할 이유Solution and explanation

명시적인 if 조건과 예외 발생 같은 강제 검사를 고려하고 실제 실행 옵션을 기록합니다. 이 장의 보관 예는 일반 비최적화 Python이며, 다른 실행 조건의 결과를 이미 관측한 것처럼 말하지 않습니다.

Consider explicit conditional exception checks and record actual execution options. This catalog used ordinary nonoptimized Python; it does not claim observations under every alternative execution configuration.

38. 범위 통과와 대표성Domain conformity and representativeness

실제 자료의 모든 값이 선언한 코드 범위를 통과했습니다. 모집단을 대표하고 인과효과를 추정할 수 있다고 결론내려도 되나요?

Every actual value passes declared code ranges. Does that establish population representativeness and a causal effect?

풀이와 확인할 이유Solution and explanation

아닙니다. 범위 검사는 해당 코드 계약을 점검합니다. 표집·측정·비교 설계·교란과 반사실에 대한 조건은 별도입니다. 통과한 검사와 해석 근거를 구별합니다.

No. Range checks address their code contract. Sampling, measurement, comparisons, confounding and counterfactual conditions need separate evidence.

39. 겹치는 두 표지Two overlapping flags

가정 원행에서 표지 A는{1,2}, B는{2,3}에 있습니다. 표지별 개수 합과 고유 표시 행 수를 비교하세요.

Toy flag sets are A={1,2} and B={2,3}. Compare the sum of flag counts with distinct flagged rows.

풀이와 확인할 이유Solution and explanation

각각2개라 합은4지만 합집합은{1,2,3}의3개입니다. 교집합 원행2를 두 번 셌습니다. |A∪B|=|A|+|B|−|A∩B|로 검산합니다.

The counts sum to four, but only three distinct rows are flagged. Subtract the one-row intersection when counting their union.

40. 서로 겹치지 않는 네 상태Four disjoint review states

실제 사람 검토표는 아래22·안2972·위16·미관측603의 정확히 한 상태를 각 원행에 붙입니다. 전체 원행 수를 검산하고 이 합이 가능한 전제를 말하세요.

Actual review states contain 22 lower,2972 inside,16 upper and 603 missing rows, exactly one state per source row. Verify total and assumptions.

풀이와 확인할 이유Solution and explanation

합은3613입니다. 네 상태가 서로 겹치지 않고 모든 원행을 덮는다는 전제가 필요합니다. 일반적인 여러 표지는 겹칠 수 있으므로 무조건 같은 합 검사를 적용하지 않습니다.

They sum to 3613. The identity depends on disjointness and complete coverage; arbitrary overlapping flags cannot be summed the same way.

41. 먼저 전체에서 표지하기Flagging against the full reference first

가정 원값 (0,1,2,3,100)에서 전체 type7 울타리 [−2,6]을 먼저 만든 뒤 x>1을 고릅니다. 남은 원위치·값·바깥 표지를 쓰세요.

Toy values are (0,1,2,3,100). Use full-reference type 7 fences [−2,6], then retain x>1. Give source positions, values and flags.

풀이와 확인할 이유Solution and explanation

1부터 센 원위치3,4,5의 값 (2,3,100)이 남고 표지는 (거짓,거짓,참)입니다. 기준 집합은 원래 다섯 값입니다.

One-based positions three, four, five retain (2,3,100), with flags (false, false, true). The reference remains all five source values.

42. 먼저 선택하고 다시 표지하기Filtering before recomputing flags

가정 원값 (0,1,2,3,100)에서 x>1인 (2,3,100)을 먼저 고릅니다. type7 Q₁=2.5,Q₃=51.5일 때 울타리와 표지를 계산하세요.

Select (2,3,100) by x>1 from toy values (0,1,2,3,100). Given type 7 quartiles 2.5 and 51.5, calculate fences and flags.

풀이와 확인할 이유Solution and explanation

IQR=49이고 L=2.5−73.5=−71,U=51.5+73.5=125입니다. 세 값 모두 안에 있어 표지는 전부 거짓입니다. 이전 문제와 값은 같아도 기준 집합이 달라졌습니다.

IQR is 49, yielding fences −71 and 125. All selected flags are false. The values match the previous example but the reference set differs.

43. 표지 추가의 불변량Invariants of adding flags

원자료에 검토 표지 열만 추가했다고 합니다. 원행 수·원 키·원값 중 무엇이 같아야 하나요?

A working table supposedly only adds a review-flag column. Which of source count, keys and original values should remain unchanged?

풀이와 확인할 이유Solution and explanation

세 항목 모두 보존되어야 합니다. 표지 열 추가와 값 대체·행 제외는 다른 작업입니다. 단지 평균이 같다는 확인보다 전체 원행 대응을 검사합니다.

All three. Adding flags differs from replacing values or excluding rows. Check whole-record correspondence rather than only a matching mean.

44. 실패 뒤 남은 성공 평균An old successful mean after a failure

새 입력이 검증에 실패했는데 화면에 이전 입력의 성공 평균이 남았습니다. 어떤 문제가 있고 어떻게 표현해야 하나요?

A new input fails validation while an old successful mean remains visible. What should change?

풀이와 확인할 이유Solution and explanation

현재 입력에 대한 결과처럼 보일 수 있습니다. 이전 결과를 지우거나 이전 결과임을 분명히 분리하고 현재 실패·교정 방법을 표시합니다. 실패를 평균0으로 바꾸지도 않습니다.

It can appear to describe the new input. Clear or clearly separate the old result and display the present failure and correction path. Do not replace failure by zero.

45. 보관 조회와 실제 실행Record selection versus execution

브라우저 메모 칸에 Python 코드를 적고 보관 결과 공개를 눌렀습니다. 새 코드가 실행된 것인가요?

Python source is typed into the browser’s prediction note before revealing an archived result. Was that new source executed?

풀이와 확인할 이유Solution and explanation

아닙니다. 메모는 실행하지 않는 예상 기록이고 버튼은 유한한 실제 보관 결과를 조회합니다. 실제 언어 실행은 내려받은 코드·입력과 새 프로세스 경로로 수행합니다.

No. The note is never executed; reveal selects a finite archived run. Actual language execution uses downloaded code and inputs in a new real process.

46. 작업 파일을 썼는가Was a working CSV written?

이번 실제 프로그램은 원 CSV를 읽고 메모리에서 선택 목록을 계산한 뒤 JSON을 출력했습니다. 정제 CSV를 원본에 저장했다고 보고해도 되나요?

An actual program reads a source CSV, computes an in-memory selection and prints JSON. May it be reported as saving a cleaned CSV over the source?

풀이와 확인할 이유Solution and explanation

안 됩니다. 실제 한 작업은 읽기·계산·표준 출력입니다. 외부 CSV 저장이나 원본 수정이 수행됐다고 지어내지 않습니다. 나중에 내보내면 그 경로·형식·키 검사를 별도로 기록합니다.

No. It performed reading, calculation and stdout output. A later export requires its own recorded path, serialization and preservation checks.

47. 멱등적인 나쁜 변환An idempotent information-losing map

가정 T(x)는 어떤 입력도0으로 바꿉니다. T(T(x))=T(x)인가요? 그렇다면 정제의 정확성이 증명되나요?

A toy map T replaces every input by zero. Does T(T(x))=T(x), and does that certify a correct cleaning?

풀이와 확인할 이유Solution and explanation

두 번 적용해도0이므로 등식은 성립합니다. 그러나 원 정보를 버리는 함수도 멱등적일 수 있어 정확한 정정을 증명하지 못합니다.

The identity holds, but an information-losing map can be idempotent. Repeated stability alone does not establish correctness.

48. 제외 평균 항등식An exclusion-mean identity

유효 원값을 남긴 m≥1개와 제외한 r≥1개로 나누고 평균을 μₖ,μᵣ라 합니다. 원 평균 x̄와 μₖ−x̄를 유도하세요.

Partition valid source values into m≥1 retained and r≥1 omitted values, with means μₖ and μᵣ. Derive the full mean and retained-minus-full difference.

풀이와 확인할 이유Solution and explanation

두 합을 더하면 원 합이므로 개수 가중 평균을 얻습니다. 정리하면 차이도 계산됩니다.

xˉ=mμk+rμrm+rμk−xˉ=r(μk−μr)m+r\begin{gathered}\bar x=\frac{m\mu_k+r\mu_r}{m+r}\\\mu_k-\bar x=\frac{r(\mu_k-\mu_r)}{m+r}\end{gathered}

이는 유한 자료의 항등식이며 제외가 통계적으로 타당하다는 보장은 아닙니다.

Add the two group sums and divide by total count:

xˉ=mμk+rμrm+rμk−xˉ=r(μk−μr)m+r\begin{gathered}\bar x=\frac{m\mu_k+r\mu_r}{m+r}\\\mu_k-\bar x=\frac{r(\mu_k-\mu_r)}{m+r}\end{gathered}

This finite identity does not establish the validity of exclusion.

49. 가정 범위의 전체 평균A mean range under an assumed bound

가정 네 원값 중 (0,2,4)는 가용하고 한 값 M이 미관측입니다. 외부 가정 0≤M≤10에서 전체 평균 범위를 구하세요. 신뢰구간인가요?

Four toy values include available (0,2,4) and unavailable M. Under an external assumption 0≤M≤10, find the full-mean range. Is it a confidence interval?

풀이와 확인할 이유Solution and explanation

평균 (6+M)/4는 M에 대해 증가하므로 [1.5,4]입니다. 선택한 가정의 민감도 범위이며 표집 절차에서 나온 신뢰구간이나 자료가 검증한 범위는 아닙니다.

The mean (6+M)/4 ranges from 1.5 to 4. This is an assumption-dependent sensitivity range, not a sampling confidence interval or empirically verified support.

50. 비교 경로의 재현 정보Reproducing an exclusion comparison

가정 제외 평균을 재현하려면 입력·규칙·언어에서 어떤 정보를 보관해야 하나요?

What input, rule and runtime information is needed to reproduce a hypothetical exclusion mean?

풀이와 확인할 이유Solution and explanation

입력 출처·바이트 해시·원행 키, 가용성 규칙·분위수 관례·울타리 배수·경계 비교·단계 순서, 선택 원행과 분모, 코드·버전·관련 환경과 실제 출력을 남깁니다. 원본과 비교 사본의 지위도 적습니다.

Retain provenance/hash/keys, availability and quantile conventions, fence multiplier, boundary comparison, operation order, selected rows and denominator, source code/version/settings and actual output. Distinguish the comparison from the source.

51. 실제 VNM 미관측의 뜻Meaning of the unavailable Vietnamese values

World Bank 선택 자료의 VNM1980~1983 GDP 네 칸이 비어 있습니다. 그 네 해의 경제활동이0이었다는 뜻인가요?

Four retained Vietnamese GDP cells for 1980–1983 are unavailable. Does that mean economic activity was zero?

풀이와 확인할 이유Solution and explanation

아닙니다. 이번 보관 통계열에 가용 값이 없다는 뜻입니다. 원인이나 실제 GDP를 이 빈 칸만으로 확정하지 않으며 0채움 비교를 원 관측으로 바꾸지 않습니다.

No. The archived series lacks available values there. The blanks alone identify neither their cause nor GDP truth, and a zero-fill comparison is not a source observation.

52. 로그 평균과 임금 평균Mean log and mean wage

가정 시간당 임금이100센트와400센트이고 자연로그를 취했습니다. 로그 평균을 지수화한 뒤100으로 나눈 값과 임금 달러 산술평균을 비교하세요.

Toy hourly wages are 100 and 400 cents, transformed by natural logarithm. Compare exponentiating the mean log and dividing by 100 with the arithmetic dollar-wage mean.

풀이와 확인할 이유Solution and explanation

로그 평균의 지수는 √(100×400)=200센트라서2 USD/시간입니다. 달러 임금 (1,4)의 산술평균은2.5입니다. 앞 값은 이 가정 두 임금의 기하평균이며 로그 평균을 원 임금 산술평균으로 읽지 않습니다.

The first gives the geometric mean 200 cents, or two USD/hour. The arithmetic mean of dollar wages (1,4) is 2.5. These are different summaries.

53. 와인 조합별 한 행의 해석Interpreting one row per wine signature

실제1599행을1359개 수치 조합별 한 행으로 고른 비교에서 quality 평균이 바뀌었습니다. 실제 와인의 품질이 개선됐다는 증거인가요?

Selecting one row from each of 1359 signatures changes the quality mean compared with 1599 actual rows. Does that establish improved wine quality?

풀이와 확인할 이유Solution and explanation

아닙니다. 원 관측은 바뀌지 않았고 조합별 가중치가 달라졌습니다. 순서 점수의 수치 평균이라는 선택도 남깁니다. 검증된 중복 정정이나 품질 향상으로 해석하지 않습니다.

No. Observations were unchanged while weighting changed. Retain the numerical-summary choice for ordered scores; this is not a verified duplicate correction or quality improvement.

54. 같은 원행과 달라진 표지Equal rows with different flags

가정 파이프라인 두 순서가 모두 원행3,4,5의 (2,3,100)을 남기지만 마지막 표지가 참/거짓으로 다릅니다. 어떤 추가 기록을 비교해야 하나요?

Two toy pipelines retain the same source rows 3,4,5 and values (2,3,100), but disagree on the last flag. What should be inspected?

풀이와 확인할 이유Solution and explanation

울타리를 만든 기준 집합·분위수·IQR·단계 순서를 비교합니다. 선택 값이나 원 측정이 달라졌다는 결론을 먼저 내리지 않습니다.

Compare reference sets, quartiles, IQR and operation order before claiming different selected measurements.

55. 조합 가중 평균의 일반식The general multiplicity-weighted mean

같은 수치 값 vⱼ의 등장 횟수가 nⱼ≥1이고 조합이 k≥1개입니다. 기록별 평균을 조합과 가중치로 쓰고, 조합별 균등 평균과 언제 비교 대상이 달라지는지 설명하세요.

There are k≥1 signatures with values vⱼ and multiplicities nⱼ≥1. Express the record mean and compare equal-signature weighting.

풀이와 확인할 이유Solution and explanation

각 값이 등장한 횟수만큼 합에 기여하므로 다음과 같습니다.

xˉ=∑j=1knjvj∑j=1knjvˉ=1k∑j=1kvj\begin{gathered}\bar x=\frac{\sum_{j=1}^k n_jv_j}{\sum_{j=1}^k n_j}\\\bar v=\frac1k\sum_{j=1}^k v_j\end{gathered}

두 식은 가중 법칙이 다릅니다. 모든 nⱼ가 같으면 같지만, 횟수가 다를 때도 우연히 같을 수 있어 평균 일치로 가중치 일치까지 증명하지는 못합니다.

Each signature contributes its multiplicity:

xˉ=∑jnjvj∑jnjvˉ=1k∑jvj\begin{gathered}\bar x=\frac{\sum_j n_jv_j}{\sum_j n_j}\\\bar v=\frac1k\sum_jv_j\end{gathered}

Equal multiplicities guarantee equality. Unequal weights can also happen to yield the same mean, so mean agreement does not establish identical weighting.

56. 오류율과 표지율Error rates versus flag rates

어떤 실제 자료에서 규칙 바깥38개를 찾았습니다. 별도 원문 검증 없이 “오류38개를 발견했다”라고 쓰면 무엇을 과장하나요?

A rule flags 38 actual values without source-error verification. What is overstated by saying “38 errors were found”?

풀이와 확인할 이유Solution and explanation

선택한 수치 규칙을 검증된 측정 오류 판정으로 바꿉니다. “명시한 규칙으로38개를 검토 표시했고 오류 여부는 추가 확인이 필요하다”라고 범위를 맞춥니다.

It turns a numerical review rule into a verified measurement-error verdict. Report 38 review flags under the declared rule and the unresolved error status.

57. 표시 전 원값 보존의 검사Checking values before and after flagging

표지 추가 전후의 가정 원행 키가{a,b,c}로 같지만 b의 원값이2에서0으로 바뀌었습니다. 행 수가 같으니 표지만 추가했다고 해도 되나요?

Toy source keys stay {a, b, c}, but row b changes from two to zero. Does equal count establish a flag-only operation?

풀이와 확인할 이유Solution and explanation

안 됩니다. 원값도 보존해야 하는 표지 단계에서 값 대체가 일어났습니다. 키·행 수·원값을 각각 확인하고 대체 규칙과 근거를 별도로 보고합니다.

No. The supposed flag-only step also replaced a value. Check keys, count and original values separately, and disclose any replacement rule and evidence.

58. 탐색한 규칙과 새 자료 성능Searched rules and new-data performance

여러 울타리를 시험하고 같은 자료의 예측 손실이 가장 작은 것을 골랐습니다. 이것만으로 새 자료 성능이 가장 좋다고 입증되나요?

Several fence rules are tried and the smallest prediction loss on those same data is selected. Does this prove best performance on new data?

풀이와 확인할 이유Solution and explanation

아닙니다. 같은 자료를 보고 규칙을 고른 탐색이 포함되어 있습니다. 선택 과정과 정보 사용을 공개하고 적절한 별도 평가를 설계해야 합니다. 이번 가정 비교를 이미 수행된 시험 검증이라고 말하지 않습니다.

No. Rule selection used the inspected data. Disclose the search and information access, and design separate evaluation. The comparison is not already a held-out test.

59. 첫 등장 선택과 정렬 순서First-occurrence selection and ordering

가정 원행a,b는 같은 수치2를 갖습니다. 각 조합의 첫 행만 고를 때 순서를 (a,b)와(b,a)로 바꾸면 무엇이 같고 무엇이 달라지나요?

Toy rows a, b both contain numerical value two. Keep the first per signature under orders (a, b) and (b, a). What changes?

풀이와 확인할 이유Solution and explanation

남긴 수치2는 같지만 선택 원행 키는 a와b로 달라집니다. 원행 추적과 선택 규칙·정렬 순서를 보존해야 하며 값 일치만으로 동일한 출처 행을 남겼다고 할 수 없습니다.

The numerical result remains two, but the selected source key changes. Preserve source traces, selection rule and ordering rather than inferring equal retained records from equal values.

60. 연구 문장의 근거를 바로잡기Repairing a research claim

“큰 값38개와 중복240개를 지웠으므로 원자료 오류를 모두 고쳤고 모집단 추정도 정확해졌다”라는 문장을 고치세요.

Repair: “Removing 38 large values and 240 duplicates fixed all source errors and made population estimation accurate.”

풀이와 확인할 이유Solution and explanation

“명시한 IQR 규칙에서38개를 검토 표시했고 수치 조합의 첫 등장 이후 추가 기록은240개였다. 원행을 보존하며 가정 제외·축약을 별도 비교했다. 실제 오류 여부와 모집단 추정의 타당성은 추가 근거가 필요하다”라고 구별합니다.

State that a declared IQR rule produced 38 review flags and signatures had 240 additional occurrences. Preserve source rows and label exclusion/collapse as comparisons. Actual errors and inferential validity require further evidence.

자료와 출처Data and sources

실습에 추가한 실제 입력과 출처Additional observed lab inputs and provenance

실제 자료 사례Actual-data cases · 원자료·단위·결측·변환·출처Inputs, units, missingness, transformations and sources

자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.

자료사전·출처·이용 조건Data dictionary, sources and terms