Compute standard error from beta, p-value, sample size, and the number of regression parameters How do I compute the standard error if I only know the p-value, the beta (i.e., the regression coefficient from a linear regression), the sample size, and the number of regression parameters? 
 A: In a linear regression, the $p$-value is calculated from a $t$-value, which is the coefficient divided by its standard error ($t=\hat{\beta}/\mathrm{SE}_{\hat{\beta}}$). The degrees of freedom used in the $t$-distribution for calculating the $p$-value are the residual degrees of freedom ($\mathrm{SE}_{\hat{\beta}}=\hat{\beta}/|t|$). The residual degrees of freedom, on the other hand are the total degrees of freedom of the variance $N-1$ minus the model degrees of freedom $k-1$, where $k$ is the number of parameters including the intercept. So the residual degrees of freedom are $(N-1)-(k-1) = N-k$.
From this, you can use the quantile distribution of the $t$-distribution to calculate the standard error. Example: Assume that $\hat{\beta}=5.47, p = 0.004, N = 100, k = 4$. The residual degrees of freedom are $100-4 = 96$. We assume that the $p$-value is two-sided.
Using R, the calculations are:
t_val <- qt(0.004/2, df = 96) # Calculating the t-value using quantile function
5.47/abs(t_val) # Calculating standard error
1.854659

So the standard error was 1.85.
