Files
skills/public/research-data-collection.html
zeekayandHanzo Dev 9e10c1c10e Each llms index points at the other two
hanzoskills.com/llms.txt now opens with the install line, the API
reference index and the company index, so an agent that lands on any
one of the three can find the rest.

robots.txt claimed 537 documents while llms.txt counts 920. The number
is gone from robots.txt; llms.txt derives it.

public/ is regenerated from scripts/site.py, which it had fallen
behind: the copy-prompt menu and agent bar were in the generator and
not in the committed pages. tests/site.mjs passes against the result.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 00:27:59 -07:00

917 lines
40 KiB
HTML

<!doctype html>
<html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>research-data-collection</title>
<meta name="color-scheme" content="dark">
<style>
/* Committed to one visual world: a dark instrument panel. No light variant —
the dot field and the hairline rules only read on black, and a naive
inversion would wash both out. Every colour is painted explicitly so the page
never borrows a host background. */
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
:root{
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
--font-zen-pixel-square:'Zen Pixel Square',monospace;
--mono:var(--font-zen-mono);
--sans:var(--font-zen-sans);
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
--r:999px; --r-soft:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
/* The dot field. A halftone made of one repeating radial-gradient, faded out
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
/* No overflow clip here: the dot field is inset to the box already, and a clip
would cut off the copy-prompt menu. */
.hero{position:relative;border-bottom:1px solid var(--line)}
.hero::before{content:"";position:absolute;inset:0;
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
background-size:7px 7px;
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
pointer-events:none}
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
nav{border-bottom:1px solid var(--line)}
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
justify-content:space-between;align-items:center;gap:1rem}
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--ink);text-decoration:none;
display:inline-flex;align-items:center;gap:.6rem}
.brand i{font-style:normal;color:var(--faint)}
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
text-transform:uppercase;color:var(--soft);text-decoration:none}
nav a.up:hover{color:var(--ink)}
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
h1 em{font-style:normal;color:var(--faint)}
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
line-height:1.2;font-weight:400}
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
.btn.solid:hover{background:#d8d8d4}
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
/* Copy-prompt selector. Each row copies the prompt for its own target. */
.copy{position:relative;display:inline-flex}
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
padding:.4rem;display:flex;flex-direction:column;
box-shadow:0 12px 32px rgba(0,0,0,.75)}
.menu[hidden]{display:none}
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
white-space:nowrap}
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
.mi:hover .mark{color:var(--ink)}
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
letter-spacing:.1em;text-transform:uppercase}
/* Works-with bar: one scrolling row, name and mark per agent. */
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
display:flex;align-items:center}
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
-webkit-overflow-scrolling:touch;
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
.bar::-webkit-scrollbar{display:none}
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
text-decoration:none;background:var(--ground)}
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
.agent .mark{width:.95rem;height:.95rem}
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
p{margin:0 0 1rem;max-width:70ch}
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
li{margin:.22rem 0}
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
text-decoration-color:var(--line-hi)}
a:hover{text-decoration-color:var(--ink)}
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
display:block;overflow-x:auto}
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
.curl{display:block;background:var(--panel);border:1px solid var(--line);
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
white-space:pre;line-height:1.9}
.curl b{color:var(--ink);font-weight:400}
.curl i{font-style:normal;color:var(--faint)}
/* index */
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
#q:focus{outline:none;border-color:var(--soft)}
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
text-transform:uppercase;margin:0 0 2rem}
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
padding-bottom:.45rem}
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
border-radius:var(--r-soft);text-decoration:none}
.row:hover{background:#0a0a0a}
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
color:var(--faint);font-size:.85rem}
footer a{color:var(--soft)}
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
margin:0 0 2rem;font-size:.85rem}
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
border-bottom:1px solid var(--line);padding-bottom:.4rem}
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
.fmap a:hover{text-decoration:underline}
.fmap div{color:var(--faint);line-height:1.5}
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
@media (max-width:640px){
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
.btns{gap:.5rem}
.btn{padding:.75rem 1.15rem;font-size:.68rem}
.copy,.copy .btn{width:100%;justify-content:center}
.menu{left:0;right:0;min-width:0}
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
.strip b{border-right:0;padding-right:0}
.bar{width:100%}
}
</style>
<link rel="alternate" type="text/markdown" href="/research-data-collection.md">
<link rel="icon" href="/favicon.svg">
<link rel="canonical" href="https://hanzoskills.com/research-data-collection">
</head>
<!-- Reading this with a machine? Every page here is also plain markdown.
This one: https://hanzoskills.com/research-data-collection.md
Index: https://hanzoskills.com/llms.txt
Corpus: https://hanzoskills.com/all.md
Append .md to any path for the markdown twin. -->
<body>
<nav><div class="in">
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
<a class="up" href="/">All skills</a>
</div></nav>
<div class="wrap">
<h1>research-data-collection</h1><p class="lede">Master data collection methods including survey design, interview protocols, observation techniques, and measurement instruments</p><h1>Data Collection Skill</h1>
<h2>When to Use This Skill</h2>
<p>Use this skill when you need to:</p>
<ul><li>Design surveys and questionnaires</li><li>Create interview protocols</li><li>Plan observation studies</li><li>Develop measurement instruments</li><li>Ensure data quality</li><li>Train data collectors</li><li>Manage fieldwork</li><li>Handle missing data and errors</li></ul>
<h2>Core Collection Methods</h2>
<h3>1. Survey Design</h3>
<p><strong>Survey Construction Framework</strong>:</p>
<pre><code class="lang-python">from dataclasses import dataclass
from typing import List, Optional, Dict
from enum import Enum
class QuestionType(Enum):
LIKERT = &quot;likert&quot;
MULTIPLE_CHOICE = &quot;multiple_choice&quot;
OPEN_ENDED = &quot;open_ended&quot;
RANKING = &quot;ranking&quot;
SEMANTIC_DIFFERENTIAL = &quot;semantic_differential&quot;
MATRIX = &quot;matrix&quot;
@dataclass
class SurveyQuestion:
&quot;&quot;&quot;Define a survey question&quot;&quot;&quot;
id: str
text: str
type: QuestionType
required: bool
options: Optional[List[str]] = None
scale_range: Optional[tuple] = None
scale_labels: Optional[Dict[int, str]] = None
validation: Optional[str] = None
skip_logic: Optional[Dict] = None
class SurveyInstrument:
&quot;&quot;&quot;Build and validate survey instrument&quot;&quot;&quot;
def __init__(self, title: str, instructions: str):
self.title = title
self.instructions = instructions
self.sections = {}
self.current_section = None
def add_section(self, section_name: str, description: str):
&quot;&quot;&quot;Add survey section&quot;&quot;&quot;
self.sections[section_name] = {
&#x27;description&#x27;: description,
&#x27;questions&#x27;: []
}
self.current_section = section_name
def add_question(self, question: SurveyQuestion):
&quot;&quot;&quot;Add question to current section&quot;&quot;&quot;
if self.current_section is None:
raise ValueError(&quot;Must create section before adding questions&quot;)
self.sections[self.current_section][&#x27;questions&#x27;].append(question)
def validate_survey(self):
&quot;&quot;&quot;Check survey for common issues&quot;&quot;&quot;
issues = []
for section_name, section in self.sections.items():
questions = section[&#x27;questions&#x27;]
# Check question count
if len(questions) &gt; 20:
issues.append(f&quot;Section &#x27;{section_name}&#x27; has {len(questions)} &quot;
&quot;questions (consider splitting)&quot;)
for q in questions:
# Check question text length
if len(q.text) &gt; 150:
issues.append(f&quot;Question {q.id} is very long &quot;
f&quot;({len(q.text)} chars)&quot;)
# Check Likert scale has odd number of points
if q.type == QuestionType.LIKERT and q.scale_range:
n_points = q.scale_range[1] - q.scale_range[0] + 1
if n_points % 2 == 0:
issues.append(f&quot;Question {q.id}: Even-numbered Likert &quot;
&quot;scale (consider odd for neutral midpoint)&quot;)
# Check multiple choice has reasonable number of options
if q.type == QuestionType.MULTIPLE_CHOICE and q.options:
if len(q.options) &gt; 7:
issues.append(f&quot;Question {q.id}: Too many options &quot;
f&quot;({len(q.options)})&quot;)
return issues
def generate_survey_markdown(self):
&quot;&quot;&quot;Generate human-readable survey&quot;&quot;&quot;
output = f&quot;# {self.title}\n\n&quot;
output += f&quot;{self.instructions}\n\n&quot;
for section_name, section in self.sections.items():
output += f&quot;## {section_name}\n&quot;
output += f&quot;*{section[&#x27;description&#x27;]}*\n\n&quot;
for q in section[&#x27;questions&#x27;]:
output += f&quot;**{q.id}.** {q.text}&quot;
if q.required:
output += &quot; *&quot;
output += &quot;\n\n&quot;
if q.type == QuestionType.LIKERT:
output += f&quot;Scale: {q.scale_range[0]} to {q.scale_range[1]}\n&quot;
if q.scale_labels:
for val, label in q.scale_labels.items():
output += f&quot;- {val}: {label}\n&quot;
elif q.type == QuestionType.MULTIPLE_CHOICE:
for i, opt in enumerate(q.options, 1):
output += f&quot;- [ ] {opt}\n&quot;
elif q.type == QuestionType.OPEN_ENDED:
output += &quot;_&quot; * 50 + &quot;\n&quot;
output += &quot;\n&quot;
output += &quot;\n*Required questions marked with *\n&quot;
return output
# Example survey
survey = SurveyInstrument(
title=&quot;Remote Work Experience Survey&quot;,
instructions=&quot;This survey takes approximately 10 minutes. &quot;
&quot;Your responses are confidential.&quot;
)
survey.add_section(&quot;Background&quot;, &quot;Tell us about your work situation&quot;)
survey.add_question(SurveyQuestion(
id=&quot;Q1&quot;,
text=&quot;How long have you been working remotely?&quot;,
type=QuestionType.MULTIPLE_CHOICE,
required=True,
options=[
&quot;Less than 6 months&quot;,
&quot;6-12 months&quot;,
&quot;1-2 years&quot;,
&quot;More than 2 years&quot;
]
))
survey.add_section(&quot;Work-Life Balance&quot;, &quot;Rate your agreement with these statements&quot;)
survey.add_question(SurveyQuestion(
id=&quot;Q2&quot;,
text=&quot;I can easily separate work time from personal time&quot;,
type=QuestionType.LIKERT,
required=True,
scale_range=(1, 5),
scale_labels={
1: &quot;Strongly Disagree&quot;,
3: &quot;Neutral&quot;,
5: &quot;Strongly Agree&quot;
}
))
# Validate and generate
issues = survey.validate_survey()
if issues:
print(&quot;Survey Issues:&quot;)
for issue in issues:
print(f&quot;- {issue}&quot;)
print(survey.generate_survey_markdown())</code></pre>
<h3>2. Interview Protocols</h3>
<p><strong>Structured Interview Framework</strong>:</p>
<pre><code class="lang-python">from dataclasses import dataclass
from typing import List, Dict
import json
@dataclass
class InterviewQuestion:
&quot;&quot;&quot;Define interview question with probes&quot;&quot;&quot;
question: str
purpose: str
probes: List[str]
max_time_minutes: int
notes_to_interviewer: str = &quot;&quot;
class InterviewProtocol:
&quot;&quot;&quot;Create comprehensive interview protocol&quot;&quot;&quot;
def __init__(self, research_aim: str, duration_minutes: int):
self.aim = research_aim
self.duration = duration_minutes
self.opening = None
self.questions = []
self.closing = None
self.training_notes = []
def set_opening(self, script: str):
&quot;&quot;&quot;Set opening script&quot;&quot;&quot;
self.opening = script
def add_question(self, question: InterviewQuestion):
&quot;&quot;&quot;Add interview question&quot;&quot;&quot;
self.questions.append(question)
def set_closing(self, script: str):
&quot;&quot;&quot;Set closing script&quot;&quot;&quot;
self.closing = script
def add_training_note(self, note: str):
&quot;&quot;&quot;Add note for interviewer training&quot;&quot;&quot;
self.training_notes.append(note)
def check_timing(self):
&quot;&quot;&quot;Verify questions fit in time allotted&quot;&quot;&quot;
total_time = sum(q.max_time_minutes for q in self.questions)
overhead = 10 # Opening, closing, buffer
if total_time + overhead &gt; self.duration:
return {
&#x27;fits&#x27;: False,
&#x27;planned&#x27;: total_time + overhead,
&#x27;available&#x27;: self.duration,
&#x27;overage&#x27;: (total_time + overhead) - self.duration
}
return {
&#x27;fits&#x27;: True,
&#x27;planned&#x27;: total_time + overhead,
&#x27;available&#x27;: self.duration,
&#x27;buffer&#x27;: self.duration - (total_time + overhead)
}
def generate_protocol_document(self):
&quot;&quot;&quot;Generate complete protocol document&quot;&quot;&quot;
doc = f&quot;&quot;&quot;
# Interview Protocol
## Research Aim
{self.aim}
## Duration
{self.duration} minutes
## Opening Script ({len(self.opening.split())*0.4:.0f} seconds estimated)
{self.opening}
## Interview Questions
&quot;&quot;&quot;
for i, q in enumerate(self.questions, 1):
doc += f&quot;### Question {i} ({q.max_time_minutes} minutes max)\n\n&quot;
doc += f&quot;**Question**: {q.question}\n\n&quot;
doc += f&quot;**Purpose**: {q.purpose}\n\n&quot;
doc += &quot;**Probes**:\n&quot;
for probe in q.probes:
doc += f&quot;- {probe}\n&quot;
if q.notes_to_interviewer:
doc += f&quot;\n**Interviewer Notes**: {q.notes_to_interviewer}\n&quot;
doc += &quot;\n&quot;
doc += f&quot;## Closing Script\n{self.closing}\n\n&quot;
if self.training_notes:
doc += &quot;## Interviewer Training Notes\n\n&quot;
for note in self.training_notes:
doc += f&quot;- {note}\n&quot;
# Add timing check
timing = self.check_timing()
doc += f&quot;\n## Timing Analysis\n&quot;
doc += f&quot;- Planned time: {timing[&#x27;planned&#x27;]} minutes\n&quot;
doc += f&quot;- Available time: {timing[&#x27;available&#x27;]} minutes\n&quot;
if timing[&#x27;fits&#x27;]:
doc += f&quot;- Buffer: {timing[&#x27;buffer&#x27;]} minutes\n&quot;
else:
doc += f&quot;- **WARNING: Over by {timing[&#x27;overage&#x27;]} minutes**\n&quot;
return doc
def create_interview_log(self):
&quot;&quot;&quot;Create interview tracking log&quot;&quot;&quot;
log = {
&#x27;interviewer&#x27;: &#x27;&#x27;,
&#x27;participant_id&#x27;: &#x27;&#x27;,
&#x27;date&#x27;: &#x27;&#x27;,
&#x27;start_time&#x27;: &#x27;&#x27;,
&#x27;end_time&#x27;: &#x27;&#x27;,
&#x27;location&#x27;: &#x27;&#x27;,
&#x27;recording&#x27;: {&#x27;audio&#x27;: False, &#x27;video&#x27;: False},
&#x27;consent_obtained&#x27;: False,
&#x27;questions_completed&#x27;: {f&quot;Q{i+1}&quot;: False
for i in range(len(self.questions))},
&#x27;technical_issues&#x27;: [],
&#x27;notes&#x27;: &#x27;&#x27;,
&#x27;transcription_status&#x27;: &#x27;pending&#x27;
}
return log
# Example protocol
protocol = InterviewProtocol(
research_aim=&quot;Understand how remote workers maintain work-life boundaries&quot;,
duration_minutes=60
)
protocol.set_opening(&quot;&quot;&quot;
Thank you for participating in this study. This interview will take about 60 minutes.
I&#x27;ll be asking you about your experiences with remote work and work-life balance.
Please answer openly - there are no right or wrong answers. Everything you share
will be kept confidential and your name will not appear in any reports.
Do I have your permission to audio record this interview? You can ask me to
stop recording at any time.
[Start recording]
Do you have any questions before we begin?
&quot;&quot;&quot;)
protocol.add_question(InterviewQuestion(
question=&quot;Can you walk me through a typical workday? Start from when you wake up.&quot;,
purpose=&quot;Understand daily routines and work patterns&quot;,
probes=[
&quot;What time do you usually start work?&quot;,
&quot;Where do you physically work?&quot;,
&quot;How do you transition into &#x27;work mode&#x27;?&quot;,
&quot;When do you typically finish?&quot;,
&quot;How do you signal to yourself and others that work is done?&quot;
],
max_time_minutes=10,
notes_to_interviewer=&quot;Listen for spatial, temporal, and social boundaries&quot;
))
protocol.add_question(InterviewQuestion(
question=&quot;Tell me about a time when work and personal life collided. What happened?&quot;,
purpose=&quot;Elicit specific boundary violations and coping strategies&quot;,
probes=[
&quot;How did you feel in that moment?&quot;,
&quot;What did you do?&quot;,
&quot;Looking back, what would you do differently?&quot;,
&quot;Has this happened more than once?&quot;
],
max_time_minutes=15,
notes_to_interviewer=&quot;Critical incident technique - get detailed narrative&quot;
))
protocol.set_closing(&quot;&quot;&quot;
Those are all my questions. Is there anything else you&#x27;d like to share about
your remote work experience that we didn&#x27;t cover?
[Answer]
Thank you so much for your time and insights. Your participation is really valuable.
As a reminder, everything you&#x27;ve shared is confidential. I&#x27;ll send you a summary
of the findings once the study is complete, if you&#x27;re interested.
[Stop recording]
&quot;&quot;&quot;)
protocol.add_training_note(&quot;Use active listening - paraphrase to confirm understanding&quot;)
protocol.add_training_note(&quot;Embrace silence - give participants time to think&quot;)
protocol.add_training_note(&quot;Follow participant&#x27;s lead when they share something unexpected&quot;)
print(protocol.generate_protocol_document())</code></pre>
<h3>3. Observation Methods</h3>
<p><strong>Observation Protocol</strong>:</p>
<pre><code class="lang-python">from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional
from enum import Enum
class ObservationType(Enum):
PARTICIPANT = &quot;participant&quot;
NON_PARTICIPANT = &quot;non_participant&quot;
STRUCTURED = &quot;structured&quot;
UNSTRUCTURED = &quot;unstructured&quot;
@dataclass
class ObservationCategory:
&quot;&quot;&quot;Define what to observe&quot;&quot;&quot;
category: str
description: str
indicators: List[str]
recording_method: str # &#x27;checklist&#x27;, &#x27;frequency&#x27;, &#x27;narrative&#x27;, &#x27;time_sample&#x27;
class ObservationProtocol:
&quot;&quot;&quot;Design observation study&quot;&quot;&quot;
def __init__(self, observation_type: ObservationType,
setting: str, duration_minutes: int):
self.type = observation_type
self.setting = setting
self.duration = duration_minutes
self.categories = []
self.sampling_strategy = None
def add_category(self, category: ObservationCategory):
&quot;&quot;&quot;Add observation category&quot;&quot;&quot;
self.categories.append(category)
def set_sampling_strategy(self, strategy: str, interval: Optional[int] = None):
&quot;&quot;&quot;Define time sampling strategy
Args:
strategy: &#x27;continuous&#x27;, &#x27;time_sampling&#x27;, &#x27;event_sampling&#x27;
interval: For time_sampling, seconds between observations
&quot;&quot;&quot;
self.sampling_strategy = {
&#x27;strategy&#x27;: strategy,
&#x27;interval&#x27;: interval
}
def create_observation_sheet(self):
&quot;&quot;&quot;Generate observation recording sheet&quot;&quot;&quot;
sheet = f&quot;&quot;&quot;
# Observation Recording Sheet
**Observer**: _______________ **Date**: _______________
**Setting**: {self.setting}
**Start Time**: _______________ **End Time**: _______________
**Observation Type**: {self.type.value}
---
&quot;&quot;&quot;
for i, cat in enumerate(self.categories, 1):
sheet += f&quot;## {i}. {cat.category}\n&quot;
sheet += f&quot;*{cat.description}*\n\n&quot;
if cat.recording_method == &#x27;checklist&#x27;:
sheet += &quot;**Indicators** (check if observed):\n&quot;
for indicator in cat.indicators:
sheet += f&quot;- [ ] {indicator}\n&quot;
elif cat.recording_method == &#x27;frequency&#x27;:
sheet += &quot;**Frequency Count**:\n&quot;
for indicator in cat.indicators:
sheet += f&quot;- {indicator}: _____\n&quot;
elif cat.recording_method == &#x27;time_sample&#x27;:
sheet += &quot;**Time Samples** (mark X if present):\n&quot;
sheet += &quot;| Indicator | &quot;
sheet += &quot; | &quot;.join([f&quot;T{i}&quot; for i in range(1, 11)])
sheet += &quot; |\n&quot;
sheet += &quot;| --- | &quot; + &quot; | &quot;.join([&quot;---&quot;]*10) + &quot; |\n&quot;
for indicator in cat.indicators:
sheet += f&quot;| {indicator} | &quot; + &quot; | &quot;.join([&quot; &quot;]*10) + &quot; |\n&quot;
else: # narrative
sheet += &quot;**Notes**:\n&quot;
sheet += &quot;_&quot; * 60 + &quot;\n&quot;
sheet += &quot;_&quot; * 60 + &quot;\n&quot;
sheet += &quot;\n&quot;
sheet += &quot;&quot;&quot;
---
## Field Notes
[Record contextual details, observer reflections, questions]
&quot;&quot;&quot;
return sheet
def create_field_notes_template(self):
&quot;&quot;&quot;Generate field notes template&quot;&quot;&quot;
template = &quot;&quot;&quot;
# Field Notes Template
## Descriptive Notes
[What did you observe? Be detailed and concrete]
- Physical setting:
- Participants:
- Activities:
- Interactions:
- Temporal flow:
## Reflective Notes
[Your thoughts, feelings, questions, hunches]
- Initial impressions:
- Surprises:
- Patterns emerging:
- Questions raised:
## Methodological Notes
[Notes about the research process]
- What worked well:
- Challenges:
- Adjustments needed:
- Observer effect concerns:
## Analytical Notes
[Preliminary analysis and connections]
- Themes:
- Connections to theory:
- Ideas for follow-up:
&quot;&quot;&quot;
return template
# Example observation protocol
obs_protocol = ObservationProtocol(
observation_type=ObservationType.NON_PARTICIPANT,
setting=&quot;Open office workspace&quot;,
duration_minutes=120
)
obs_protocol.add_category(ObservationCategory(
category=&quot;Collaboration Behaviors&quot;,
description=&quot;Spontaneous interactions between coworkers&quot;,
indicators=[
&quot;Verbal questions/requests&quot;,
&quot;Screen sharing&quot;,
&quot;Walking to colleague&#x27;s desk&quot;,
&quot;Impromptu meetings&quot;,
&quot;Shared problem-solving&quot;
],
recording_method=&#x27;frequency&#x27;
))
obs_protocol.add_category(ObservationCategory(
category=&quot;Focus Behaviors&quot;,
description=&quot;Individual concentrated work&quot;,
indicators=[
&quot;Headphones on&quot;,
&quot;Do not disturb sign&quot;,
&quot;Working at desk alone&quot;,
&quot;Note-taking&quot;
],
recording_method=&#x27;time_sample&#x27;
))
obs_protocol.set_sampling_strategy(&#x27;time_sampling&#x27;, interval=600) # Every 10 min
print(obs_protocol.create_observation_sheet())</code></pre>
<h3>4. Data Quality Assurance</h3>
<p><strong>Quality Control Framework</strong>:</p>
<pre><code class="lang-python">import pandas as pd
import numpy as np
from typing import List, Dict
class DataQualityControl:
&quot;&quot;&quot;Implement data quality checks&quot;&quot;&quot;
def __init__(self, data: pd.DataFrame):
self.data = data
self.issues = []
def check_completeness(self, required_vars: List[str]):
&quot;&quot;&quot;Check for missing data&quot;&quot;&quot;
for var in required_vars:
if var in self.data.columns:
missing_n = self.data[var].isna().sum()
missing_pct = (missing_n / len(self.data)) * 100
if missing_pct &gt; 5:
self.issues.append({
&#x27;type&#x27;: &#x27;completeness&#x27;,
&#x27;variable&#x27;: var,
&#x27;issue&#x27;: f&#x27;{missing_pct:.1f}% missing&#x27;,
&#x27;severity&#x27;: &#x27;high&#x27; if missing_pct &gt; 20 else &#x27;medium&#x27;
})
def check_range(self, var: str, expected_range: tuple):
&quot;&quot;&quot;Check values are in expected range&quot;&quot;&quot;
if var in self.data.columns:
out_of_range = (
(self.data[var] &lt; expected_range[0]) |
(self.data[var] &gt; expected_range[1])
).sum()
if out_of_range &gt; 0:
self.issues.append({
&#x27;type&#x27;: &#x27;range&#x27;,
&#x27;variable&#x27;: var,
&#x27;issue&#x27;: f&#x27;{out_of_range} values out of range &#x27;
f&#x27;{expected_range}&#x27;,
&#x27;severity&#x27;: &#x27;high&#x27;
})
def check_consistency(self, var1: str, var2: str, rule: str):
&quot;&quot;&quot;Check logical consistency between variables&quot;&quot;&quot;
if var1 in self.data.columns and var2 in self.data.columns:
# Example: age should be &lt;= years_experience + 18
inconsistent = 0
if rule == &#x27;age_gt_experience&#x27;:
inconsistent = (
self.data[var1] &lt; self.data[var2] + 18
).sum()
if inconsistent &gt; 0:
self.issues.append({
&#x27;type&#x27;: &#x27;consistency&#x27;,
&#x27;variable&#x27;: f&#x27;{var1}, {var2}&#x27;,
&#x27;issue&#x27;: f&#x27;{inconsistent} logically inconsistent values&#x27;,
&#x27;severity&#x27;: &#x27;medium&#x27;
})
def check_duplicates(self, id_var: str):
&quot;&quot;&quot;Check for duplicate records&quot;&quot;&quot;
duplicates = self.data[id_var].duplicated().sum()
if duplicates &gt; 0:
self.issues.append({
&#x27;type&#x27;: &#x27;duplicates&#x27;,
&#x27;variable&#x27;: id_var,
&#x27;issue&#x27;: f&#x27;{duplicates} duplicate IDs&#x27;,
&#x27;severity&#x27;: &#x27;high&#x27;
})
def check_outliers(self, var: str, method: str = &#x27;iqr&#x27;):
&quot;&quot;&quot;Detect outliers&quot;&quot;&quot;
if var in self.data.columns:
if method == &#x27;iqr&#x27;:
Q1 = self.data[var].quantile(0.25)
Q3 = self.data[var].quantile(0.75)
IQR = Q3 - Q1
outliers = (
(self.data[var] &lt; Q1 - 3 * IQR) |
(self.data[var] &gt; Q3 + 3 * IQR)
).sum()
if outliers &gt; 0:
self.issues.append({
&#x27;type&#x27;: &#x27;outliers&#x27;,
&#x27;variable&#x27;: var,
&#x27;issue&#x27;: f&#x27;{outliers} extreme outliers detected&#x27;,
&#x27;severity&#x27;: &#x27;low&#x27;
})
def generate_quality_report(self):
&quot;&quot;&quot;Create data quality report&quot;&quot;&quot;
report = &quot;# Data Quality Report\n\n&quot;
report += f&quot;Dataset: {len(self.data)} records, &quot;
report += f&quot;{len(self.data.columns)} variables\n\n&quot;
if not self.issues:
report += &quot;No quality issues detected.\n&quot;
else:
report += f&quot;## Issues Detected: {len(self.issues)}\n\n&quot;
high = [i for i in self.issues if i[&#x27;severity&#x27;] == &#x27;high&#x27;]
medium = [i for i in self.issues if i[&#x27;severity&#x27;] == &#x27;medium&#x27;]
low = [i for i in self.issues if i[&#x27;severity&#x27;] == &#x27;low&#x27;]
if high:
report += &quot;### High Severity\n&quot;
for issue in high:
report += f&quot;- **{issue[&#x27;type&#x27;].title()}** &quot;
report += f&quot;in {issue[&#x27;variable&#x27;]}: {issue[&#x27;issue&#x27;]}\n&quot;
report += &quot;\n&quot;
if medium:
report += &quot;### Medium Severity\n&quot;
for issue in medium:
report += f&quot;- **{issue[&#x27;type&#x27;].title()}** &quot;
report += f&quot;in {issue[&#x27;variable&#x27;]}: {issue[&#x27;issue&#x27;]}\n&quot;
report += &quot;\n&quot;
if low:
report += &quot;### Low Severity\n&quot;
for issue in low:
report += f&quot;- **{issue[&#x27;type&#x27;].title()}** &quot;
report += f&quot;in {issue[&#x27;variable&#x27;]}: {issue[&#x27;issue&#x27;]}\n&quot;
return report
# Example
sample_data = pd.DataFrame({
&#x27;id&#x27;: [1, 2, 3, 4, 5, 2], # Duplicate
&#x27;age&#x27;: [25, 35, 150, 45, np.nan, 30], # Out of range, missing
&#x27;satisfaction&#x27;: [4, 5, 3, 4, 2, 5]
})
qc = DataQualityControl(sample_data)
qc.check_completeness([&#x27;age&#x27;, &#x27;satisfaction&#x27;])
qc.check_range(&#x27;age&#x27;, (18, 100))
qc.check_duplicates(&#x27;id&#x27;)
print(qc.generate_quality_report())</code></pre>
<h2>Best Practices</h2>
<h3>1. Survey Design</h3>
<ul><li>Keep surveys as short as possible</li><li>Use clear, simple language</li><li>Avoid leading questions</li><li>Use validated scales when available</li><li>Pilot test with target population</li><li>Provide progress indicators</li><li>Test on mobile devices</li></ul>
<h3>2. Interview Execution</h3>
<ul><li>Build rapport before deep questions</li><li>Use active listening techniques</li><li>Allow silence for thinking</li><li>Be flexible with order</li><li>Probe interesting responses</li><li>Record with permission</li><li>Transcribe promptly</li></ul>
<h3>3. Observation Methods</h3>
<ul><li>Be systematic and consistent</li><li>Record field notes immediately</li><li>Note your potential biases</li><li>Consider observer effects</li><li>Use multiple observers when possible</li><li>Triangulate with other methods</li><li>Distinguish description from interpretation</li></ul>
<h3>4. Data Quality</h3>
<ul><li>Check data immediately after collection</li><li>Double-enter critical data</li><li>Use validation rules in forms</li><li>Train data collectors thoroughly</li><li>Conduct inter-rater reliability checks</li><li>Document all quality issues</li><li>Create data cleaning log</li></ul>
<h2>Related Skills</h2>
<ul><li><strong>research-design</strong>: Planning data collection</li><li><strong>quantitative-methods</strong>: Quantitative data collection</li><li><strong>qualitative-methods</strong>: Qualitative data collection</li><li><strong>data-analysis</strong>: Using collected data</li><li><strong>research-writing</strong>: Reporting collection methods</li></ul>
<h2>Quick Reference</h2>
<h3>Survey Length Guidelines</h3>
<pre><code>Email survey: 5-7 minutes (10-15 questions)
Phone survey: 10-15 minutes
In-person: 20-30 minutes
Longitudinal: Shorter for repeated measures</code></pre>
<h3>Interview Durations</h3>
<pre><code>Brief interview: 15-30 minutes
Standard: 45-60 minutes
In-depth: 90-120 minutes
Life history: Multiple sessions</code></pre>
<h3>Response Rate Improvement</h3>
<pre><code>✓ Personalized invitations
✓ Multiple contact attempts
✓ Incentives (when appropriate)
✓ Clear purpose and benefit
✓ Convenient timing
✓ Follow-up reminders
✓ Mobile-friendly format</code></pre>
<footer>
<div class="fmap">
<div><b>Build</b>
<a href="https://hanzo.app">hanzo.app</a> app builder
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
<div><b>Run</b>
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
<div><b>Account</b>
<a href="https://hanzo.id">hanzo.id</a> sign in
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
<div><b>Company</b>
<a href="https://hanzo.ai">hanzo.ai</a> canonical
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
</div>
<div class="fend"><a href="/research-data-collection.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
</footer>
</div></body></html>