Module contents
Stage 9 of 9Research 100 min

Design triangulation and final report

Close the project with your own question on public data that admits at least two designs with different assumptions. Estimate and compare them, apply sensitivity analysis, and write a reproducible report declaring deviations from the prior plan and the conclusion that withstands all designs.

After this lesson you can

  • Choose your own question and justify two identification designs with different assumptions.
  • Estimate both with diagnostics and compare estimates with their uncertainty.
  • Apply sensitivity and refutation analyses to the main conclusion.
  • Write a reproducible report clearly distinguishing planned from exploratory work.

Before you start

One question, two ways to answer

What was the effect of assignment to the National Supported Work program on 1978 earnings in the male RE74 subsample? We choose this question because it has an experimental comparison and another using external controls, both with the same 185 treated participants. The original Dehejia and Wahba source also provides 260 experimental controls and 2,490 PSID survey controls. These are selected historical data: they do not represent all workers or predict the effect of a current program.

Design triangulation compares results from strategies whose threats are not identical. The experimental comparison uses the mean difference between NSW groups. The observational comparison combines NSW treated units with PSID and estimates an ATT by AIPW, with scaled logistic propensity and a linear untreated-outcome model. Experimental random assignment does not make PSID controls random: that comparison needs conditional exchangeability, positivity, and appropriate models, as well as consistency and comparable follow-up.

The estimands are related but not automatically equal. The experimental comparison targets the average assignment effect for the experimental population represented by the subsample; the observational ATT targets treated NSW participants. With heterogeneous effects, selection, or different reference populations, disagreement can reflect different estimands as well as bias or chance. Both designs share income measurement and the same treated units, so they are not independent replications either.

An honest plan and record

The downloadable file fixes question, data, covariates, two methods, 200 resamples with seed 201, trimming rule, and diagnostics. It is a retrospective teaching plan written when these data and results are already known, not a preregistration. Its hash identifies the exact file run; it does not prove someone sealed it before looking at results. For a new study, write the plan before analysis, record date and version in an appropriate repository, and preserve history. If you change outcome, sample, controls, or inference rule, record what changed, when, why, and whether before or after seeing results.

The pipeline has no deviations from the included retrospective specification, but that does not eliminate post-selection: the entire study is illustrative. Trimming and auxiliary regression are declared exploratory. We do not retrospectively choose the most favorable design; the table includes both with uncertainty and makes each required assumption visible. The pretreatment variable re75 serves as a placebo, not a post-treatment outcome.

Comparing with uncertainty

In the documented run, the experimental difference is 1,794.34 dollars, 95% percentile bootstrap interval [582.48; 3,052.63]. AIPW with PSID gives 2,046.32 [138.86; 4,053.22]. The observational minus experimental difference is 251.98 [-1,520.70; 1,913.90]. These are 200 complete replicates from a short run, insufficient for very stable percentiles; increase the number in a real analysis and retain failures and seeds. Mean differences in this sample are observations, not guarantees about individual effects.

In each replicate the experimental and PSID controls are resampled separately, but the same treated resample is used in both designs. Propensity and AIPW regression are then reestimated. This structure retains dependence due to shared treated units. An interval constructed as if the two estimates were independent, or merely inspecting whether their intervals overlap, does not replace uncertainty in the difference. Assuming independence between controls from different sources is another bootstrap choice; it does not resolve possible sample links or shared biases.

The interval for the difference includes negative and positive values. Both point estimates are positive, but neither overlap nor lack of a statistically detectable difference proves that designs agree or that bias is small. Strengthening a conclusion requires justifying comparability of estimands, mechanisms, and assumptions, and considering precision and shared threats. The experimental study can serve as a reference within this sample, subject to its own limitations.

Sensitivity and refutation

In PSID, minimum estimated propensity without numerical protection is approximately 9,54⋅10−279,54\cdot10^{-27} and maximum 0.935; effective size of weighted controls is 42.64. Adjusting extreme weights does not create support where none exists. Trimming to [0.05; 0.95] leaves 177 treated and 241 controls and the AIPW estimate is 2,478.79. That comparison is exploratory and changes the target population; it does not prove either figure correct.

