10

Neither. An estimator is consistent for some parameter, so in this case the answer is Yes, $\hat\gamma_2$ is consistent for $\beta_2$ No, $\hat\gamma_2$ is not consistent for $\gamma_2$ (or for $\beta_0$ or lots of other things). In this case, the causal assumptions suggest you'd be more interested in whether it was consistent for $\gamma_2$, but you still ...


7

This is a commonly misunderstood property of the lognormal. If $$ y \sim \operatorname{lognormal}(\mu, \sigma^2)$$ Then $E(y) = \exp(\mu + \sigma^2/2)$. This is the expectation of the lognormal random variable. If you want the median, you want $\exp(\mu)$. Remember, $\mu, \sigma^2$ are the parameters of $\log(y)$, not $y$. So, if you want to report the ...


6

Here's a partial answer for when the underlying model is actually linear. Suppose that the true underlying model is $$Y = \alpha + \beta X + v.$$ I'm making no assumptions about $v$, though we have that $\beta$ is THE effect of $X$ on $Y$. A linear regression for $\beta$, which we will denote as $\tilde{\beta}$ is simply just a statistical relationship ...


6

I think a lot depends on what the purpose of the model is. Inference or prediction ? If it is inference then you really need to incorporate some domain knowledge into the process, otherwise you risk identifying completely spurious associations, where an interaction may appear to be meaningful but in reality is either an artifact of the sample, or is masking ...


6

Following up on Dimitriy's comment, which I agree with. There are (at least) three sources of uncertainty when performing a propensity score matching analysis: 1) the estimation of the PS, 2) the matching, and 3) sampling variability. I have been writing a review of uncertainty estimation after matching so I'll briefly share those findings here. The way ...


6

I would recommend Seber & Lee (from which I originally learned regression.) Cover most of your topics with proofs. An alternative in the same style, but also covering glm's is Linear Models and Generalizations : Least Squares and Alternatives by Rao et al. A shorter book with a more geometric viewpoint is The Coordinate-Free Approach to Linear Models by ...


5

Challenge The approaches are the same...except for this little issue where the default form of t-testing in some software (I know in R, maybe in Python SciPy, etc) is the Welch t-test that makes an adjustment to the testing to account for possibly different variances of the two groups. Welch testing is usually considered superior to the classical t-test, ...


5

Via substitution and some matrix algebra: $$\begin{align}\operatorname{var}(\hat\beta)&=\mathbb E[\hat\beta\hat\beta^T]-\mathbb E[\hat\beta]\mathbb E[\hat \beta^T]\\&=\mathbb E[(X^TX)^{-1}X^Tyy^TX(X^TX)^{-1}]-\mathbb \beta\beta^T\\&=(X^TX)^{-1}X^T\mathbb E[yy^T]X(X^TX)^{-1}-\beta\beta^T\\&=(X^TX)^{-1}X^T(\sigma^2I+X\beta\beta^TX^T)X(X^TX)^{-1}...


5

