mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
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]>
774 lines
35 KiB
HTML
774 lines
35 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>research-qualitative-methods</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-qualitative-methods.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/research-qualitative-methods">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/research-qualitative-methods.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-qualitative-methods</h1><p class="lede">Master qualitative research methods including interviews, ethnography, case studies, grounded theory, and thematic analysis</p><h1>Qualitative Research Methods Skill</h1>
|
|
<h2>When to Use This Skill</h2>
|
|
<p>Use this skill when you need to:</p>
|
|
<ul><li>Explore phenomena in depth</li><li>Understand lived experiences and meanings</li><li>Generate theory from data</li><li>Study context and complexity</li><li>Investigate "how" and "why" questions</li><li>Capture participant perspectives</li><li>Analyze textual or visual data</li><li>Conduct case studies or ethnographic research</li></ul>
|
|
<h2>Core Qualitative Approaches</h2>
|
|
<h3>1. In-Depth Interviews</h3>
|
|
<p><strong>Purpose</strong>: Explore individual perspectives and experiences</p>
|
|
<p><strong>Interview Protocol Template</strong>:</p>
|
|
<pre><code class="lang-python">from dataclasses import dataclass
|
|
from typing import List, Optional
|
|
from datetime import datetime
|
|
|
|
@dataclass
|
|
class InterviewProtocol:
|
|
"""Structure for interview guide"""
|
|
research_question: str
|
|
introduction: str
|
|
opening_questions: List[str]
|
|
main_questions: List[str]
|
|
probes: dict # question -> list of probes
|
|
closing_questions: List[str]
|
|
estimated_duration: int # minutes
|
|
|
|
def generate_guide(self):
|
|
"""Generate formatted interview guide"""
|
|
guide = f"""
|
|
# Interview Guide
|
|
|
|
## Research Question
|
|
{self.research_question}
|
|
|
|
## Introduction ({estimated_duration} minutes)
|
|
{self.introduction}
|
|
|
|
## Opening Questions (5-10 minutes)
|
|
"""
|
|
for i, q in enumerate(self.opening_questions, 1):
|
|
guide += f"{i}. {q}\n"
|
|
|
|
guide += "\n## Main Questions (30-40 minutes)\n"
|
|
for i, q in enumerate(self.main_questions, 1):
|
|
guide += f"{i}. {q}\n"
|
|
if q in self.probes:
|
|
for probe in self.probes[q]:
|
|
guide += f" - Probe: {probe}\n"
|
|
|
|
guide += "\n## Closing Questions (5-10 minutes)\n"
|
|
for i, q in enumerate(self.closing_questions, 1):
|
|
guide += f"{i}. {q}\n"
|
|
|
|
return guide
|
|
|
|
# Example protocol
|
|
protocol = InterviewProtocol(
|
|
research_question="How do remote workers maintain work-life balance?",
|
|
introduction="""
|
|
Thank you for participating. This interview will take about 60 minutes.
|
|
I'm interested in understanding your experiences with remote work.
|
|
There are no right or wrong answers. Everything you share will be kept
|
|
confidential. Do you have any questions before we begin?
|
|
""",
|
|
opening_questions=[
|
|
"Can you tell me about your current remote work situation?",
|
|
"How long have you been working remotely?"
|
|
],
|
|
main_questions=[
|
|
"Walk me through a typical workday. What does it look like?",
|
|
"How do you separate work time from personal time?",
|
|
"What challenges have you faced with work-life balance?",
|
|
"What strategies have you found helpful?"
|
|
],
|
|
probes={
|
|
"Walk me through a typical workday. What does it look like?": [
|
|
"What time do you typically start?",
|
|
"How do you structure your day?",
|
|
"Where do you work from?"
|
|
],
|
|
"What challenges have you faced with work-life balance?": [
|
|
"Can you give me a specific example?",
|
|
"How did that make you feel?",
|
|
"What did you do about it?"
|
|
]
|
|
},
|
|
closing_questions=[
|
|
"Is there anything else you'd like to share?",
|
|
"What advice would you give to new remote workers?"
|
|
],
|
|
estimated_duration=60
|
|
)
|
|
|
|
print(protocol.generate_guide())</code></pre>
|
|
<h3>2. Thematic Analysis</h3>
|
|
<p><strong>Purpose</strong>: Identify patterns and themes in qualitative data</p>
|
|
<p><strong>Six-Phase Process</strong>:</p>
|
|
<pre><code class="lang-python">import pandas as pd
|
|
from collections import defaultdict
|
|
from typing import List, Dict, Set
|
|
|
|
class ThematicAnalysis:
|
|
"""Conduct rigorous thematic analysis"""
|
|
|
|
def __init__(self):
|
|
self.transcripts = {}
|
|
self.codes = defaultdict(list)
|
|
self.themes = {}
|
|
self.codebook = {}
|
|
|
|
# Phase 1: Familiarization
|
|
def add_transcript(self, participant_id: str, text: str):
|
|
"""Add transcript and initial notes"""
|
|
self.transcripts[participant_id] = {
|
|
'text': text,
|
|
'initial_notes': []
|
|
}
|
|
|
|
def add_initial_note(self, participant_id: str, note: str):
|
|
"""Record initial observations"""
|
|
self.transcripts[participant_id]['initial_notes'].append(note)
|
|
|
|
# Phase 2: Generate initial codes
|
|
def code_segment(self, participant_id: str, segment: str,
|
|
code: str, line_numbers: tuple):
|
|
"""Apply code to text segment"""
|
|
self.codes[code].append({
|
|
'participant': participant_id,
|
|
'segment': segment,
|
|
'lines': line_numbers
|
|
})
|
|
|
|
def get_code_frequency(self):
|
|
"""Count code applications"""
|
|
return {code: len(instances)
|
|
for code, instances in self.codes.items()}
|
|
|
|
# Phase 3: Search for themes
|
|
def create_theme(self, theme_name: str, codes: List[str],
|
|
description: str):
|
|
"""Group codes into themes"""
|
|
self.themes[theme_name] = {
|
|
'codes': codes,
|
|
'description': description,
|
|
'subthemes': []
|
|
}
|
|
|
|
def add_subtheme(self, theme_name: str, subtheme_name: str,
|
|
codes: List[str]):
|
|
"""Add subtheme to existing theme"""
|
|
self.themes[theme_name]['subthemes'].append({
|
|
'name': subtheme_name,
|
|
'codes': codes
|
|
})
|
|
|
|
# Phase 4: Review themes
|
|
def get_theme_excerpts(self, theme_name: str):
|
|
"""Extract all coded excerpts for a theme"""
|
|
excerpts = []
|
|
theme = self.themes[theme_name]
|
|
|
|
for code in theme['codes']:
|
|
if code in self.codes:
|
|
excerpts.extend(self.codes[code])
|
|
|
|
return excerpts
|
|
|
|
def check_theme_coherence(self, theme_name: str):
|
|
"""Assess internal homogeneity of theme"""
|
|
excerpts = self.get_theme_excerpts(theme_name)
|
|
|
|
report = {
|
|
'theme': theme_name,
|
|
'n_excerpts': len(excerpts),
|
|
'n_participants': len(set(e['participant'] for e in excerpts)),
|
|
'codes': self.themes[theme_name]['codes'],
|
|
'excerpts_sample': excerpts[:5] # First 5 for review
|
|
}
|
|
|
|
return report
|
|
|
|
# Phase 5: Define and name themes
|
|
def define_theme(self, theme_name: str, definition: str,
|
|
essence: str):
|
|
"""Provide clear theme definition"""
|
|
self.themes[theme_name]['definition'] = definition
|
|
self.themes[theme_name]['essence'] = essence
|
|
|
|
# Phase 6: Produce report
|
|
def generate_codebook(self):
|
|
"""Create detailed codebook"""
|
|
codebook = []
|
|
|
|
for theme_name, theme_data in self.themes.items():
|
|
entry = {
|
|
'Theme': theme_name,
|
|
'Definition': theme_data.get('definition', ''),
|
|
'Codes': ', '.join(theme_data['codes']),
|
|
'N_Excerpts': len(self.get_theme_excerpts(theme_name))
|
|
}
|
|
codebook.append(entry)
|
|
|
|
return pd.DataFrame(codebook)
|
|
|
|
def generate_theme_report(self):
|
|
"""Generate thematic analysis report"""
|
|
report = "# Thematic Analysis Report\n\n"
|
|
report += f"Total Participants: {len(self.transcripts)}\n"
|
|
report += f"Total Codes: {len(self.codes)}\n"
|
|
report += f"Total Themes: {len(self.themes)}\n\n"
|
|
|
|
for theme_name, theme_data in self.themes.items():
|
|
report += f"## Theme: {theme_name}\n\n"
|
|
report += f"**Definition**: {theme_data.get('definition', 'N/A')}\n\n"
|
|
report += f"**Essence**: {theme_data.get('essence', 'N/A')}\n\n"
|
|
report += f"**Codes**: {', '.join(theme_data['codes'])}\n\n"
|
|
|
|
excerpts = self.get_theme_excerpts(theme_name)
|
|
report += f"**Prevalence**: {len(excerpts)} coded segments "
|
|
report += f"across {len(set(e['participant'] for e in excerpts))} participants\n\n"
|
|
|
|
# Sample excerpts
|
|
report += "**Representative Excerpts**:\n\n"
|
|
for i, excerpt in enumerate(excerpts[:3], 1):
|
|
report += f"{i}. *{excerpt['participant']}*: "
|
|
report += f'"{excerpt["segment"]}"\n\n'
|
|
|
|
# Subthemes
|
|
if theme_data.get('subthemes'):
|
|
report += "**Subthemes**:\n\n"
|
|
for subtheme in theme_data['subthemes']:
|
|
report += f"- *{subtheme['name']}*: "
|
|
report += f"{', '.join(subtheme['codes'])}\n"
|
|
report += "\n"
|
|
|
|
return report
|
|
|
|
# Example usage
|
|
analysis = ThematicAnalysis()
|
|
|
|
# Add data
|
|
analysis.add_transcript('P001', "I find it hard to stop working...")
|
|
analysis.add_initial_note('P001', "Struggles with boundaries")
|
|
|
|
# Code data
|
|
analysis.code_segment('P001',
|
|
"I find it hard to stop working at 5pm",
|
|
'boundary_difficulty',
|
|
(23, 25))
|
|
analysis.code_segment('P001',
|
|
"My laptop is always open on the kitchen table",
|
|
'physical_workspace_integration',
|
|
(45, 47))
|
|
|
|
# Create themes
|
|
analysis.create_theme(
|
|
'Blurred Boundaries',
|
|
codes=['boundary_difficulty', 'work_intrusion', 'always_on'],
|
|
description='Difficulty maintaining clear work-life boundaries'
|
|
)
|
|
|
|
analysis.define_theme(
|
|
'Blurred Boundaries',
|
|
definition='The challenge of creating and maintaining separation between work and personal life in remote settings',
|
|
essence='Work and life become entangled'
|
|
)
|
|
|
|
# Generate report
|
|
print(analysis.generate_theme_report())</code></pre>
|
|
<h3>3. Grounded Theory</h3>
|
|
<p><strong>Purpose</strong>: Generate theory from data inductively</p>
|
|
<p><strong>Coding Approach</strong>:</p>
|
|
<pre><code class="lang-python">from dataclasses import dataclass
|
|
from typing import List, Optional, Dict
|
|
from enum import Enum
|
|
|
|
class CodingLevel(Enum):
|
|
OPEN = "open"
|
|
AXIAL = "axial"
|
|
SELECTIVE = "selective"
|
|
|
|
@dataclass
|
|
class GroundedTheoryCode:
|
|
"""Represent a grounded theory code"""
|
|
code: str
|
|
level: CodingLevel
|
|
definition: str
|
|
properties: List[str]
|
|
dimensions: Dict[str, tuple] # property -> (min, max) dimensions
|
|
memos: List[str]
|
|
examples: List[str]
|
|
|
|
class GroundedTheoryAnalysis:
|
|
"""Conduct grounded theory analysis"""
|
|
|
|
def __init__(self):
|
|
self.codes = {}
|
|
self.categories = {}
|
|
self.core_category = None
|
|
self.theoretical_memos = []
|
|
|
|
def open_coding(self, code_name: str, definition: str):
|
|
"""Initial open coding"""
|
|
self.codes[code_name] = GroundedTheoryCode(
|
|
code=code_name,
|
|
level=CodingLevel.OPEN,
|
|
definition=definition,
|
|
properties=[],
|
|
dimensions={},
|
|
memos=[],
|
|
examples=[]
|
|
)
|
|
|
|
def axial_coding(self, category_name: str, codes: List[str],
|
|
conditions: List[str], actions: List[str],
|
|
consequences: List[str]):
|
|
"""Relate categories to subcategories (paradigm model)"""
|
|
self.categories[category_name] = {
|
|
'codes': codes,
|
|
'conditions': conditions, # When/why
|
|
'actions_interactions': actions, # What strategies
|
|
'consequences': consequences, # With what results
|
|
'level': CodingLevel.AXIAL
|
|
}
|
|
|
|
def selective_coding(self, core_category: str, storyline: str):
|
|
"""Identify core category and integrate theory"""
|
|
self.core_category = {
|
|
'category': core_category,
|
|
'storyline': storyline,
|
|
'level': CodingLevel.SELECTIVE
|
|
}
|
|
|
|
def add_memo(self, memo: str, code: Optional[str] = None):
|
|
"""Write theoretical memo"""
|
|
if code and code in self.codes:
|
|
self.codes[code].memos.append(memo)
|
|
else:
|
|
self.theoretical_memos.append(memo)
|
|
|
|
def constant_comparison(self, code1: str, code2: str):
|
|
"""Compare two codes"""
|
|
c1 = self.codes.get(code1)
|
|
c2 = self.codes.get(code2)
|
|
|
|
if not c1 or not c2:
|
|
return "Code(s) not found"
|
|
|
|
comparison = f"## Constant Comparison: {code1} vs {code2}\n\n"
|
|
comparison += f"**{code1}**: {c1.definition}\n"
|
|
comparison += f"**{code2}**: {c2.definition}\n\n"
|
|
comparison += "**Similarities**:\n- [Identify similarities]\n\n"
|
|
comparison += "**Differences**:\n- [Identify differences]\n\n"
|
|
comparison += "**Theoretical Insight**:\n[What does this tell us?]\n"
|
|
|
|
return comparison
|
|
|
|
def theoretical_sampling_guide(self):
|
|
"""Generate guide for next theoretical sampling"""
|
|
guide = "# Theoretical Sampling Guide\n\n"
|
|
guide += "## Current Theory State\n"
|
|
if self.core_category:
|
|
guide += f"Core Category: {self.core_category['category']}\n"
|
|
guide += f"Storyline: {self.core_category['storyline']}\n\n"
|
|
|
|
guide += "## Gaps to Address\n"
|
|
guide += "1. [Identify underdeveloped categories]\n"
|
|
guide += "2. [Identify missing relationships]\n"
|
|
guide += "3. [Identify negative cases needed]\n\n"
|
|
|
|
guide += "## Next Sampling Criteria\n"
|
|
guide += "- Participants who... [specific characteristics]\n"
|
|
guide += "- Settings that... [specific conditions]\n"
|
|
guide += "- Events that... [specific situations]\n"
|
|
|
|
return guide
|
|
|
|
# Example
|
|
gt = GroundedTheoryAnalysis()
|
|
|
|
# Open coding
|
|
gt.open_coding('seeking_flexibility',
|
|
'Actions to gain control over work schedule and location')
|
|
gt.open_coding('managing_expectations',
|
|
'Negotiating others\' expectations about availability')
|
|
|
|
# Axial coding
|
|
gt.axial_coding(
|
|
category_name='Boundary Work',
|
|
codes=['seeking_flexibility', 'managing_expectations', 'creating_rituals'],
|
|
conditions=['Work from home', 'High autonomy', 'Family present'],
|
|
actions=['Set physical boundaries', 'Communicate availability', 'Use transitional rituals'],
|
|
consequences=['Reduced conflict', 'Better focus', 'Improved wellbeing']
|
|
)
|
|
|
|
# Selective coding
|
|
gt.selective_coding(
|
|
core_category='Continuous Boundary Negotiation',
|
|
storyline='Remote workers engage in ongoing negotiation of boundaries '
|
|
'between work and life, using spatial, temporal, and communicative '
|
|
'strategies to manage competing demands and maintain wellbeing.'
|
|
)
|
|
|
|
# Memos
|
|
gt.add_memo('Flexibility appears to be double-edged sword - enables control '
|
|
'but also creates expectation of constant availability',
|
|
code='seeking_flexibility')</code></pre>
|
|
<h3>4. Case Study Research</h3>
|
|
<p><strong>Purpose</strong>: In-depth examination of bounded system</p>
|
|
<p><strong>Case Study Protocol</strong>:</p>
|
|
<pre><code class="lang-python">from dataclasses import dataclass
|
|
from typing import List, Dict
|
|
from enum import Enum
|
|
|
|
class CaseType(Enum):
|
|
SINGLE = "single"
|
|
MULTIPLE = "multiple"
|
|
EMBEDDED = "embedded"
|
|
|
|
class DataSource(Enum):
|
|
INTERVIEW = "interview"
|
|
OBSERVATION = "observation"
|
|
DOCUMENT = "document"
|
|
ARTIFACT = "artifact"
|
|
ARCHIVAL = "archival"
|
|
|
|
@dataclass
|
|
class CaseStudyDesign:
|
|
"""Define case study parameters"""
|
|
case_type: CaseType
|
|
research_questions: List[str]
|
|
propositions: List[str]
|
|
units_of_analysis: str
|
|
case_selection_logic: str
|
|
data_sources: List[DataSource]
|
|
|
|
def generate_protocol(self):
|
|
"""Generate case study protocol"""
|
|
protocol = f"""
|
|
# Case Study Protocol
|
|
|
|
## Overview
|
|
Type: {self.case_type.value}
|
|
Unit of Analysis: {self.units_of_analysis}
|
|
|
|
## Research Questions
|
|
"""
|
|
for i, q in enumerate(self.research_questions, 1):
|
|
protocol += f"{i}. {q}\n"
|
|
|
|
protocol += "\n## Propositions\n"
|
|
for i, p in enumerate(self.propositions, 1):
|
|
protocol += f"{i}. {p}\n"
|
|
|
|
protocol += f"\n## Case Selection\n{self.case_selection_logic}\n"
|
|
|
|
protocol += "\n## Data Collection\n"
|
|
for source in self.data_sources:
|
|
protocol += f"- {source.value}\n"
|
|
|
|
return protocol
|
|
|
|
class CaseStudyDatabase:
|
|
"""Organize case study evidence"""
|
|
|
|
def __init__(self):
|
|
self.evidence = defaultdict(list)
|
|
self.chain_of_evidence = []
|
|
|
|
def add_evidence(self, source: DataSource, content: str,
|
|
date: str, related_rq: str):
|
|
"""Add piece of evidence"""
|
|
evidence_id = f"{source.value}_{len(self.evidence[source])}"
|
|
self.evidence[source].append({
|
|
'id': evidence_id,
|
|
'content': content,
|
|
'date': date,
|
|
'research_question': related_rq
|
|
})
|
|
return evidence_id
|
|
|
|
def link_evidence(self, evidence_ids: List[str], finding: str):
|
|
"""Create chain of evidence"""
|
|
self.chain_of_evidence.append({
|
|
'finding': finding,
|
|
'evidence': evidence_ids
|
|
})
|
|
|
|
def generate_evidence_table(self):
|
|
"""Create evidence summary table"""
|
|
rows = []
|
|
for source, items in self.evidence.items():
|
|
for item in items:
|
|
rows.append({
|
|
'ID': item['id'],
|
|
'Source': source.value,
|
|
'Date': item['date'],
|
|
'Research Question': item['research_question']
|
|
})
|
|
return pd.DataFrame(rows)
|
|
|
|
# Example
|
|
design = CaseStudyDesign(
|
|
case_type=CaseType.SINGLE,
|
|
research_questions=[
|
|
'How does the organization implement remote work policy?',
|
|
'What challenges emerge in the transition?'
|
|
],
|
|
propositions=[
|
|
'Remote work adoption requires cultural change',
|
|
'Technology alone is insufficient'
|
|
],
|
|
units_of_analysis='Organization-level remote work transition',
|
|
case_selection_logic='Selected for being early adopter with documented transition',
|
|
data_sources=[DataSource.INTERVIEW, DataSource.DOCUMENT, DataSource.OBSERVATION]
|
|
)
|
|
|
|
print(design.generate_protocol())</code></pre>
|
|
<h2>Qualitative Patterns</h2>
|
|
<h3>Rigorous Qualitative Research</h3>
|
|
<pre><code>✓ Reflexivity acknowledged
|
|
✓ Thick description provided
|
|
✓ Triangulation of data sources
|
|
✓ Member checking conducted
|
|
✓ Negative cases sought
|
|
✓ Audit trail maintained
|
|
✓ Saturation documented
|
|
✓ Context richly described</code></pre>
|
|
<h3>Weak Qualitative Research</h3>
|
|
<pre><code>✗ Researcher bias unacknowledged
|
|
✗ Thin description (anecdotes only)
|
|
✗ Single data source
|
|
✗ Cherry-picking quotes
|
|
✗ Ignoring disconfirming evidence
|
|
✗ Unclear analysis process
|
|
✗ Sample too small for claims
|
|
✗ Decontextualized findings</code></pre>
|
|
<h2>Best Practices</h2>
|
|
<h3>1. Data Collection</h3>
|
|
<ul><li>Build rapport before deep questions</li><li>Use open-ended questions</li><li>Practice active listening</li><li>Follow up on interesting points</li><li>Record with permission</li><li>Take field notes immediately after</li><li>Continue until saturation</li></ul>
|
|
<h3>2. Analysis</h3>
|
|
<ul><li>Start analysis during collection</li><li>Code systematically</li><li>Write analytic memos frequently</li><li>Check codes with second coder</li><li>Seek negative cases</li><li>Connect to existing theory</li><li>Ground findings in data</li></ul>
|
|
<h3>3. Quality Criteria</h3>
|
|
<ul><li><strong>Credibility</strong>: Prolonged engagement, triangulation, member checks</li><li><strong>Transferability</strong>: Thick description, context detail</li><li><strong>Dependability</strong>: Audit trail, clear methods</li><li><strong>Confirmability</strong>: Reflexivity, raw data available</li></ul>
|
|
<h2>Related Skills</h2>
|
|
<ul><li><strong>research-design</strong>: Planning qualitative studies</li><li><strong>data-collection</strong>: Interview and observation protocols</li><li><strong>data-analysis</strong>: Qualitative data analysis software</li><li><strong>research-synthesis</strong>: Synthesizing qualitative findings</li><li><strong>research-writing</strong>: Writing qualitative reports</li></ul>
|
|
<h2>Quick Reference</h2>
|
|
<h3>Sample Sizes</h3>
|
|
<pre><code>Interviews: 5-25 for phenomenology
|
|
20-30 for grounded theory
|
|
1-3 for case study
|
|
Focus Groups: 3-5 groups of 6-10 participants
|
|
Ethnography: Extended engagement (months to years)</code></pre>
|
|
<h3>When to Stop Collecting Data</h3>
|
|
<pre><code>✓ Theoretical saturation reached
|
|
✓ No new themes emerging
|
|
✓ Negative cases explored
|
|
✓ All research questions addressed
|
|
✓ Rich description achieved</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-qualitative-methods.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |