当前位置:首页>python>断点回归(RDD)进阶教程:Python实现完整攻略

断点回归(RDD)进阶教程:Python实现完整攻略

  • 2026-07-02 02:32:18
断点回归(RDD)进阶教程:Python实现完整攻略

从原理到代码,从Sharp RDD到Fuzzy RDD,从诊断检验到顶刊图表


01 什么是断点回归(RDD)?

断点回归(Regression Discontinuity Design)是一种准实验方法,利用"临界值"附近的自然实验来识别因果效应。

核心思想

如果个体在临界值的一侧vs另一侧几乎是随机分配的,那么临界值处的"跳跃"就是处理效应的估计。

经典应用场景

场景
临界值
处理
最低工资政策
最低工资门槛
是否受最低工资保护
选举研究
50%得票率
是否获胜
教育政策
分数线
是否被录取
医疗政策
年龄门槛
是否有医保

02 Sharp RDD vs Fuzzy RDD

Sharp RDD(清晰断点)

定义:处理状态在临界值处确定性跳跃

D = 0  if X < cD = 1  if X >= c

适用场景:政策明确规定了资格门槛

举例:新《劳动合同法》规定,月薪超过5000元的员工享有特定权益    → 5000元就是Sharp断点

Fuzzy RDD(模糊断点)

定义:处理概率在临界值处跳跃但非100%

lim P(D=1 | X→c⁺) ≠ lim P(D=1 | X→c⁻)

适用场景:资格门槛不严格强制执行

举例:贫困线附近的家庭可能"不上报"收入    → 处理概率跳跃但不是0/1

03 核心概念:带宽与核函数

为什么要带宽?

RDD本质上是在临界值附近做局部实验,只使用"接近"断点的观测。

带宽选择 = 精度 vs 偏差的权衡    带宽太宽 → 包含远处观测 → 偏差增大    带宽太窄 → 样本量太小 → 方差增大

带宽选择方法

方法
原理
适用
MSE最优
最小化均方误差
默认推荐
Imbens-Kalyanaraman
优化渐近MSE
理论最优
不同带宽检验
敏感性分析
稳健性检验

核函数

核函数决定带宽内观测的权重

# 三角核 (Triangle) - 默认推荐K(u) = 1 - |u|  if |u| <= 1K(u) = 0        otherwise# 均匀核 (Uniform)K(u) = 0.5  if |u| <= 1# Epanechnikov核K(u) = 0.75(1-u²)  if |u| <= 1

04 Python实操:完整代码

数据生成

import numpy as npimport pandas as pddef generate_rdd_data(n=2000, cutoff=0, treatment_effect=2, seed=42):    np.random.seed(seed)    # 驱动变量 (Running Variable) - 断点附近的分配接近随机    running_var = np.random.uniform(-1, 1, n)    # 潜在结果 Y(0) 和 Y(1)    error = np.random.normal(0, 0.5, n)    Y0 = 1 + 2 * running_var + error    Y1 = Y0 + treatment_effect  # 真实处理效应    # 处理变量 (Sharp RDD: 确定性的 0/1)    treatment = (running_var >= cutoff).astype(int)    # 观测结果    outcome = treatment * Y1 + (1 - treatment) * Y0    return pd.DataFrame({        'running_var': running_var,        'outcome': outcome,        'treatment': treatment    })

Sharp RDD 估计

class SharpRDD:    """Sharp RDD 估计器"""    def __init__(self, data, running_var, outcome, cutoff=0):        self.data = data.copy()        self.x = data[running_var].values        self.y = data[outcome].values        self.cutoff = cutoff        self.x_centered = self.x - cutoff    def local_linear_regression(self, bandwidth=0.3, kernel='triangular'):        """        局部线性回归 (LLR)        参数:        ------        bandwidth : 带宽        kernel : 核函数类型        """        # 计算核权重        weights = self._kernel_weights(self.x_centered, bandwidth, kernel)        # 带宽内样本        mask = np.abs(self.x_centered) <= bandwidth        x_c = self.x_centered[mask]        y = y[mask]        w = weights[mask]        # 加权最小二乘        X = np.column_stack([np.ones(len(x_c)), x_c])        XW = X * np.sqrt(w)[:, np.newaxis]        yW = y * np.sqrt(w)        beta = np.linalg.lstsq(XW, yW, rcond=None)[0]        # 处理效应 = 断点处的跳跃        tau = beta[0]  # 截距项即为断点跳跃        # 标准误        residuals = y - X @ beta        sigma2 = np.sum(w * residuals**2) / (len(y) - X.shape[1])        var_beta = sigma2 * np.linalg.inv(XW.T @ XW)        se = np.sqrt(var_beta[0, 0])        return tau, se    def _kernel_weights(self, x, bandwidth, kernel):        """核函数权重计算"""        x_norm = np.abs(x / bandwidth)        if kernel == 'triangular':            return np.where(x_norm <= 1, 1 - x_norm, 0)        elif kernel == 'uniform':            return np.where(x_norm <= 1, 0.5, 0)        elif kernel == 'epanechnikov':            return np.where(x_norm <= 1, 0.75 * (1 - x_norm**2), 0)

