social-science-analysis

Social science research methods including survey design, qualitative analysis, content analysis, network analysis, psychometrics, and mixed methods. Covers sociology, psychology, political science, education, and communication studies. Use when user designs surveys, analyzes qualitative data, does content analysis, builds scales, or uses mixed methods. Triggers on "survey design", "qualitative analysis", "content analysis", "Likert scale", "thematic analysis", "grounded theory", "factor analysis", "SEM", "structural equation", "psychometrics", "interview coding".

564 stars

Best use case

social-science-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Social science research methods including survey design, qualitative analysis, content analysis, network analysis, psychometrics, and mixed methods. Covers sociology, psychology, political science, education, and communication studies. Use when user designs surveys, analyzes qualitative data, does content analysis, builds scales, or uses mixed methods. Triggers on "survey design", "qualitative analysis", "content analysis", "Likert scale", "thematic analysis", "grounded theory", "factor analysis", "SEM", "structural equation", "psychometrics", "interview coding".

Teams using social-science-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/social-science-analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/social-science-analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/social-science-analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How social-science-analysis Compares

Feature / Agentsocial-science-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Social science research methods including survey design, qualitative analysis, content analysis, network analysis, psychometrics, and mixed methods. Covers sociology, psychology, political science, education, and communication studies. Use when user designs surveys, analyzes qualitative data, does content analysis, builds scales, or uses mixed methods. Triggers on "survey design", "qualitative analysis", "content analysis", "Likert scale", "thematic analysis", "grounded theory", "factor analysis", "SEM", "structural equation", "psychometrics", "interview coding".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Social Science Analysis

Research methods for social and behavioral sciences. Venv: `source /Users/zhangmingda/clawd/.venv/bin/activate`

## Survey Design

### Question Types & Best Practices
- **Closed-ended**: Likert scales, multiple choice, ranking
- **Open-ended**: Free text (harder to analyze, richer data)
- **Matrix questions**: Multiple items, same scale (efficient but watch for straight-lining)

### Likert Scale Design
```
Strongly Disagree (1) — Disagree (2) — Neutral (3) — Agree (4) — Strongly Agree (5)
```
- Use 5 or 7 points (odd for neutral option)
- Mix positively and negatively worded items (reverse-code in analysis)
- Avoid double-barreled questions
- Pilot test with 10-20 respondents

### Sampling Methods
| Method | When | Pros | Cons |
|--------|------|------|------|
| Simple random | Known population | Unbiased | Need sampling frame |
| Stratified | Subgroup comparison | Precise estimates per stratum | Complex |
| Cluster | Geographic spread | Cost-effective | Higher design effect |
| Convenience | Exploratory | Easy | Not generalizable |
| Snowball | Hard-to-reach populations | Access hidden groups | Selection bias |
| Quota | Ensure representation | Practical | Not truly random |

## Psychometrics & Scale Development

### Reliability
```python
import numpy as np

def cronbachs_alpha(items_df):
    """Calculate Cronbach's alpha for scale reliability"""
    k = items_df.shape[1]
    item_vars = items_df.var(axis=0, ddof=1)
    total_var = items_df.sum(axis=1).var(ddof=1)
    alpha = (k / (k - 1)) * (1 - item_vars.sum() / total_var)
    return alpha

# Interpretation: α > 0.7 acceptable, > 0.8 good, > 0.9 excellent
```

### Exploratory Factor Analysis
```python
from sklearn.decomposition import FactorAnalysis
import numpy as np

# Determine number of factors (parallel analysis or scree plot)
fa = FactorAnalysis(n_components=3, rotation='varimax')
fa.fit(X_scaled)
loadings = pd.DataFrame(fa.components_.T, index=item_names, columns=['F1', 'F2', 'F3'])
print(loadings.round(3))
# Items loading > 0.4 on a factor belong to that construct
```

### Confirmatory Factor Analysis / SEM
For CFA and SEM, recommend using R with `lavaan` package or Python `semopy`:
```python
# pip install semopy
import semopy

model_spec = """
    Latent1 =~ item1 + item2 + item3
    Latent2 =~ item4 + item5 + item6
    Latent1 ~ Latent2
"""
model = semopy.Model(model_spec)
model.fit(df)
print(model.inspect())
# Check fit indices: CFI > 0.95, RMSEA < 0.06, SRMR < 0.08
```

## Qualitative Analysis

### Thematic Analysis (Braun & Clarke)
1. **Familiarization**: Read and re-read data
2. **Initial coding**: Generate codes systematically
3. **Theme search**: Collate codes into potential themes
4. **Theme review**: Check themes against coded extracts and full dataset
5. **Theme definition**: Name and define each theme
6. **Report**: Select vivid examples, relate to research question

### Coding Framework Template
```markdown
| Code | Definition | Example Quote | Theme |
|------|-----------|---------------|-------|
| ADAPT | Adaptation strategy | "We had to change our approach..." | Resilience |
| BARR | Barrier encountered | "The main obstacle was..." | Challenges |
```

### Grounded Theory
1. Open coding → Axial coding → Selective coding
2. Constant comparison method
3. Theoretical sampling until saturation
4. Memo writing throughout

## Content Analysis

```python
# Quantitative content analysis
import pandas as pd
from collections import Counter

def content_analysis(texts, codebook):
    """
    codebook: dict of {category: [keywords]}
    Returns frequency matrix
    """
    results = []
    for text in texts:
        text_lower = text.lower()
        counts = {}
        for category, keywords in codebook.items():
            counts[category] = sum(text_lower.count(kw.lower()) for kw in keywords)
        results.append(counts)
    return pd.DataFrame(results)

# Inter-coder reliability (Cohen's Kappa)
from sklearn.metrics import cohen_kappa_score
kappa = cohen_kappa_score(coder1_labels, coder2_labels)
# κ > 0.8 excellent, 0.6-0.8 substantial, 0.4-0.6 moderate
```