As a validity diagnostic, the experimental difference in prior 1975 earnings is 265.15, interval [-406.09; 795.24]. An interval including zero does not prove balance in all variables or absence of selection. As a separate reference, OLS on NSW/PSID and observed covariates estimates 751.95; its robustness value to the null point under classical error is 1.58%. That number belongs to auxiliary OLS, not the AIPW ATT or experimental comparison. Other strategies need sensitivity analyses aligned with their estimands; assigning them that value would produce fictitious precision.

The report as a reproducible result

A causal report lets readers reconstruct the question being answered and the evidence supporting each claim. It includes population, treatment, outcome, estimand, assumptions, source and versions, a table with intervals, diagnostics, sensitivity, deviations, and limitations. The laboratory-generated report contains that information, data and plan hashes, and the count of 200 replicates. A hash verifies byte identity, not analysis date, data validity, or absence of bias.

An appropriate conclusion for this run is: both point estimates are positive for these historical samples and the interval for their difference is wide; the observational analysis depends on selection and support assumptions the data do not verify. It does not conclude that the program benefits everyone, that effect size is the same in other populations, or that apparent agreement validates all assumptions.

Laboratory: one command from raw data

With Python 3.12 install python -m pip install "numpy==2.2.6" "pandas==2.3.3" "scipy==1.15.3" "scikit-learn==1.6.1" "statsmodels==0.15.0". Download into one folder report.py, plan.json, test_report.py, nsw_data.py, estimators.py, and sensitivity.py. The executed report and its results allow the figures to be checked.

Run python test_report.py and then python report.py --plan plan.json --project causal_project --out informe. The second command downloads the three original files if missing, verifies SHA-256, estimates both designs, runs diagnostics, and creates informe/informe.md and informe/results.json. The output folder must be new so it does not overwrite an earlier report. The fixed plan is deliberately strict; if you change methods or replicates, change code and plan together and document the deviation. The cell combines the module functions and runs exactly the same specification locally; it prints a temporary report. To retain files, use the preceding command.

[ ]Generate the causal reportLocal GPU
"""Descarga verificable de NSW y PSID de la página de Dehejia y Wahba."""
from pathlib import Path
import hashlib
import urllib.request
import pandas as pd

FILES = {
    'nswre74_treated.txt':'e7b742fe0ff07a0f45e129b4ff108bb9611cd83d53604732c48a8a0a3e20eda3',
    'nswre74_control.txt':'a1364cea459d953dc691a667d99194b4ad335d6d550354fe23a5d2dc58d729b5',
    'psid_controls.txt':'73ffcdd8feb7f965f8e1de9bfdb80a095542c7a95ce7f56b2e2b2a9716e858cc',
}
BASE = 'https://users.nber.org/~rdehejia/data/'
COLUMNS = ['treat','age','education','black','hispanic','married','nodegree','re74','re75','re78']


def fetch_data(directory):
    directory = Path(directory)
    directory.mkdir(parents=True, exist_ok=True)
    for name, expected in FILES.items():
        path = directory / name
        if not path.exists():
            with urllib.request.urlopen(BASE+name, timeout=60) as response:
                data = response.read()
            if hashlib.sha256(data).hexdigest() != expected:
                raise ValueError(f'Hash inesperado: {name}')
            path.write_bytes(data)
        if hashlib.sha256(path.read_bytes()).hexdigest() != expected:
            raise ValueError(f'Archivo local modificado: {name}')
    return directory


def load_data(directory):
    directory = fetch_data(directory)
    treated, controls, psid = [pd.read_csv(directory / n, sep=r'\s+', header=None, names=COLUMNS)
                               for n in ('nswre74_treated.txt','nswre74_control.txt','psid_controls.txt')]
    if (len(treated),len(controls),len(psid)) != (185,260,2490):
        raise ValueError('El número de filas no coincide con la documentación')
    if not (treated.treat.eq(1).all() and controls.treat.eq(0).all() and psid.treat.eq(0).all()):
        raise ValueError('Indicadores de tratamiento inesperados')
    return pd.concat([treated,controls], ignore_index=True), pd.concat([treated,psid], ignore_index=True)
"""Estimadores ATT para NSW: modelos explícitos, sin garantía de identificación."""
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler

COVARIATES = ['age','education','black','hispanic','married','nodegree','re74','re75']
METHODS = ('naive','regression','matching','ipw','aipw','aipw_trim')


