# All Questions

134,563 questions
37 views

### How do I handle terms with collinearity?

I'm working on a regression model with the Hitters data from the ISLR package. It has ~300 observations and 20 variables. I want to predict a player's salary. I have major problems of collinearity ...
14 views

### Would like a double check on expected value & variance problem

If a student randomly chooses the answer to two multiple choice questions, where the first question has 3 possible answers and the second has 5, find: 1) $E(X)$ 2) $Var(X)$ For 1, I believe the ...
7 views

### Help with cox regression (survival analysis)

I had a few questions about analyzing my data via cox regression. Relatively simple data: the effects of rainfall amount and frequency on survival of tadpoles in small ponds. Not too sure if this is ...
11 views

### Synthetic control and unobserved confounders

The synthetic control (cohort) method is a very promising approach to causal inference that has been used in a number of interesting studies. It's particularly useful in situations where data are only ...
10 views

### How can I interpret relative and absolute income of both partners in one regression?

Suppose you want to examine the effect of income on the amount of housework for women. Does it make sense to include both relative income (compared to partners income) and absolute income of BOTH ...
22 views

### Replicating a wrong analysis

A study measures the performance of patients and controls in two tasks. In task 1, a t-test reveals no significant differences between patients and controls. In task 2, a t-test reveals significant ...
13 views

### When should we use the segregated as opposed to the aggregated data?

In the book "Causal Inference In Statistics" by Pearl et al., there is the following problem (study question 1.2.2.) A baseball batter Tim has a better batting average than his teammate Frank. ...
23 views

### Determine spread of data for non normal distribution

I've collected data from 12 sensors, the sensors are sampled at various times, mounted in one of three orientations and at different temperatures. I'm trying to determine the maximum and minimum ...
11 views

### How to obtain a trend estimate using only ols?

I have data on $y$ and $t$ and I want to estimate the trend in $y$ that is supposedly given by relation $y=a(1-b e^{t/τ})$. I want to use linear regression on some transformed version of the model in ...
31 views

### The form of the Log-Likelihood Function in Mixed Linear Models

Let us assume the following mixed effects model: $y = X\beta+Zu+e$ where $y$ is a vector of n observable random variables, $\beta$ is a vector of $p$ fixed effects, $X$ and $Z$ are known matrices, ...
5 views

### How does training affect the norm of weight matrices?

I have a neural network $F(W,x): \mathbb{R}^d \rightarrow \mathbb{R}^k$ with $L$ layers, $m$ neurones per layer, ReLu activation, softmax on the last layer and $n$ datapoint. My loss function is the ...
22 views

### Expectation, variance and autocorrelation of a “complex” AR(1) function

I'm preparing the exam for "stochastic models" and I encountered this exercise which is giving me a lot of problems: Let $$X_t=\phi X_{t-1}+\epsilon_t, ~~~~~~~~~~\epsilon_t \sim WN(0, \sigma^2)$$ ...
10 views

### Two predictor variables are partially related. How do I handle them before performing logistic regression [on hold]

I have a predictor variable called poutcome variable which has three levels (success, failure, nonexistent). For all nonexistent values another variable pdays value is 0 but success and failure could ...
28 views

### Why multiply an error by itself minus one? [on hold]

I'm trying to understand how the optimisation is working in an algorithm. In support of the optimisation, errors are calculated. For one type of error, before it returns the value, it multiplies it ...
7 views

### Calculating the gradient used by the Jacobian-based Dataset Augmentation in Keras [migrated]

I am trying to understand my mistake when calculating the sign of the gradient used by the jacobian-based dataset augmentation published in https://arxiv.org/abs/1602.02697 " the sign of the ...
14 views

### Questions on Notation for PMF and Expectation

Before diving into the Stanford CS229 Machine Learning notes online, I decided to go through the course's notes on probability review and had a few questions. In section 2.2, it states A ...
12 views

### Confidence Interval for accuracy - Binomial?

Imagine we fit the same data mining model on 100 different validation datasets and accuracy is always exactly 95%. If we now use the Binomial proportion confidence interval we would have a standard ...
19 views

### Finding logged partial difference and the loglikelihood of GED PDF

I'm not so good at math, and i am trying to learn. I have a pdf function of GED (Generalized Error Distribution) as showed: I need to find the partial differential of the logged pdf with respect to ...
9 views

### Combining Results of Simulation Replications (Random-Intercept Logit Models under Confounding)

I've written some simulation code in R to learn about the behavior of a random-intercepts logit model under varying degrees of confounding. The simulated scenario is three points in time, two groups, ...
7 views

### Find typologies within population [on hold]

I think I screwed up my master thesis with a bad questionnaire. I have a total of 21 Likert statements which are in one big pile and not really sorted. I also have various nominal questions. I would ...
5 views

### Combining Risk Scores based on Different Models

Let's say for example there are two models for different medical conditions that fall under the general category of medical conditions. For condition one, we have m features, and we built a ...
4 views

### Change color of points on a plot based on index R [migrated]

I want to plot anomalies in a dataset with a different color. For that i generated random numbers, injected anomalies based on a condition, and them plotted them. But the plot that i am getting is ...
11 views

### Calibration vs. Estimation in RBC Models [on hold]

What are the pro(s) and con(s) of estimation and calibration in RBC models in macro. Can you compare it?
11 views

