instruction stringlengths 9 38.7k |
|---|
I would like to match firms on industry , total assets and few other variables using propensity matching score or any other matching technique but problem is companies adopted policy at different time and baseline period(1 year before policy adoption) will be different for different companies so using psmatch2 etc. Or ... |
I am reading this paper "Model selection and estimation in regression with grouped variables," by Yuan and Lin. At some point, they show this expression
$$\beta_j = \left(1 - \frac{\lambda\sqrt{p_j}}{\|S_j\|}\right)_+ S_j$$
for the estimate $\beta_j$. I understand the expression inside the parentheses is a number, but ... |
I am comparing plant community responses to experimental treatments using the pairwise.permanova function in R.
However, there are no clear answers regarding which p-value adjustment is good for this sort of analysis. I have seen several folks casually say the Benjamini-Hochberg adjustment, but with little justificatio... |
After running the model:
mod16.5 = glmer.nb(Richness ~ (0 + Buffer + Area_MN_Woody + Area_MN_Herbaceous +
PD_Herbaceous + LPI_Woody)^3 + (1 | Classification/Site), data = dat_3)
I get the outcome
Buffer1km ***
Buffer200m ***
... |
That is,
if $G$ is the distribution of the sample, what does it test:
\begin{align}
\mathcal H_0 : G(x) = F(x) && \mathcal H_1 : G(x) = F(x - \theta), \theta \neq 0
\end{align}
where $F$ is some fixed continuous distribution with median $0$,
or
\begin{align}
\mathcal H_0 : G(0) = 1/2 && \mathcal H_1 : G(0) \neq 1/2
\en... |
Suppose that we have an autoregressive process with order 1:
$$y_t = a + {\alpha}y_{t-1}+u_t$$ for $t>k$, where $k$ is a positive integer and $\alpha \in (0,1)$. And, $$y_t = b + {\alpha}y_{t-1}+u_t$$ for $t\leq k$. And assume that $a$ and $b$ are two different real constants. $u_t$ are iid with mean $0$ and a variance... |
When doing effect/sum coding in linear regression (which AFAIK are the same), the contrasts are coded as:
condition1
condition2
condition3
condition1
1
0
0
condition2
0
1
0
condition3
0
0
1
condition4
-1
-1
-1
Then, in the output of the model in e.g. R, we only get confidence intervals and p-values for... |
I am looking for help to calculate a CDF for a multinominal distribution function. (I'm strictly using Excel)
I have figured out, how to calculate the bivariate distribution, but seems to be a lot more complicated adding more dimensions.
I have 5 variables.
|
Statistics
Text
Phone
App
In person
Overall
Sample Size
248
36
67
94
445
Mean
99.8
109.6
40.6
46.8
80.5
Standard Deviation
135.7
126.2
85.6
85.6
122.0
I expected
df
SS
MS
F
Groups
3
336655.5
112218.5
7.889
Error
441
6272849.6
14224.1
Total
444
6609505.2
My code gives me
F is7.88305116592... |
Lets say that we are presented with two gambling opportunities and would like to decide between them in a decision-theoretic framework.
For gamble 1, the cost is $1$ and the payoff is $X_1$ where $X_1 \sim \text{LogCauchy(0, 1)}$.
For gamble 2, the cost is $1$ and the payoff is $X_2$ where $X_2 \sim \text{LogCauchy(0, ... |
The correlation matrix of my data set shows that two variables are highly correlated with a correlation value of 0.84. Vif of variable1 is 4.469 and variable2 is 4.347. Will this create a problem?. Can I consider them for my study?.
|
Setup
Consider two trees grown with rpart() from the rpart R package, in which the only thing that changes is the minbucket argument.
Using the same data, I do not understand why some split is not performed on a given node despite a potential split seems possible. By lowering the minbucket argument, the resulting split... |
I have a dataset with repeated measurements among participants (subjects). Each subject is tied to a site (Iowa, Kansas, Tennessee, ....). A subject can only be in one site and does not appear in two different sites. A participant is only in one state and cannot appear in two states at the same time.
My goal is to:
a) ... |
I have this mixed effects logistic regression model. All the predictors are categorical (I need to maintain also age categorical, not as a continuous variable). The predictors are codified with orthogonal sum to zero contrasts. However, I have a problem of near to perfect separation of data.
mod<- glmer(score ~ 1 +age ... |
I would like a model to learn a function $f(x) = y$ based on some data, but suppose that I only know the true value in small batches. More precisely, each training sample consists of $x_1,\ldots,x_n$ for some $n$ (which can vary) and I only know the value of $y_1+\cdots+y_n$.
My goal would be to have a function $f$ whi... |
I am trying to clarify my understanding of establishing a causal effect, as mentioned in textbooks/online resources that I am reading.
Is the following a correct understanding?
To identify a causal effect of X on Y, we need to justify:
The direction of causality, i.e. that it's indeed X->Y
A ceteris paribus effect to ... |
I'm reading about one-class SVM in wiki here: One-class SVM. One-class SVM attempts to learn $r$ and $c$ to fit a hypersphere to the dataset. The formula for assigning labels is:
$$sign(r^2 - ||\phi(x) - c||_{2}^2)$$, where $\phi$ is transform training set $x$ to higher-dimensional space
But I am not really sure about ... |
I am using MMRM in R. My response variable is a score and my fixed effects are base, group, visit, and group*visit. My code is as follows;
SOFA_mmrm <- mmrm( formula = Sofa_score~ base + GROUP + visit +
GROUP*visit +
us(visit | DSRANDI),
data = sofa_add,
reml = TRUE, control = mmrm_control(method = "Kenward-Rog... |
Following a suggestion of Cosma Shalizi (https://www.stat.cmu.edu/~cshalizi/TALR/TALR.pdf, page 368)
I am trying to build an iterative weighted least square fit, but for a regression with two predictors (instead of one predictor, as described).
The central idea of the method is to weigh the predictor(s) by the associat... |
I'm trying to determine whether the above statement is true or false, and provide a short proof. My instinct is that this is false, and I just need a simple counterexample.
|
I attempted to understand the computation of the Fisher's exact test through programming using this formulation:
The Fisher exact test computes the p-values by finding the probabilities of all possible combinations of 2 × 2 tables that have the same marginal totals (the values in cells m, n, r, and s) that are equal t... |
I have an empirically derived frequency curve.
From the curve, I aim to model counts per unit time. The x-axis is diameter, and the y-axis the likelihood of observing the diameter per one year. I have approached this as arising from a Poisson process to model counts. However, the challenge I experience is defining bin... |
I sometimes have to perform sample size calculations during the planning of a study. For some of these calculations, a correlation coefficient is needed as input. In my experience, the experts involved find it quite tricky to translate their experience into realistic values for the correlation. That's why I'm intereste... |
Given a log-density function $\mathcal{L}f_{X}(x)$ of an 1d continuous random variable $X \in \mathcal{L}^{\infty}$ and an 1d polynomial function $h: \mathcal{I}(X) \to \mathbb{R}$, the expected value of $h(X)$ is defined as follows:
$$
\mathbb{E}[h(X)] = \int_{\mathcal{I}(X)} h(X)\exp{\mathcal{L}f_{X}(x)}dx \equiv \i... |
There's a group operation, at least of sorts, in Fractional Factorial design that I'm trying to understand. For definiteness, let's say we have 3 factors; A,B,C , at two levels each . Please critique my understanding. We assume Sparsity of Effects, so that the compound ABC is insignificant. Then we somehow set ABC=1. J... |
I'm new in fitting multivariable Cox models w/ restricted cubic splines.
This is my code:
d <- datadist(df)
options(datadist = "d")
mod_full <- cph(Surv(time, status) ~ rcs(age, 3) + sex + weight, data = df, x = TRUE, y = TRUE, surv = TRUE)
mod_full
summary(mod_full)
anova(mod_full)
However, I'm not quite sure how t... |
I am estimating a Fay-Herriot model in a small area estimation using a survey data set with information on a current sample and information on the sample taken in the prior year. It is specified similarly to this notation
=++
here is a direct estimator of a certain parameter , for a certain small area , =1,…, where th... |
I ran an experiment with three groups (one control, two experimental). Now, I am analysing the results.
I ran:
a regression analysis (with dummy coded groups, control group put as the contrast)
two t-tests (control vs experimental 1 and control vs experimental 2)
What surprised me is that the results are not the same... |
Context:
I am a software developer and recently we've had a bug report saying that one of our login systems are potentially insecure to a brute-force attack. I need to come up with a formula to calculate the success rate given X attempts, and vice versa, to accurately determine the current risk of our login system.
The... |
In small area estimation, the EBLUP (empirical best linear unbiased prediction) method is used for linear mixed models.
From this article on EBLUP: "A basic area-level model, called the Fay-Herriot (FH) model, is often used to obtain efficient estimators of area means when the sample sizes within areas are small. This ... |
In Equation 2 of Vehtari (2016), the log pointwise predictive density is defined as
$$
\text{lpd}
= \sum_{i=1}^n \log p(y_i | y)
= \sum_{i=1}^n \log \int p(y_i | \theta) p(\theta | y) \text{ d}\theta
$$
I think I'm missing something obvious but this isn't easy to search.
Why is
$$
p(y_i | y)
= \int p(y... |
I understand the r2 metric, being 1- (rss /tss)
where rss = sum of squared residuals
and tss = total sum of squares
I understand how to weight this, such as when each row is a population, and some populations have a large number of samples and some have few (or some rows are just more important). If we have a weight f... |
I have a function Y = constant + Beta I-Spline(X). All the Beta are > 0, and I use i-splines (integral of M-spline), which guarantees that f(X) = beta*I-Spline(X) is strictly increasing in X. I wonder if there is a way to INVERT f(X) (e.g., a closed form formula for the inverse, given the beta - or if not a closed form... |
Assume a study comparing fingernail length to incidence of fungal infection. Ultimately, the goal is to determine a maximum length to propose for use by animal care takers.
One proposed approach: 1st perform a regression (# of individuals with fungus ~ nail length) to determine if there is a linear trend. If the trend ... |
Let us suppose that we are implementing a data processing pipeline based on LLMs and, in some part of the process, we need to search the internet for finding relevant information regarding some topic, in a way that the LLM can use the retrieved information from the internet as context for building its response. How can... |
From my understanding, kNN imputation is dependent on the variables where any two cases do not have missing values. Thus, would it be ideal to do feature selection before or after imputation?
|
I want to check if what I have for the equation for the second-order model relating y to 2 quantitative and 1 qualitative variables (3 levels) is correct:
$\mathbb{E}(y)= \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 + \beta_4x_1^2 + \beta_5x_2^2 + $
$\beta_6x_3 + \beta_7x_4 +$
$\beta_8x_1x_3 + \beta_9x_1x_4 + \bet... |
I am performing PCA analysis of NIR spectra for the analysis of the progression of a film coating process
I have noticed that one of my components goes up with the film coating process (with upwards loadings mirroring the entire spectrum) while the other goes down during the progression of the film coating process (wit... |
Say we have a linear regression model
$$
y_i = x_i^T\beta + \sigma\varepsilon_i
$$ for $i = 1, \dots, n$, and $\varepsilon_i$ is distributed according to a Laplace distribution $\mathcal{L}(0, 1)$ with density $f(\varepsilon) = 2^{-1}e^{-|\varepsilon|}$, then what are the MLE estimators for $\beta$ and $\sigma^2$?
So f... |
Are there more recent resources and texts that you would recommend on small area estimation, and applications/examples using statistical software like R?
|
I am reading the Bad COP section on https://matheusfacure.github.io/python-causality-handbook/07-Beyond-Confounders.html#bad-cop. I am confused if
$$
E[Y|T = 1] - E[Y|T = 0] = \\
E[Y|Y > 0, T = 1]P(Y > 0|T = 1) - E[Y|Y > 0, T = 0]P(Y > 0|T = 0)
$$
is mathematically correct, then why can't we calculate $E[Y|Y > 0, T = ... |
I've got two year's worth of energy data in 15 minute increments, and need to develop a similarity score for a forecasted day i.e. identify past days that are similar to the forecasted day.
I started by splitting the initial dataframe into a list (called trading_days below) of 730 dataframes (one dataframe for each 24 ... |
I am doing a simulation with longitudinal curves. These curves are generated from $y=2x$ and $y=\cos(2\pi x)$ where $x$ is from $0$ to $1$. Noise is added to each curve, so $20$ curves are generated from each, resulting in a total of $40$ curves. I am trying to recover the original curves from those curves with noise. ... |
Consider a simple linear mixed effect model (LMM)
$$Y_{ij}=b_{i}+X_{ij}\beta+\epsilon_{ij},$$
where $b_i\sim N(0,\sigma_b^2)$, $\epsilon_{ij}\sim N(0,\sigma_e^2)$.
Typically, one can estimate $\sigma_b^2,\sigma_e^2$, then use the Hessian matrix to calculate the confidence interval of $\beta$.
I am thinking another way,... |
To optimize a probabilistic model with latent variables, I was trying to convince myself that there are situations where computing the marginalization $p(x)$ is intractable and computing the $Q(\theta | \theta^{t})$ in the E step of the Expectation Maximization is tractable, so that the EM algorithm is useful.
Borrowin... |
I am currently doing collocational analysis in the Russian National Corpus, to be precise the Russian national news subcorpus, to see what is the most significant collocates of the lemma "gay".
In doing the analysis, I will be using the "logDice" association measure by Rychlý (2008), with this following formula:
$$
\te... |
Hello,I have problems understanding the proof for the expected value of geometric distributions.
I don't know why the bound upper is set to infinity? For binomial distributions, the upper bound of sigma is n, a finite value...what has changed??? Why put infinity instead for geometric?
I also didn't understand whether ... |
I'm perplexed as to why my loss doesn't go up when the accuracy goes down (after about 40 epochs). Isn't it possible to tell overfitting from the loss curve alone? (I'm of course referring the validation learning curve.)
Could someone please explain?
PS: I'm using "binary crossentropy" as the loss function in this part... |
The odds for logistic regressions can be computed as:
$$e^{x_i^{T} w}$$
If we thus only vary one regressor by one unit (e.g. a dummy variable) while holding constant the other variables, the odds ratio from comparing two observations yields:
$$e^{w_i}$$
But is there also a possibility to calculate the respective odds r... |
In Stange (1971), Angewandte Statistik, Vol. II. Springer Verlag, Berlin, Heidelberg,
New York, 141-143, the author derives a tolerance limit for simple linear regression which is widely used in finding withholding periods for food safety standards. Unfortunately (for me) the text is in German and the mathematical nome... |
We aim to employ a permutation test to evaluate the significance of the relationship between two datasets using Sparse Canonical Correlation Analysis (SCCA) for a specific level of sparsity. To achieve this, we randomize the two datasets, ensuring that the relationship between them varies and becomes stochastic with ea... |
I have analyzed some secondary data that relates to Plasmodium infection at three forest sites: inside the forest, at the forest fringe, and outside the forest.
The outcome variable is infection with Plasmodium parasites. I have about 60 variables (individual and household variables) of interest that I have analysed fo... |
For a Bayesian estimation problem that I am working on, where I update the log-posterior (many times based on data) instead of the posterior itself using Bayes rule. I find the following (rather convoluted) form of the log-posterior distribution
$$\text{lpos}(x) := -49949 \log(2) + \log(\exp\{-(1/8) (x-2)^2\}/(2 \sqrt{... |
I'm running OLS regression in stata with 5-6 IVs (all dummy variables) and a DV (continuous). Does it make sense to check for outliers (e.g., I can't run scatter dv x1 x2) in this case?
Also, is it necessary to check for outliers in the DV? Thank you very much.
|
I have done a mediation analysis in which nature contact is the independent variable, worrying is the mediator and depressive symptoms the dependent variable. I performed a mediation via PROCESS.
The results were:
The total effect of nature contact on depression is significant (c path)
The a path: nature contact on wo... |
I want to understand predictors of wine spending. Below are the results of my model. I can see they are all significant predictors apart from marital status.
The question I have is how can I best understand the meaning of the b coefficient (Estimate)?
For example if I wanted to use the b coefficient of Age to understan... |
Consider a dataset, $\mathcal{D} = (X,Y)$ consisting of points in input space and ground truth values. The regression model; $y_i = f(x_i) + \varepsilon_i$ where $\varepsilon_i \sim \mathcal{N}(0, \sigma^2)$ is a GP regression model if we endow a $0$-mean $\mathcal{GP}$ as prior distribution over the entire function sp... |
I am investigating the effects of Variable X on Y'. Y' is a bounded, non-negative integer. So I have divided Y' by its upper bound to obtain a fraction Y which is in [0,1].
I am following a study where the investigated the effects of X on Y using a fractional logit regression.
However, I am unsure on what diagnostics a... |
I'm writing a research paper and considering the following settings:
There are three discrete variables which construct a simple causal graph: Treatment T, outcome Y, and confounders U. Here we have the classical causal path {T, U}->Y, U-> T.
We consider the following setting: We only have the marginal distribution of ... |
In statistics, the hypothesis testing is used for determining whether the null hypothesis can be rejected or failed to reject. For example, we use hypothesis testing in order determine the significance of the estimator in linear regression:
$H_0: \beta_1 = 0 \ \ \ H_1 : \beta_1 \neq 0$
My question is the approach of hy... |
I have an example code in python to make the question more clear. I have data from different groups (person1, person2, and person3) and multiple measurements for each group.
I want to report statistics that describe all people. I find that the mean of the group means to be intuitive along with the standard deviation of... |
Suppose
$\hat{\theta}_n$ is the estimator obtained by solving $g_n(\theta) = 0$
$\tilde{\theta}_n$ is the estimator obtained by solving $h_n(\theta) = 0$
If $g_n(\theta) = h_n(\theta) + o_p(n^{\alpha})$
Can I conclude that $\hat{\theta}_n = \tilde{\theta}_n + o_p(n^{\alpha})$ ?
If not, on what condition can I make this... |
I would like to understand better the closed-form solution of the linear regression.
If I understood correctly, we are coming from the following equation:
$$ y=w_0 x_0 + w_1 x_1 + ... + w_n x_n = \sum_{j=0}^{n} w^T_j x_j $$
We like to calculate the parameters $w$, so we can make predictions for new values of $x$.
To ca... |
I have 3 normal data matrices, i.e., that in each matrix, the rows are iid Multivariate Normal, but the rows of different matrices need not be identically distributed, but they have the same dimension. How can I go about testing if the 3 matrices are independent i.e., each row in a matrix is independent of any row of t... |
In Andrew Gelman's book "Data Analysis using Regression and Multilevel/Hierarchical Models" , page number 258
group $j$ random intercepts $\alpha_j$ is estimated based on this expression
$$\alpha_j = \frac{n_j/\sigma_y^2} {n_j/\sigma_y^2 + 1/\sigma_{\alpha}^2} (\hat{y_j} - X_j{\beta}) + \frac{1/\sigma_{\alpha}^2} {n... |
Good afternoon.
My task was to make a logistic regression model for a dataset to predict a binary variable (0/1). During this process I went through all of the stages of model building, from scratch given unprocessed data with missing values, which I then performed EDA on and after testing found a final model. I now ne... |
In the context of estimators, why is it that in general dividing by the degrees of freedom(instead of the sample size) leads to unbiasedness? I see the value in substituting degrees of freedom for sample size for an unbiased estimator in small samples but I don't get why it works.
|
I am testing for cointegration relationships using various procedures, including bounds cointegration, which I am not very familiar with, both in terms of theory and application. I am currently using the dLagM package in R.
I believe the ardlBound function in this package performs the first step of Pesaran et al. (2001... |
Suppose I was trying to explain what $\chi^2$ is and why it's important to my grandma. I want to give core intuition to this formula:
$$\chi^2 = \sum_{i}\frac{(O_i-E_i)^2}{E_i}$$
I would tell her that the aim is to measure the discrepancy between what is known/observed in the real world (observed values $O_i$) and wha... |
I am trying to fine tune a transformer LLM but I keep running out of memory during the optimize.step() part. I have around 20~GiB RAM being used up until the optimizer step and then I immediately get CUDA OOM even though my GPU has >40GiB RAM.
I am trying to understand why. How does adam optimizer memory usage grow wit... |
I have run three non-hierarchical LME models testing how certain variables predict ratings.
self <- lmer(rating ~ own_pref + (1|subject) + (1|image), REML = FALSE, data=td_pref1)
summary(self)
kid <- lmer(rating ~ mean_p2 + (1|subject) + (1|image), REML = FALSE, data=td_pref1)
summary(kid)
adu <- lmer(rating ~ mean_... |
Let's say that we have a real-valued observed time series of length $T$:
$$\\{ (t_i, x_{t_i}) : i \in \\{0, \dots, T-1\\} \\}, x_{t_i} \in \mathbb{R}.$$
We would ultimately like to probabilistically predict future values of the time series from lagged values of the time series.
Is the following a valid methodology to d... |
I did chi square test for independence and Cramer’s V test.
I’m having problems with interpret the results.
I checked if there is a connection between gender and dropping out of school (in SPSS).
My H1 assumption is of course that there is a connection.
In the chi square test, under significance it showed <.001 - which... |
Checking overfitting with cross-validation set metrics for hyperparameter tuning and model selection
I have basically considered a set of models and pre-processing steps to tune the hyperparameters for model selection and hyperparameter tuning, using 75% of my data (the train set), with some validation sets (5 in total... |
I've tried searching but I cannot even find a definition for a "precision interval" anyway. I am completing a meta-analysis and the package in R that I used to create my figure put both precision and confidence intervals on. The precision intervals stretch longer than the confidence interval's and I have absolutely no ... |
I am really struggling to recreate both figures. I am coding in R.
For example for the squared bias my idea is the following:
What we are interested in in theory is
$
E_X[Bias(f^{(T,X)})] = E_X[f(X) - E_T(f^{(T,X)})] \quad (1)
$
Where $f^{(.,.)}$ is our random forest.
Now at a fixed $x$:
$
Bias(f^{(T,x)})=f(x)-E_T(f^{(... |
The authors in the article mention that,
The subgroup analysis was conducted using a univariate logistic regression
model, fitting separate models for each subgroup to assess the
association between the primary outcome and a single variable.
In the Figure 3 below are the results of the subgroup analysis :
I suppose ... |
A general question raised during my study.
For example, we are estimating the effect of X on Y at individual level. Then it is intuitive for me to add state fixed effect and year fixed effect in the regression.
$Y_{it} = X_{it} + \mu_{s} + \mu_{t} + \epsilon_{it}$
While in a lot of papers, people also add the interacti... |
Let $X\sim F(x)$ be a (univariate) random variable defined by distribution function $F$. If the expected value exists, it is equal to $
\mathbb E[X] = \underset{\mu}{\arg\min}\left\{\mathbb E\left\vert X-\mu\right\vert^2\right\}
$.
However, the expected value does not have to exist.
What conditions are there on the exp... |
I am working on a hypothesis test dataset that has "total spend" as the outcome metric. When I look at the distribution for this metric (dataset is at the user level and randomization is user level), I see about 30% of users in control and test groups have 0 orders and 0 spend. This makes the distribution non normal. W... |
Given a time series of log returns $R_t$ with significant autocorrelation up to $k$ lags, what is the formula for the standard deviation of $R_t$ that accounts for this autocorrelation?
I've seen the following formula which appears related to NeweyWest:
$ \sigma_{adj} = \sigma \sqrt{\frac{1 + 2\sum_{i=1}^k \rho_i}{n}} ... |
I have read a lot about calculating raw (standard) means and EMM. First are data based (descriptive stats), the latter are model based. I try to learn how to calculate both of them. In my example both results are equal. Variables Message and Relevance are factors with two levels.
What did I do wrong ?
Here is my code:
... |
I'm currently learning about neural networks and stumbled upon a confusion related to the use of Stochastic Gradient Descent (SGD) in training. Specifically, I'm puzzled about the computation of the partial derivative of the cross-entropy loss with respect to the predicted probabilities. Here's where my confusion lies:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.