def fit_nuisance(frame):
    t = frame.treat.to_numpy(int)
    y = frame.re78.to_numpy(float)
    x = frame[COVARIATES].to_numpy(float)
    if set(np.unique(t)) != {0,1}: raise ValueError('Se necesitan tratados y controles')
    scaler = StandardScaler().fit(x)
    xs = scaler.transform(x)
    raw = LogisticRegression(C=1e6, max_iter=1000).fit(xs,t).predict_proba(xs)[:,1]
    # Protección numérica, no recorte de observaciones; reportar extremos sin protección.
    propensity = np.clip(raw, 1e-6, 1-1e-6)
    return t,y,xs,propensity,raw


def att_scores(frame, trim=(.05,.95)):
    t,y,x,e,raw = fit_nuisance(frame)
    treated,control = t==1,t==0
    x1 = np.column_stack([np.ones(len(t)),t,x])
    regression = np.linalg.lstsq(x1,y,rcond=None)[0][1]
    order = np.argsort(e[control],kind='stable')
    sorted_e = e[control][order]
    sorted_y = y[control][order]
    positions = np.searchsorted(sorted_e,e[treated])
    left = np.clip(positions-1,0,len(sorted_e)-1)
    right = np.clip(positions,0,len(sorted_e)-1)
    match = np.where(abs(sorted_e[left]-e[treated])<=abs(sorted_e[right]-e[treated]),left,right)
    matching = np.mean(y[treated]-sorted_y[match])
    odds = e[control]/(1-e[control])
    ipw = y[treated].mean()-np.average(y[control],weights=odds)
    design = np.column_stack([np.ones(len(t)),x])
    beta = np.linalg.lstsq(design[control],y[control],rcond=None)[0]
    mu0 = design@beta
    aipw = (np.sum(y[treated]-mu0[treated])-np.sum(odds*(y[control]-mu0[control])))/treated.sum()
    retained = (e>=trim[0]) & (e<=trim[1])
    tr,co = treated & retained,control & retained
    if tr.sum()==0 or co.sum()<=design.shape[1]: raise ValueError('Sin soporte suficiente tras recortar')
    beta_trim = np.linalg.lstsq(design[co],y[co],rcond=None)[0]
    mu_trim = design@beta_trim
    odds_trim=e[co]/(1-e[co])
    aipw_trim=(np.sum(y[tr]-mu_trim[tr])-np.sum(odds_trim*(y[co]-mu_trim[co])))/tr.sum()
    ess=(odds.sum()**2)/np.sum(odds**2)
    return dict(naive=y[treated].mean()-y[control].mean(), regression=regression,
                matching=matching, ipw=ipw, aipw=aipw, aipw_trim=aipw_trim), dict(
                min_e=float(raw.min()),max_e=float(raw.max()),ess_control=float(ess),
                treated_retained=int(tr.sum()),control_retained=int(co.sum()))


def aipw_ate(y,t,mu0,mu1,e):
    y,t,mu0,mu1,e = [np.asarray(v,float) for v in (y,t,mu0,mu1,e)]
    if not (y.shape == t.shape == mu0.shape == mu1.shape == e.shape) or y.ndim != 1 or len(y)<2:
        raise ValueError('Se requieren vectores de igual longitud y al menos dos unidades')
    if not all(np.isfinite(x).all() for x in (y,t,mu0,mu1,e)) or not np.isin(t,[0,1]).all() or np.any((e<=0)|(e>=1)):
        raise ValueError('Datos no finitos, tratamiento no binario o falta de positividad')
    pseudo=mu1-mu0+t*(y-mu1)/e-(1-t)*(y-mu0)/(1-e)
    estimate=float(pseudo.mean())
    se=float(pseudo.std(ddof=1)/np.sqrt(len(y)))
    return estimate,se


def kish(weights):
    w=np.asarray(weights,float)
    if w.ndim!=1 or not len(w) or not np.isfinite(w).all() or np.any(w<0) or not w.sum():
        raise ValueError('Pesos finitos no negativos y suma positiva requeridos')
    return float(w.sum()**2/np.sum(w**2))
"""Sensibilidad a confusión omitida para OLS con error estándar clásico."""
import numpy as np
import statsmodels.api as sm

def robustness_value(t,df):
    if df<=0 or not np.isfinite(t):raise ValueError('t o grados de libertad inválidos')
    f=abs(t)/np.sqrt(df)
    return float((np.sqrt(f**4+4*f*f)-f*f)/2)