## Social Network Analysis

```python
import networkx as nx
import numpy as np

G = nx.from_pandas_edgelist(df, 'source', 'target')

# Centrality measures
degree = nx.degree_centrality(G)
betweenness = nx.betweenness_centrality(G)
closeness = nx.closeness_centrality(G)
eigenvector = nx.eigenvector_centrality(G)

# Community detection
from networkx.algorithms.community import greedy_modularity_communities
communities = list(greedy_modularity_communities(G))

# Network statistics
print(f"Nodes: {G.number_of_nodes()}, Edges: {G.number_of_edges()}")
print(f"Density: {nx.density(G):.4f}")
print(f"Clustering coefficient: {nx.average_clustering(G):.4f}")
```

## Tips
- Pre-register hypotheses and analysis plans (OSF, AsPredicted)
- Report Cronbach's alpha for all scales
- Use power analysis for sample size determination
- For qualitative research, document your positionality
- Mixed methods: clearly state the integration strategy
- IRB/ethics approval is mandatory for human subjects research

Related Skills

statistical-analysis

564
from beita6969/ScienceClaw

Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.

social-science-research

564
from beita6969/ScienceClaw

Orchestrates a social science research workflow from literature review through data collection, text analysis, statistical modeling, and report generation. Use when conducting empirical social science research, policy analysis, or mixed-methods studies. NOT for pure natural science analysis or clinical trial data.

scipy-analysis

564
from beita6969/ScienceClaw

Scientific computing and statistical analysis with SciPy, NumPy, and pandas. Use when: (1) statistical hypothesis testing, (2) optimization problems, (3) signal processing, (4) numerical integration, (5) data manipulation and analysis. NOT for: symbolic math (use sympy-math), machine learning (use sklearn directly), or visualization (use matplotlib-viz).

scienceclaw-verification

564
from beita6969/ScienceClaw

Verify scientific claims, check calculations, validate experimental designs, and fact-check citations. Use when: (1) checking a claim against evidence, (2) validating statistical analyses, (3) verifying experimental reproducibility claims, (4) fact-checking references, (5) adversarial review of research. NOT for: generating new content (use scienceclaw-generation), simple QA (use scienceclaw-qa).

scienceclaw-summarization

564
from beita6969/ScienceClaw

Summarize scientific papers, datasets, experimental results, and literature reviews. Use when: (1) condensing research papers, (2) creating literature reviews, (3) summarizing experimental findings, (4) meta-analysis synthesis, (5) creating executive summaries of research. NOT for: information extraction (use scienceclaw-ie), full paper retrieval (use scienceclaw-retrieval), or writing new content (use scienceclaw-generation).

scienceclaw-retrieval

564
from beita6969/ScienceClaw

Retrieve scientific information from databases, literature, and knowledge bases. Use when: (1) finding relevant papers, (2) querying scientific databases, (3) cross-referencing findings, (4) building bibliographies, (5) systematic literature search. NOT for: answering questions (use scienceclaw-qa), summarizing (use scienceclaw-summarization), or data analysis (use code-execution skill).

scienceclaw-reasoning

564
from beita6969/ScienceClaw

Perform multi-step scientific reasoning, proof construction, causal inference, and logical argumentation. Use when: (1) deriving conclusions from premises, (2) causal analysis, (3) mathematical proofs, (4) hypothesis evaluation, (5) counterfactual reasoning. NOT for: simple factual questions (use scienceclaw-qa), data analysis (use code-execution), or literature search (use scienceclaw-retrieval).

scienceclaw-qa

564
from beita6969/ScienceClaw

Answer scientific questions across all disciplines with evidence-based responses and citations. Use when: (1) user asks factual science questions, (2) needs explanation of concepts/theories/methods, (3) multi-step scientific reasoning needed. Covers natural sciences (physics, chemistry, biology, medicine, materials, astronomy, earth science, math, CS) and social sciences (economics, sociology, psychology, political science, linguistics, history, law, philosophy, education). NOT for: opinion-based questions, non-scientific queries, or when code execution is needed (use code-execution skill).

scienceclaw-prediction

564
from beita6969/ScienceClaw

Predict scientific properties, trends, and outcomes. Use when: user asks for property prediction, trend forecasting, or model-based estimation. NOT for: historical data lookup or real-time monitoring.

scienceclaw-ie

564
from beita6969/ScienceClaw

Extract structured information from scientific texts: entities, relations, data tables, methods, results. Use when: (1) parsing papers for key data, (2) extracting experimental parameters, (3) building knowledge graphs from literature, (4) NER on scientific documents, (5) extracting methods/results sections. NOT for: summarization (use scienceclaw-summarization), full text retrieval (use scienceclaw-retrieval).

scienceclaw-generation

564
from beita6969/ScienceClaw

Generate scientific hypotheses, experimental designs, and paper drafts. Use when: user asks to propose hypotheses, design experiments, or write scientific content. NOT for: data analysis or literature search.

scienceclaw-discovery

564
from beita6969/ScienceClaw

Identify research gaps, synthesize cross-disciplinary insights, and generate novel hypotheses. Use when: user asks about unexplored areas, cross-field connections, or new research directions. NOT for: routine literature review or data analysis.