### Help with fitting a panel regression model

How can I fit a panel model in which the outcome of interest, i.e., the dependent variable is at the county level and one of the explanatory variables is at national level? (e.g. The effect of a ...
10 views

### Count probability of average and variance of random variable with normal distribution [on hold]

Please verify my calculation for four exercises placed below. Example 1. Random variable $X$ has distribution $N(100; 10)$. Count $P(90 < \overline{X}_9 < 95)$. Example 2. Random variable $X$ ...
14 views

### How to use last predicted value as feature? NLP NER mission

I'm performing NER (Named entity recognition) For example: Seq: When Donald Trump announced... Tags: O B-Person L-Person O When I'm predicting ...
25 views

### A reward becomes a penalty if

I am working to build a reinforcement agent with DQN. The agent would be able to place buy and sell orders for a day trading purpose. I am facing a little problem with that project. The question is "...
9 views

### correlation with small range of data

I have two count variables. I want to calculate a Pearson correlation between them. However one of the variables only has a rangge of 1-7. Is it inadvisable to use Pearson correlation to study a ...
10 views

### IV-estimation vs. Heckman's selection model

I am trying to grasp the difference between IV-estimation and Heckman's selection model. I do that by considering the following set-up. My outcome if interest is y ...
9 views

### Strategy & interpretation for investigating possible interaction between continuous & categorical variable

I am working with glm in R. My predictors are one continuous variable (X_conti) and one categorical variable (...
18 views

### Calculating Beliefs from Factor Function

So I'm currently trying to work my way through this homework where I have to perform belief propagation and check that the resulting beliefs are calibrated. The situation is that we have the the ...
11 views

### R: How can I make a graph showing the distribution of my model vs the actual distribution by decile? [on hold]

At my company, we currently use a program that spits out the below graph for model fit. and I'm trying to replicate it in R. The graph splits it into deciles, then shows a line of the actual ...
20 views

### Why is it so hard to find straightforward explanations for the use of GLMs and MEM? [on hold]

We all know that for tests like ANOVA, T test, Wilcoxon, Kruskal-Wallis it is easy to state the conditions unto which we would be able to apply them. Examples: ANOVA: several groups, one variable, ...
25 views

### Linear Regression For Binary Independent Variables - Interpretation

I have a dataset where I want to predict inflow (people joining a platform) but my all independent variables are binary categorical (0,1). Whereas I want to predict continuous variable (inflow -- ...
10 views

### Conditional probability of Negative Binomial R.V. given the SUM of its values

Suppose $\{z_{ij}\}$ are independent Negative Binomial random variables with means $\{\mu_{ij}\}$, with $i=1\dots I$ and $j=1\dots J$. How do you find the (expectation of) conditional probability ...
10 views

### What measure should I use as cross-validation error with logistic regression in K-fold cross-validation?

What measure should I use as cross-validation error with logistic regression in K-fold cross-validation, especially when the Type I error is more serious and what we want to avoid at all cost?
9 views

### How to apply Lagrange Multiplier to a matrix?

I am learning about the Lagrange Multiplier and I see how to apply it to a set of equations but I don't know how to apply it to matrices. Suppose I have: ...
27 views

11 views

### Differences in calibration plots for machine learning models

I'm using machine learning methods in R for descriptive regression modelling of a small dataset. I have fit random forest (randomForest), unbiased random forest (cforest) and boosted regression trees (...
15 views

### hazard ratio in SPSS [on hold]

Any link on how to calculate hazard ratio (with 95% CI) of a disease occurrence, in a 30 year follow up data, from cox regression in SPSS? My first time using SPSS! plzzzz help
13 views

### Random coefficients logit estimation with Hierarchical Bayes in R

I am trying to estimate a Random Coefficients Logit model using the RSGHB R package. Thought, I came across with 2 main issues: Why the ...
21 views

### How to calculate CI for Odds ratio, Given Cohens d and ci for Cohens d( data is given as mean)

I have means(x) and Std deviations of 2(intervention and control) groups. I wanted to find Odds ratio with CI. I calculated the cohends d and CI first using,https://campbellcollaboration.org/escalc/...
10 views

### Specific data formatting techniques for discontiguous time series? [on hold]

I'm facing a predicting problem for food alerts. The goal is to predict the variables of the most probable alert in the next x days (also any information I could get about future alerts is really ...
24 views

### Is f(x) = 1/n for x = 0,1,2,…,n a valid PMF? (n>0 an integer) [on hold]

Is f(x) = 1/n for x = 0,1,2,...,n a valid PMF? (n>0 an integer) Intuitively thinking, the summation of the function over the range equals to (n+1)/n which is greater than 1 and so the function isn't ...
5 views

### How to perform single-arm meta-analysis

I'm currently intending to perform a single-arm meta-analysis which study outcomes are: Objective Response Rate (ORR%), Disease Control Rate (DCR%), Duration of Response (DOR) in months, PFS in months,...
25 views

### A priori contrast for binomial GLM

after much reading I decided to write because I cannot find a solution to my question. I already did a priori contrasts before for a continuous variable with normal distribution. Now I have another ...
I estimate covariances from data and want to calculate likelihood. For 1D case I know - if the sample size is $<40$, I use Student's t-distribution to calculate likelihood of the data since my ...