def adjusted_estimate(beta,se,df,r_t,r_y):
    if df<=0 or se<0 or not 0<=r_t<1 or not 0<=r_y<=1:raise ValueError('Parámetros inválidos')
    bias=se*np.sqrt(df)*np.sqrt(r_t*r_y/(1-r_t))
    return float(beta-np.sign(beta)*bias)

def evalue(rr):
    if not np.isfinite(rr) or rr<=0:raise ValueError('Se requiere riesgo relativo positivo')
    q=max(rr,1/rr)
    return float(q+np.sqrt(q*(q-1)))

def partial_r2(target,candidate,controls):
    x=sm.add_constant(np.asarray(controls,float),has_constant='add')
    a=sm.OLS(target,x).fit().resid;b=sm.OLS(candidate,x).fit().resid
    return float(np.corrcoef(a,b)[0,1]**2)

def ols_summary(frame,outcome,treatment,controls,benchmark):
    cols=[treatment]+controls
    fit=sm.OLS(frame[outcome],sm.add_constant(frame[cols],has_constant='add')).fit()
    t=float(fit.tvalues[treatment]);df=float(fit.df_resid);beta=float(fit.params[treatment]);se=float(fit.bse[treatment])
    rest=[c for c in controls if c!=benchmark]
    rt=partial_r2(frame[treatment],frame[benchmark],frame[rest])
    ry=partial_r2(frame[outcome],frame[benchmark],frame[[treatment]+rest])
    return {'beta':beta,'se_classical':se,'t':t,'df':df,'rv_point_null':robustness_value(t,df),
            'benchmark':benchmark,'benchmark_r_t':rt,'benchmark_r_y':ry}
"""Informe reproducible NSW/PSID con dos diseños y bootstrap emparejado."""
import argparse,hashlib,json,platform
from pathlib import Path
from importlib.metadata import version
import numpy as np
from threadpoolctl import threadpool_limits

def percentile(values):
    a=np.asarray(values,float)
    if a.ndim!=1 or len(a)<2 or not np.isfinite(a).all():raise ValueError('Réplicas inválidas')
    return [float(v) for v in np.quantile(a,[.025,.975])]

def analyze(experimental,observational,repetitions=200,seed=201):
    t=experimental[experimental.treat==1].reset_index(drop=True)
    c=experimental[experimental.treat==0].reset_index(drop=True)
    p=observational[observational.treat==0].reset_index(drop=True)
    if not t.equals(observational[observational.treat==1].reset_index(drop=True)):
        raise ValueError('Los tratados deben ser las mismas filas y orden')
    experiment=float(t.re78.mean()-c.re78.mean())
    aipw,diagnostics=att_scores(observational)
    placebo=float(t.re75.mean()-c.re75.mean())
    rng=np.random.default_rng(seed);draws=[];failures=0
    for _ in range(repetitions):
        tr=t.iloc[rng.integers(len(t),size=len(t))]
        co=c.iloc[rng.integers(len(c),size=len(c))]
        ps=p.iloc[rng.integers(len(p),size=len(p))]
        try:
            import pandas as pd
            sample=pd.concat([tr,ps],ignore_index=True)
            estimate,_=att_scores(sample)
            rct=float(tr.re78.mean()-co.re78.mean())
            draws.append([rct,float(estimate['aipw']),float(tr.re75.mean()-co.re75.mean())])
        except (ValueError,np.linalg.LinAlgError):failures+=1
    if len(draws)<2:raise ValueError('Bootstrap insuficiente')
    b=np.array(draws);ols=ols_summary(observational,'re78','treat',COVARIATES,'re75')
    return {'experimental':{'estimate':experiment,'interval':percentile(b[:,0])},
            'observational':{'estimate':float(aipw['aipw']),'interval':percentile(b[:,1]),
                             'diagnostics':diagnostics},
            'difference_obs_minus_exp':{'estimate':float(aipw['aipw']-experiment),
                                        'interval':percentile(b[:,1]-b[:,0])},
            'placebo_re75':{'estimate':placebo,'interval':percentile(b[:,2])},
            'sensitivity':{'trimmed_aipw':float(aipw['aipw_trim']),'ols_auxiliary':ols},
            'bootstrap':{'requested':repetitions,'successful':len(draws),'failed':failures,'seed':seed}}