Fuzzy RDD 估计(2SLS框架)

class FuzzyRDD:    """Fuzzy RDD = 工具变量框架下的RDD"""    def estimate(self, bandwidth=0.3):        """        两阶段最小二乘 (2SLS)        阶段1: D = α + βX + γ·1{X≥c} + ε               预测处理状态        阶段2: Y = a + bX + τ·D̂ + u               使用预测值估计因果效应 (LATE)        """        indicator = (self.x >= self.cutoff).astype(float)        mask = np.abs(self.x_centered) <= bandwidth        x_c = self.x_centered[mask]        y = self.y[mask]        d = self.d[mask]        z = indicator[mask]  # 工具变量 = 断点指示        # 阶段1: 预测处理        X1 = np.column_stack([np.ones(len(x_c)), x_c, z])        d_pred = X1 @ np.linalg.lstsq(X1, d, rcond=None)[0]        # 阶段2: IV估计        X2 = np.column_stack([np.ones(len(x_c)), x_c, d_pred])        coef2 = np.linalg.lstsq(X2, y, rcond=None)[0]        tau = coef2[2]  # 处理效应 (LATE)        # 标准误 & F统计量        residuals = y - X2 @ coef2        n, k = len(y), X2.shape[1]        sigma2 = np.sum(residuals**2) / (n - k)        var_covar = sigma2 * np.linalg.inv(X2.T @ X2)        se = np.sqrt(var_covar[2, 2])        # 第一阶段F统计量 (检验工具变量强度)        ssr1 = np.sum((d - d.mean())**2)        ssr2 = np.sum((d - d_pred)**2)        f_stat = ((ssr1 - ssr2) / 1) / (ssr2 / (n - 3))        return tau, se, f_stat

05 诊断检验(必做!)

RDD结果的可信度依赖于三大假设

假设1:驱动变量连续性(无Manipulation)

McCrary密度检验:检验个体是否"操控"驱动变量

def density_test(self, bandwidth=0.3):    """    McCrary (2008) 密度检验    H0: 密度在断点处连续    """    left_mask = (self.x < self.cutoff) & (self.x >= self.cutoff - bandwidth)    right_mask = (self.x >= self.cutoff) & (self.x <= self.cutoff + bandwidth)    n_left, n_right = left_mask.sum(), right_mask.sum()    log_diff = np.log(n_right / n_left)    se = np.sqrt(1/n_left + 1/n_right)    z_stat = log_diff / se    p_value = 2 * (1 - norm.cdf(abs(z_stat)))    return {        'z_stat': z_stat,        'p_value': p_value,        'conclusion': '连续 ✓' if p_value > 0.1 else '可能Manipulation ✗'    }

解读

  • • p > 0.1 → 不能拒绝H0,密度连续,RDD可信
  • • p < 0.1 → 可能存在选择性样本进入

假设2:协变量前定(平衡性检验)

协变量在断点两侧应该相似

def covariate_balance_test(self, covariates, bandwidth=0.3):    """    检验协变量在断点两侧是否平衡    H0: 协变量均值相等    """    results = {}    for cov in covariates:        cov_vals = self.data[cov].values        indicator = (self.x >= self.cutoff).astype(int)        mask = np.abs(self.x_centered) <= bandwidth        cov_left = cov_vals[(mask) & (indicator == 0)]        cov_right = cov_vals[(mask) & (indicator == 1)]        diff = np.mean(cov_right) - np.mean(cov_left)        se = np.sqrt(np.var(cov_left)/len(cov_left) + np.var(cov_right)/len(cov_right))        t_stat = diff / se        p_value = 2 * (1 - norm.cdf(abs(t_stat)))        results[cov] = {'diff': diff, 'p_value': p_value, 'balanced': p_value > 0.1}    return results