This sounds like a great job for GAMs via the mgcv package. Use a penalized smoothing spline to estimate $g$ and add an additive effect of $X$. The model would look like gam(y ~ x + s(z). library(mgcv) #> Loading required package: nlme #> This is mgcv 1.8-31. For overview type 'help("mgcv-package")'. z = rnorm(1000) x = rnorm(1000) y = 2 + ...


5

I think that you might be interested in Stachurski (2016) A Primer in Econometric Theory. The book is quite mathematically oriented. The book is organized into 3 sections: Background - which is all about pure mathematical foundations; vector spaces, linear algebra and matrices, foundations of probability, modeling dependence, asymptotics etc. Foundations ...


4

Is a Mixed Model Appropriate for Repeated Measures of Multiple Covariates? Yes, you have repeated measures within subjects, and you are not interested in specific subject effects, so a mixed model is appropriate for modelling these data. There are a few things to note here. The structure of the random effects in the two models are not equivalent. The lme ...


3

The only benefit of na.exclude over na.omit is that the former will retain the original number of rows in the data. This may be useful where you need to retain the original size of the dataset - for example it is useful when you want to compare predicted values to original values. With na.omit you will end up with fewer rows so you won't as easily be able to ...


3

Model.2 doesn't make much sense because you are asking the software to estimate random intercepts for Subject three times. That is because: (1|Subject) + (X1|Subject)+ (X2|Subject) is the same as: (1|Subject) + (1 + X1|Subject) + (1 + X2|Subject) where the 1 in each term specifies that you want random intercepts for the term on the right side of the |. The ...


3

You already are approximating $f$ using the derivative. If $\Delta x$ and $\Delta y$ are both "small", then $\Delta x \Delta y$ will be "very small," i.e. $\Delta x \Delta y \approx 0 $ and hence $$ (\beta_1 + \beta_3y)\Delta x + (\beta_2 + \beta_3 x)\Delta y + \beta_3 \Delta x \Delta y \approx (\beta_1 + \beta_3y)\Delta x + (\beta_2 + \...


3

I don't think you really need to calculate the inverse for the purpose. Substitute $\nabla L$ to the update function, you get $$ \begin{align} \theta^{(t+1)} &= \theta^{(t)} - H^{-1} \left[ (X^t X + \lambda I_n) \theta^{(t)} - X^ty\right] \\ &= \theta^{(t)} - H^{-1} H \theta^{(t)} + H^{-1} X^ty \\ &= H^{-1} X^ty \end{align} $$ This is the closed ...


3

NO, there is only one intercept in the model, with only one value. It is not clear from where your misconception comes, but from the algebra $$ y_i=\beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} +\dotso +\epsilon_i $$ which is the multiple linear regression model, the constant term (intercept) $\beta_0$ has only one index $_0$, is only one symbol, and can only ...


3

This model is a partially linear regression models, and in your case, $g(Z)$ is a nuisance parameter. See page 62 of this link for a primer on the subject. Of especial note in application is Robinson's Transformation (Section 7.7 on page 62 of the linked file). Inference is particularly tricky in these settings, since it's hard to say anything about the ...


3

The range is $[max(t_1, t_2),\ min(t_1+t_2, 1)]$. Of course you can't obtain a $R^2$ lesser than $t_1$ or $t_2$, because $R^2$ always increases when you add variables. Also, you can't have any $R^2 > 1$, but there's more to it, let's see... In order to compute the value of $R^2$, you must decompose the total sum of squares of $Y$: $SS_Y$. This amount ...


3

Rewrite your linear predictor $\eta(x_1,x_2)=\beta_0+\beta_1 x_1 + \beta_2 x_2$ as $\eta(x_1, X_2)=\beta_0+\beta(x_1+x_2)+(\beta_2-\beta) x_2$. In this model you test the null hypothesis $H_0\colon \beta_2-\beta=0$ versus the alternative $\beta_2-\beta <0$. In practice, I would do that fitting the full model and making a confidence interval based on ...


2

Causal interpretation of the one-equasion regression is indeed derived from the strict exogeneity of all the variabes: $E(\varepsilon|X)=0$. Consistency of an estimator is proven under this assumption, I do not think there is a need to discuss it. This however, is derived from other assumption: that we fully know structural model (DGP). This assumption is ...


2

Generally, second version is the default version. If you consider the effect of two dummy variables, you should include them in the model. Then you think of the interaction. However, if you may have additional information (from the theory), that the interaction could be important in the model, but the variable itself is not. In this case you can think of ...


2

@chl is right. I added it to to the function output to remind persons what hypothesis they are testing because it is often not clear what the alternative ($H_A$) and the null hypothesis ($H_0$) is. So it just tells you what the null hypothesis is and nothing about the acutal result. p < 0.05 means that $H_0$ can be rejected. So in your case the parallel ...


2

These are different methods to estimate parameters, however they are related. The Gaussian (normal) distribution in particular has $(x-a)^2$ as a term in the loglikelihood, which means that maximising the likelihood over $a$ for independent observations (involving a product of the densities that becomes a sum after taking the log) amounts to minimising the ...


2

The answer is simpler than it seems. Though the sample mean in the simplest case, or least squares estimates in the multivariable predictor case provide unbiased estimates of the long-run mean, these estimates can be wrong or highly inefficient. In the case of a simple mean, i.e., when there are no predictors X, if the sample comes from a log-normal ...


2

Linear regression will not be suitable for a multilevel model. A mixed effects model is a good way to fit most multilevel models. In python you can use mixedlm in statsmodels. For example: In [1]: import statsmodels.api as sm In [2]: import statsmodels.formula.api as smf In [3]: data = sm.datasets.get_rdataset("dietox", "geepack").data ...


2

The constant term can be omitted if there is a strong reason to expect that the dependent variable has conditional mean zero at the average value for all covariates. Having said that, having a zero mean for residuals per se is insufficient to assess whether the OLS regression is well specified or not. There are a battery of tests and analyses can be ...


2

After some discussion in the comments, I don't think you can discard the idea of fitting a mixed model based on the plots that you have described. The study design is reasonably complex and the proposed model: S ~ G * W + (G*W | subject_id) + (G*W | item_id) ...is likewise quite complex. In order to discard the idea of fitting a mixed model you would need ...


2

An alternative approach (I agree it is devious, bit it is also interesting) is to transform your function $$y=\beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3x_2^2 + \epsilon$$ into $$y=\beta_0 + \beta_1 x_1 + \beta_2 \frac{x_2}{3} + \beta_3(x_2-2)(x_2-5) + \epsilon$$ This is the same quadratic polynomial but now you have $\hat{y}_{x_2=5} - \hat{y}_{x_2=2} = \...


2

After the edits, I think the only remaining source of confusion is that is the prediction on the log scale, so instead we can write $$ \begin{align} \ln(\hat{b}) &= -4.40680302+0.00149165363 t \\ \hat{b}&=\exp(-4.40680302+0.00149165363t) \\ &= \exp(-4.40680302)\exp(0.00149165363t) \\ &= \hat{A}\exp(\hat{\beta} t) \end{align} $$ As for your ...


2

You can use the ROC curve to find what threshold that should be used for classification, depending on how you value Type 1 and Type 2 errors. Generally, you want the area under the curve to be as large as possible to maximize both sensitvity and specificity, that is what is referred to as the AUC value. Regarding the workflow, I would use AUC as a means to ...


Only top voted, non community-wiki answers of a minimum length are eligible