def render_report(result,plan,plan_hash):
    e=result['experimental'];o=result['observational'];d=result['difference_obs_minus_exp']
    p=result['placebo_re75'];s=result['sensitivity'];diagnostics=o['diagnostics'];rv=s['ols_auxiliary']
    def ci(x):return f"[{x[0]:.2f}, {x[1]:.2f}]"
    return f'''# Informe: asignación a NSW e ingresos de 1978

Pregunta: {plan['question']} Datos públicos históricos: 185 tratados y 260 controles experimentales RE74, más 2490 controles PSID. Ingresos en dólares de 1978; resultados para esta muestra masculina seleccionada, no una promesa para otras poblaciones.

## Plan y procedencia

Este plan es **retrospectivo e instructivo**, creado después de conocer los datos; no es un prerregistro. SHA-256 del plan: `{plan_hash}`. Desviaciones: {plan['known_deviations']} Los datos originales se descargan del sitio de Dehejia y Wahba y se comprueban con hashes. Semilla {result['bootstrap']['seed']}; {result['bootstrap']['successful']} de {result['bootstrap']['requested']} réplicas completas; fallos {result['bootstrap']['failed']}. Versiones y hashes se incluyen en results.json.

## Estimaciones e incertidumbre

| Diseño | Estimación | Intervalo percentil 95 % |
|---|---:|---:|
| Diferencia experimental | {e['estimate']:.2f} | {ci(e['interval'])} |
| AIPW ATT con PSID | {o['estimate']:.2f} | {ci(o['interval'])} |
| AIPW menos experimental | {d['estimate']:.2f} | {ci(d['interval'])} |

El bootstrap estratifica grupos y comparte en cada réplica la misma muestra de tratados entre diseños, preservando su dependencia. Reestima los modelos AIPW. Solo 200 réplicas limitan la precisión de los percentiles. La diferencia experimental apunta al efecto medio de asignación en la población elegible representada por la muestra; el ATT observacional apunta a tratados NSW bajo intercambio condicional y positividad. La comparación no convierte estos estimandos en idénticos; heterogeneidad y selección pueden separarlos.

## Diagnósticos y sensibilidad

El mínimo y máximo de la propensión estimada sin protección son {diagnostics['min_e']:.3g} y {diagnostics['max_e']:.3f}; el tamaño efectivo de controles ponderados es {diagnostics['ess_control']:.2f}. El recorte exploratorio 0,05-0,95 retiene {diagnostics['treated_retained']} tratados y {diagnostics['control_retained']} controles y produce AIPW {s['trimmed_aipw']:.2f}; cambia la población objetivo y no es una corrección garantizada.

El placebo de resultado previo (ingresos de 1975) en el experimento da {p['estimate']:.2f}, intervalo {ci(p['interval'])}. No rechazar una diferencia previa no confirma aleatorización ni ausencia de otros problemas. Un modelo OLS observacional auxiliar da {rv['beta']:.2f}, con valor de robustez al punto nulo {100*rv['rv_point_null']:.2f} % bajo errores clásicos. Ese valor describe el OLS auxiliar y **no** cuantifica la robustez del ATT AIPW ni del efecto experimental.

## Conclusión y límites

Ambas estimaciones puntuales son positivas en esta ejecución. Sus intervalos y el intervalo de su diferencia describen incertidumbre muestral, no prueban acuerdo causal ni ausencia de sesgo. El diseño experimental requiere asignación válida, consistencia y seguimiento comparable; el observacional añade ausencia de confusión no medida y suficiente soporte, condiciones no verificadas por el ajuste. No se puede sostener con estos datos una conclusión para todos los programas de formación o todos los trabajadores.
'''

def run(plan_path,project,outdir):
    plan_bytes=Path(plan_path).read_bytes();plan=json.loads(plan_bytes)
    if plan['covariates']!=COVARIATES or plan['trim']!=[.05,.95] or plan['bootstrap_repetitions']!=200 or plan['seed']!=201:
        raise ValueError('El plan no coincide con la implementación; revisa el código antes de cambiarlo')
    with threadpool_limits(limits=1):
        exp,obs=load_data(str(Path(project)/'data'))
        result=analyze(exp,obs,plan['bootstrap_repetitions'],plan['seed'])
    result['plan_sha256']=hashlib.sha256(plan_bytes).hexdigest()
    result['data_sha256']=FILES
    result['versions']={'python':platform.python_version(),'numpy':np.__version__,
                        'pandas':version('pandas'),'scikit_learn':version('scikit-learn')}
    output=Path(outdir);output.mkdir(parents=True,exist_ok=False)
    (output/'results.json').write_text(json.dumps(result,indent=2,ensure_ascii=False),encoding='utf8')
    (output/'informe.md').write_text(render_report(result,plan,result['plan_sha256']),encoding='utf8')
    return result