解读

  • • p > 0.1 → 协变量平衡,处理组和对照组可比
  • • p < 0.1 → 可能存在选择偏误

假设3:结果趋势连续(安慰剂检验)

在假断点处估计,应该不显著

def placebo_tests(self, outcome, n_placebos=20):    """    安慰剂检验:在假断点处进行RDD估计    真实效应应该只在真实断点处显著    """    placebos = np.linspace(-0.8, 0.8, n_placebos + 1)    placebos = [p for p in placebos if abs(p) > 0.1]  # 排除真实断点    tau_placebo = []    for p in placebos:        rdd = SharpRDD(self.data, 'running_var', outcome, cutoff=p)        tau, _ = rdd.local_linear_regression(bandwidth=0.3)        tau_placebo.append(tau)    # 计算真实效应在安慰剂分布中的位置    valid_taus = [t for t in tau_placebo if not np.isnan(t)]    percentile = sum(t < self.true_tau for t in valid_taus) / len(valid_taus)    return {        'placebo_taus': tau_placebo,        'percentile': percentile,        'passed': percentile > 0.05    }

解读

  • • 真实效应位于安慰剂分布的5%-95%之外 → 效应不稳健
  • • 真实效应位于95%置信区间内 → 通过安慰剂检验 ✓

假设4:带宽敏感性

不同带宽下结果应该稳健

def bandwidth_sensitivity(self, outcome, bandwidths=None):    """    带宽敏感性分析    检验不同带宽下估计结果是否一致    """    if bandwidths is None:        bandwidths = np.linspace(0.1, 0.6, 10)    results = []    for bw in bandwidths:        rdd = SharpRDD(self.data, 'running_var', outcome, cutoff=0)        tau, se = rdd.local_linear_regression(bandwidth=bw)        results.append({            'bandwidth': bw,            'tau': tau,            'se': se,            'ci_lower': tau - 1.96*se,            'ci_upper': tau + 1.96*se        })    return pd.DataFrame(results)

06 可视化

图1:RDD散点图 + 拟合线

def plot_rdd_scatter(data, x, y, cutoff=0, bandwidth=0.3):    fig, ax = plt.subplots(figsize=(10, 6))    # 散点图(透明度显示密度)    ax.scatter(data[x], data[y], alpha=0.2, s=10, color='gray')    # 分箱均值    binned = data.groupby(pd.cut(data[x], 30))[y].mean()    ax.plot(binned.index.astype(str), binned.values, 'o-', color='black', markersize=8)    # 断点线    ax.axvline(x=cutoff, color='red', linestyle='--', linewidth=2)    # 分段拟合线    left_mask = data[x] < cutoff    right_mask = data[x] >= cutoff    # 左侧拟合    x_left = data.loc[left_mask, x]    y_left = data.loc[left_mask, y]    z_left = np.polyfit(x_left, y_left, 1)    ax.plot(x_left, np.polyval(z_left, x_left), 'b-', linewidth=2)    # 右侧拟合    x_right = data.loc[right_mask, x]    y_right = data.loc[right_mask, y]    z_right = np.polyfit(x_right, y_right, 1)    ax.plot(x_right, np.polyval(z_right, x_right), 'r-', linewidth=2)    ax.set_xlabel(x)    ax.set_ylabel(y)    ax.set_title('RDD: Discontinuity at Cutoff')    plt.savefig('rdd_scatter.png', dpi=150)

效果示意

图2:事件研究图

def plot_event_study(data, outcome, cutoff=0):    # 分时间窗口计算均值和置信区间    bins = np.linspace(data['running_var'].min(),                       data['running_var'].max(), 30)    results = []    for i in range(len(bins)-1):        mask = (data['running_var'] >= bins[i]) & (data['running_var'] < bins[i+1])        if mask.sum() > 0:            results.append({                'bin_center': (bins[i] + bins[i+1]) / 2,                'mean_y': data.loc[mask, outcome].mean(),                'se_y': data.loc[mask, outcome].std() / np.sqrt(mask.sum())            })    df = pd.DataFrame(results)    fig, ax = plt.subplots(figsize=(12, 6))    ax.errorbar(df['bin_center'], df['mean_y'],                yerr=1.96*df['se_y'], fmt='o', color='black', capsize=3)    ax.axvline(x=cutoff, color='green', linestyle='--', linewidth=2)    ax.set_xlabel('Running Variable')    ax.set_ylabel(outcome)    ax.set_title('Event Study: No Pre-trend')    plt.savefig('rdd_event_study.png', dpi=150)