"""Prueba del emparejamiento bootstrap y validaciones del informe."""
import numpy as np
import pandas as pd

rng=np.random.default_rng(108)
def frame(n,t):
    x=rng.normal(size=(n,len(COVARIATES)))
    out=pd.DataFrame(x,columns=COVARIATES);out['treat']=t
    out['re78']=2*t+out.age+.2*out.education+rng.normal(size=n)
    return out
treated=frame(30,1);controls=frame(40,0);psid=frame(60,0)
experimental=pd.concat([treated,controls],ignore_index=True)
observational=pd.concat([treated,psid],ignore_index=True)
a=analyze(experimental,observational,repetitions=4,seed=45)
rng=np.random.default_rng(45);delta=[]
for _ in range(4):
    tr=treated.iloc[rng.integers(len(treated),size=len(treated))]
    co=controls.iloc[rng.integers(len(controls),size=len(controls))]
    ps=psid.iloc[rng.integers(len(psid),size=len(psid))]
    score,_=att_scores(pd.concat([tr,ps],ignore_index=True))
    delta.append(score['aipw']-(tr.re78.mean()-co.re78.mean()))
assert np.allclose(a['difference_obs_minus_exp']['interval'],percentile(delta))
assert a['bootstrap']['successful']==4 and a['bootstrap']['failed']==0
try:analyze(experimental,observational.iloc[::-1],repetitions=4)
except ValueError:pass
else:raise AssertionError('Se deben comprobar los tratados emparejados')
try:percentile([1])
except ValueError:pass
else:raise AssertionError('Un intervalo requiere al menos dos réplicas')
print('Bootstrap emparejado, validación y percentiles: pasan')
import tempfile
with tempfile.TemporaryDirectory() as tmp:
    plan_path=Path(tmp)/'plan.json'
    plan_path.write_bytes(b'{\n  "name": "NSW y comparaci\xc3\xb3n PSID: ejercicio retrospectivo",\n  "preregistered": false,\n  "question": "\xc2\xbfCu\xc3\xa1l es el efecto de la asignaci\xc3\xb3n a NSW sobre ingresos de 1978 en la submuestra masculina RE74?",\n  "designs": ["Diferencia de medias experimental", "ATT AIPW con controles PSID"],\n  "covariates": ["age", "education", "black", "hispanic", "married", "nodegree", "re74", "re75"],\n  "bootstrap_repetitions": 200,\n  "seed": 201,\n  "trim": [0.05, 0.95],\n  "primary_interval": "percentil bootstrap estratificado, reestimando modelos",\n  "sensitivity": "Recorte exploratorio y valor de robustez del modelo OLS auxiliar; no transferir RV a AIPW.",\n  "refutation": "Diferencia experimental de ingresos anteriores al tratamiento, re75.",\n  "known_deviations": "Ninguna respecto a esta especificaci\xc3\xb3n retrospectiva; no es un registro previo independiente."\n}\n')
    output=Path(tmp)/'informe_celda'
    result=run(plan_path,'causal_project',output)
    print((output/'informe.md').read_text(encoding='utf8'))
This cell needs the local lab (PyTorch with your GPU). Start it with npm run lab and open the connection link.

Exercises

Quiz
Two intervals from different designs overlap and both point estimates are positive. What does this contribute?
Quiz
After seeing results, you discover a large difference in a subgroup absent from the plan. How do you report it?
Quiz
Which conclusion exceeds the evidence in this example?
Code
Implement tabla_final(filas), which receives dictionaries with diseño, estimación, inferior, superior, diagnóstico, and rv. Return a list of dictionaries with the same keys; validate inferior ≤ superior and preserve rv=None for designs where the OLS value does not apply. Do not invent a missing robustness value.
def tabla_final(filas):
  pass
Shift+Enter to run

Summary

Key idea
Triangulation combines designs with different assumptions and explicit estimands. A reproducible report shows results, their dependencies, relevant sensitivities, and decisions made before and after observing data.