效果示意

图3:安慰剂检验分布

def plot_placebo_distribution(placebo_taus, true_tau):    fig, ax = plt.subplots(figsize=(10, 6))    ax.hist(placebo_taus, bins=20, color='gray', alpha=0.7)    ax.axvline(x=true_tau, color='red', linestyle='--', linewidth=2,               label=f'True Effect = {true_tau:.3f}')    ax.set_xlabel('Estimated Effect')    ax.set_ylabel('Frequency')    ax.set_title('Placebo Test: No Effect at False Cutoffs')    plt.savefig('placebo_test.png', dpi=150)

效果示意


07 完整分析流程演示

运行结果

# 生成模拟数据df = generate_rdd_data(n=2000, treatment_effect=2)# Sharp RDD估计rdd = SharpRDD(df, 'running_var', 'outcome', cutoff=0)tau, se = rdd.local_linear_regression(bandwidth=0.3)print(f"估计效应: {tau:.4f} (SE={se:.4f}, t={tau/se:.2f})")# 输出: 估计效应: 2.0362 (SE=0.0310, t=65.64)

结果汇总表

方法
估计值
标准误
t统计量
Sharp RDD
2.0362
0.0310
65.64
Fuzzy RDD (LATE)
2.9108
0.4126
7.06

诊断检验结果

检验
统计量
p值
结论
密度检验
z=1.31
0.19
✓ 连续
安慰剂检验
50%分位
-
✓ 通过

08 论文写作指南

RDD结果的标准呈现

===========================================================表X:断点回归结果===========================================================                    (1)         (2)         (3)                Narrow BW    Mid BW     Wide BW-----------------------------------------------------------断点指示变量    2.04***     2.03***     2.01***               (0.03)      (0.04)      (0.05)样本量          612         1,023       1,456带宽            0.15        0.30        0.45核函数         三角        三角        三角控制变量         N           Y           Y地区固定效应     N           N           Y===========================================================注:括号内为聚类标准误;*** p<0.01

稳健性检验清单

  • • 不同带宽下结果稳健
  • • 不同核函数下结果稳健
  • • 不同多项式阶数下结果稳健
  • • 密度连续性检验通过
  • • 协变量平衡
  • • 安慰剂检验通过
  • • 排除断点附近观测(剪裁估计量)

09 参考文献

Angrist, J. D., & Pischke, J. S. (2009). Mostly Harmless Econometrics

Imbens, G., & Kalyanaraman, K. (2012). Optimal bandwidth choice for the regression discontinuity estimator. REStud, 79(3), 933-959.

McCrary, J. (2008). Manipulation of the running variable in the regression discontinuity design: A density test. Journal of Econometrics, 142(2), 698-714.

Calonico, S., Cattaneo, M. D., & Titiunik, R. (2014). Robust nonparametric confidence intervals for regression-discontinuity designs. Econometrica, 82(6), 2295-2326.

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 15:21:57 HTTP/2.0 GET : https://f.mffb.com.cn/a/490725.html
  2. 运行时间 : 0.145584s [ 吞吐率:6.87req/s ] 内存消耗:4,533.47kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c4d940879249b7c814a5c367eea45e0e
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000749s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000863s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000308s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000278s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000524s ]
  6. SELECT * FROM `set` [ RunTime:0.000250s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000504s ]
  8. SELECT * FROM `article` WHERE `id` = 490725 LIMIT 1 [ RunTime:0.001746s ]
  9. UPDATE `article` SET `lasttime` = 1783063318 WHERE `id` = 490725 [ RunTime:0.018391s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000372s ]
  11. SELECT * FROM `article` WHERE `id` < 490725 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000642s ]
  12. SELECT * FROM `article` WHERE `id` > 490725 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004457s ]
  13. SELECT * FROM `article` WHERE `id` < 490725 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004759s ]
  14. SELECT * FROM `article` WHERE `id` < 490725 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.014142s ]
  15. SELECT * FROM `article` WHERE `id` < 490725 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.007859s ]
0.147396s