instruction
stringlengths
9
38.7k
I am working with a substantial dataset in which I need to compare the distributions of certain common features across different categories. The challenge I face is that due to the imprecision in classification criteria, it often leads to the rejection of the null hypothesis in standard hypothesis tests, even though I ...
I have 6 temperature sensors (columns) located at different places. Each one offers a measurement each hour. I have $168$ measurements (rows). I am working on python and I have already used the function numpy.corrcoeff(my_data) to obtain the correlation of the whole time series (a $6\times 6$ matrix). I want to calcula...
I want to show that $\hat{\beta}$ is identical,no matter if I do a multivariate regression or the partialling out approach. Therefore consider the following partialling out approach (without constant!): Step 1: $x_{ik} = x_{i2}' * α + v_{ik}$ Step 2: $y_i = v_{ik}' * β + u_{ik}$ My starting point is the following: $\ha...
PCA is a generative model, by which input images or data can be reconstructed. LDA (Linear Discriminant Analysis) is a discriminative model, which extracts better features for classification. How to make subspace learning that fulfils both aspects or at least balance between the two aspects ? Mathematically formulate t...
Cinelli et al., 2022 and Wysnocki et al., 2022 describe in technical terms how controlling for a collider can lead to biased estimates. If one needs to explain why one should not control for a collider to a non-technical audience of lay-people without a stats background, what would be an intuitive explanation?
the dataset is split into 3 categories: train, test, valid. after training the error rates we see have these values. case 1 1% error on the training set. 5% error on training dev set. 5% error on the dev set. the model is underfit as it should show less or same error rate btw valid ~ test dataset case 2 11% error on...
Consider the following (simplified) example of a project I am working on: I assume that $X$ has a linear effect on $Y$. However, after plotting the relationship on a scatter plot, it looks like the relationship between $X$ and $Y$ is curvilinear. In particular, the lower and higher levels of $X$ are correlated with low...
Using time-series data, I'm trying to determine the optimal polynomial degree to use for my regression. To do this, I chose to run an ANOVA test on 5 models, the first model's degree is equal to 1 and each successive model's degree increases by 1. So, model 3's degree is equal to 3 and model 5's degree is equal to 5. I...
I'm running a ML algorithm on some data, and I noticed that if I change the random state inside the train_test_split function, accuracy score change in a quite wide range. For example, with random state = 4, I reach an accuarcy score range that may vary from 0.78 to 0.8 (it depends by the seed in the algorithm). By usi...
I would like to exchange with you about how to best do this. Let me try to clearly describe the situation in the most non-verbose way I can! (Stack: Python, Darts (from unit8), pandas, numpy) I have a building temperature time series, I perform regression on it. Using Darts it is pretty easy to use covariates (both cat...
Here is the application: I have a spectrometer and I need to test different lighting setups for it. Each time, I illuminate a fixed set of 9 color references, and I measure them. The spectrometer is sensible to 8 wavelengths. Here are the plots with two different configurations: Configuration #1 Configuration #2 ...
A test results interpretation question, which I think boils down to this: what is the distribution of the minima of pairs of values sampled at random from a known distribution (say, Gaussian) and can the parameters of the latter be estimated knowing or estimating the parameters of the former? Suppose that one wants to ...
I'm running a regression on various subsets of data and want to know if the 'b' coefficient has a consistent impact (in terms of size and direction) across these subsets. C1 = a + bX C2 = a + bX .. Cn = a + bX What methods can I use to check this when there could be up to 20 subsamples? Is my current approach fundamen...
I am looking high and low for how to model data where the outcome is pseudo-continuous (change in questionnaire scores) that can be negative and has a lot of "true" zeroes. I see talk about models for zero-inflated count data, i.e. positive integer outcomes like zero-inflated poisson/ZIP, zero-inflated negative binomia...
Let us assume that we draw a sample $\{X_i\}_{i=1}^N$ from a random variable $X$ and we have a discrete probability distribution $q_{ij}$, i.e. $0 \leq q_{ij}\leq 1$ and $\sum_{ij} q_{ij} =1$ (the $q_{ij}$ are unralated with the random variable $X$). I want to study the following figure of merit, more specifically I w...
Restrict the intercept term, i.e. In this case, I want to calculate F-test. The formula is as follows: How can I calculate SSR for restricted version? What is its formula? Thank you.
Cox regression seems useful as a broad strokes model for measuring survival/ churn of a subscription-based product/ account lifetime estimate -- and the broad factors that might influence the survival curve (and area under the curve for estimated lifespan). Unlike typical human survival data however where there's gener...
Let $(X_j)_{j= \mathbb 0}^\infty$ a fixed realization of strictly stationary AR(1) process: $$X_j = 0.9 \,X_{j-1}+ \eta_{j}, \quad (\eta_j) \overset{iid}{\sim} N(0,1)$$ For each $n$, consider $B_n\sim Bernoulli(c/n)$, with $c>0$. Suppose $(X_j)_{j= \mathbb 0}^\infty$ and $(B_n)_{n \in \mathbb N}$ are independent. Defin...
I'm trying to build bootstrap confidence intervals for the predictions of my model, which is a gradient boosted machine. I understand that this is done as follows: Tune and build the "mean" model Sample the training data with replacement Rebuild the model on the sampled data Repeat steps 1-2 N times Predict onto a giv...
I am working with field variables and telemetric variables. The dataset is composed of geographical locations for which i have both types of data. Amongst these field data, some are of interest, to be predicted, while some other are just field characteristics. The initial goal of my study was to model the field variabl...
I have a feeling this is a silly question. I am working on a research paper, at some point in it we perform a likelihood ratio test. The first guess would be to apply Wilks's theorem. However, if we take the hypotheses: $$ H_0: X_i\sim Binom(n1,p1), Y_i\sim Binom(n2,p2) $$ $$ H_1: X_i\sim Binom(n1,p), Y_i\sim Binom(n2,...
Random vector $X$ follows a pairwise Markov property on graph $G=(V,E)$ if for any $(i,j) \notin E$, $X_i$ and $X_j$ are conditionally independent given $X_{V \setminus \{i,j\}}$. My question is, why do we not impose the converse? That is, why do we also not impose that if $X_i$ and $X_j$ are conditionally independent ...
Let $a \sim N(\mu_a,1/\tau)$, and $s = a + \epsilon$, where $\epsilon \sim N(0,1/\eta)$. I know that because both $a$ and $\epsilon$ is normal distribution, s must also be normally distributed with $s \sim N(\mu_a,\dfrac{\tau +\eta}{\tau\eta})$. $s$ is interpreted as a signal to $a$ that is not observed. Then the condi...
I'm interested in the following variant of the usual one-dimensional density-estimation problem: I wish to estimate some unknown density $\rho$. There are iid samples $Y_{1},\ldots,Y_{n} \sim \rho$, but I don't get to see them. Instead, let $\epsilon_{1},\ldots,\epsilon_{n}$ be iid standard Gaussians, let $\sigma_{1},\...
I wrote a classifier that uses LGBMClassifier. This is the code: from lightgbm import LGBMClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import KFold, train_test_split from sklearn.model_selection import GroupShuffleSplit from skopt import BayesSearchCV DEFAULT_PARAMS = { 'c...
A variable $X_t$ is divided into components $X_{it}$ such that $\sum_i X_{it} = X_t$ for all $t$. Consider regressing each component $X_{it}$ separately on the total $X_t$ to get parameter estimates for the constant $b_{i0}$ and slope $b_{i1}$. Then, we have that $\sum_i b_{i0} =0 $ and $\sum_i b_{i1}=1 $. I don't unde...
I am working through Chapter 13 of the 2nd edition of An Introduction to statistical learning (the R version, see here), on Error Correction. On page 569, in the section discussing the Scheffe method, the authors discuss testing the null hypothesis that the returns from two fund managers, one and three, in a fictional ...
I am kind of a stats noob but I figure someone here may have some insight. I am running a linear mixed effects model in R, reminiscent of what's below: model <- lmer(rating ~ group * cond1 * cond2 + (1|subject) + (1|image), data=data1) I also want to compare the variances of ratings between m...
I have hourly data that has a period of 1 day or 24 hours / time steps and I hope to do short term forecasting for a few days in advance. The ACF of the raw time series was periodic (see last figure) like from this question, so I took a difference between the series and a shifted series by 24 timesteps. The differenced...
I can't understand this cumulative distribution function. I would like to calculate the data distribution function: F(t) := P(X <= t) ~ sum_i freq(observation_i <= t)/total_observation =: f(t) Having the datas: List_Goal: [1, 2, 2, 1, 2] Each of these values (1, 2, 2, 1, 2) is a goal scored by a club in previous matc...
I have two proxy metrics, and I'd like to see which of them correlates more strongly with human ratings. I have ~30 questions, and for each question 3 humans independently give a score on a 1-10 scale. The questions vary in how subjective the scores are, perhaps significantly (in other words, some questions should have...
Background I have a between-subject factor of GROUP with 2 levels (Control and Active) and a within-subject factor of TIME with 3 levels (Time1, Time2, and Time3). Code below to generate some dummy data, # Loading libraries library(tidyverse) # Function to generate mock data for each group generate_data_for_group <- f...
Consider the model $\hat{y}_t = e^{\text{trend} + \text{seasonality}} \prod_k^K x_{k, t}^{b_k}$ where $K$ denotes different investment alternatives. You can think that trend and seasonality are modelled a linear trend and dummies. $0 < b_k < 1$ (to capture diminishing marginal returns) We can linearize the multiplicati...
I have a set of data including information of age groups, education level, and meteorological data from 2000 to 2006. The dataset was spilt by age groups(65-74,75-84,85+),education level(university or above, other), weather (summer, winter), and run the following regression: Death ~ Temp_lag3 + NO3 + rainfall + relativ...
I’m trying to figure out the math behind the formula for the variance of the T-stat in Cochran-Armitage trend test show in Wikipedia. It says that decomposition is used, however I can’t work this out. Any insights or resources would be greatly appreciated!
Here it the link to the GitHub Repository for this project. I am going to preface my question by saying that this problem of interpretation I have run into is in the context of me doing my part as a collaborator on a paper for publication for the first time, and I waited a while before coming here to ask for help on th...
I have a Bayesian inference problem where the likelihood function is conditioned on two unknown variances. $$\log\mathcal{L}(d\mid \sigma_n,\sigma_s) = -\frac{1}{2} \log (\sigma_n^2 + \sigma_s^2) -\frac{1}{2}\frac{(d-\mu)}{\sigma_n^2 + \sigma_s^2}^2$$ where $\mu$ is a known quantity. I would like to find a conjugate pr...
Lets say i have the decompositions of a financial result into 21 portfolios and 11 asset classes below. I can decompose the result into either portfolios or asset classes easily by using a waterfall chart (which my bosses really love), but I am looking for something, hopefully similar, which can decompose both dimensio...
I have two distributions $p_a$ and $p_b$ and I want to sample from $p_c$, defined via the log density $$ \log p_c(x) = (1+w) \log p_a(x) - w \log p_b(x) $$ or via the desnity $$ p_c(x) = \frac{ p_a(x)^{1+w} }{p_b(x)^w} $$ I am a noob when it comes to sampling from a distribution, so any pointers would be welcome. Is th...
I currently have data from $n$ sources. Each source sends a binary signal each minute. I have a register of $p$ minutes. I have used Python to calculate the Jaccard indices of each signal as from sklearn.metrics import jaccard_score #... for i in range(num_bin_sensors): for j in range(nnum_bin_sensorss): ...
I have price Data for a set of items for various time steps as i collect this data regularly. The data is very large (over 250000 items usualy per group per point in time) and not normaly dstributed but slightly right skwed. Sometimes the item count drops for certain timepoints and groiups and i want to calculate if i ...
I am interested in using the {PanelMatch} package for a project that I am working on where the conventional matching/weighting framework is expanded to account for the complexities of the panel data setting. Both within the reference manual and their associated paper, the authors rely on research questions with a conti...
I need to assess the relative impact of my coefficients. I work with R and for my OLS model I am using the lm.beta package. However, it does not work with fixed effects models for panel data. Could you recommend an alternative?
If I wanted to find the busiest hour at an ice cream shop and I had the counts of the type of ice cream sold per hour per day. Could I use Poisson regression to find the busiest hour and month etc for the shop? Or would it only work if I had a unique identifier for each individual, and looked at it at an individual lev...
In my experiment, subjects had to answer a number of unrelated questions before and after an intervention. We had two different interventions, and all participants underwent both interventions in separate sessions. So in each session, there is a pre and post intervention score for each question. For each question, I wa...
I have a table like this: Mutation_2_Present Mutation_2_Absent Mutation_1_Present 982 740181 Mutation_1_Absent 111555 89355602 And I apply the Fisher test etc. The thing is that mutation 1 and 2 are not from gene A vs gene B. They just corresponds to category1 ...
I'm studying linear regression in a Coursera course. The author uses the following loss function in his examples: And he shows the following error surface when he explains the gradient descent. In this last picture, it seems that the cost function has negative values. However, mathematically, the loss function used b...
does anyone know a suitable alternative to Poisson regression if the independence assumption is invalid? Thanks A hypothetical example - if two cars crash into each other and they go to the same mechanic to get fixed. If the mechanic was modelling type of repairs and road conditions. Surely this makes the independence ...
In the paper for strong screening rules for the lasso (link), the following screening algorithm is proposed (start of chapter 7): Let $S(\lambda)$ be the strong rule set. Then the following strategy is adopted: Set $\mathcal{E} = S(\lambda)$. Solve the problem at value $\lambda$ using only the predictors in $\mathcal{...
Do exact matching variables need to be included when estimating effects after matching with the MatchIt package? Take the following example (adapted from the MatchIt vignette on estimating effects after matching): library(MatchIt) library(marginaleffects) # Generate toy dataset gen_X <- function(n) { X <- matrix(rno...
I am trying to estimate the variance $\varepsilon^2_X$ in a simple logit-normal model of the form $ \sigma^{-1}(U) \sim \mathcal{N}(\mu_U, \varepsilon^2_U)$ $ \sigma^{-1}(X) \sim \mathcal{N}(\sigma^{-1}(U), \varepsilon^2_X)$ where $\sigma^{-1}$ is the logit function and both variables $U$ and $X$ are observed. (I am ...
Assume that you have a matrix $X \in \Re^{M x N}$ that have $M$ rows and $N$ columns. The rows $M$ can vary in length, but the $N$ columns remains constant. Each row is labeled with a class ID. The data is 8-bit in this case. The data looks like this. Notice that there are three data rows that have the same value. The ...
Hello to everyone in this community. I am feeling like fish out of water writing in this community, but I know that I am at the right place. Currently, I am conducting a research to assess the impact of Environmental, Social, and Governance factors on Return on Assets of the companies that are listed on London Stock Ex...
I have constructed a structural equation model in R using lavaan, with 2 exogenous predictor variables, 3 mediators, and 1 endogenous response variable: I tried to label it as conventionally as possible but apologies if I didn't do a good job. I am now trying to calculate indirect effects, using past answers on how to...
I'm having trouble drawing conclusions from a specific semi supervised machine learning setting. My use case would be using mixup [Zhang2017] and label guessing similar to the mixmatch paper [Berthelot2019]. That being said, lets say my training data would be split in two sets $T_1,T_2$, for which I have labels for $T_...
My experiment is based on an online ab test system. A typical situation is that, I generate some candidates by some optimizer (CEM, GP etc) and push them to different experiment buckets (around 10). After one day, I will get a daily ab test report for previous day. This will be my evaluated result for these candidates ...
I am trying to correct a variable from a survey that has measurement error. To do this, I have been taking this column as if it was missing and imputing new values based on the predictions of an XGBoost model that is trained with other surveys from different years and that have common variables. I did this using R-Stu...
I need to quantify the relative error of a process that computes the volume of some objects. I also have a sample ($n=400$) of objects that are known to be made of a homogeneous material. Since the density is fixed and known, I figured one could estimate the CI of the density to conclude bounds for the relative error o...
I see the question of model selection for GEE come up and answers seem to usually involve QIC/MLIC for non-nested models, or LRT for nested. That's all fine, but when I have 50 predictors it's a bit tedious to write all 50-factorial model statements. Some have floated stepwise selection using QIC/MLIC but my understand...
My homework problem is: Let $x_1,...,x_n$ be random samples from an $Exp(\lambda)$ distribution. Assume that the prior on $\lambda$ is $\Gamma(a,b)$. a) Find the posterior distribution for $\lambda$. Prior: $\frac{b^a}{\Gamma(a)}\lambda^{a-1}e^{-b\lambda}$ Likelihood: $\lambda e^{-\lambda x}$ $\pi(\lambda|x)\propto \pi...
I have some parameters that I would like to analyze with a two-way ANOVA. The treatment groups have unequal sample sizes (n=9, n=36, n=36, n=36) and the data do not fulfill the requirement of normal residuals due to several outliers (data transformation therefore doesn't work either). Is robust ANOVA like WRS2/t2way ro...
Consider a GLMM setting. Let $i=1,...,m$ denote cluster. Let $l_i(y_i|x_i,b_i;\beta)$ denote the log-likelihood (viewed as a function of the parameters) for each cluster $i$, which includes notably conditioning on random intercept $b_i$. Let $f(b_i;\sigma^2) \sim N(0,\sigma^2)$ for all clusters $i$. Thus, the observed ...


I have my data + data from colleagues who measured independently. I have to create an ICC between my results and theirs. But the only problem is that even if I got some ICC results plus 95% CI, I don't quite know how to interpret it correctly. 
I was comparing the mean values from the measurements for each batch sepa...
I am attempting to conduct a regression discontinuity analysis in Python and I'm struggling with understanding the results. I don't pretend to be a statistician and I'm hoping you helpful experts can lend me a hand. Perhaps I'm not even using the correct testing framework. Context: I have an app that I want to determin...
I'm currently training a neural network using var1, var2, and var3 as input features, with var0 as the target variable. The initial training showed promising results, as the predicted_var0 closely matched var0, creating a nearly 1:1 plot. However, it is challenging when I attempted to use var1, var2, and var0 as featur...
I am trying to train a text classifier with open-source data to generalize on the real user traffic (henceforth "real data"). However, even though I have many annotated open-source data, I have only a few hundred real data. I know the best way to generalize to the user traffic is by training a model with such data. How...
I am doing a study looking at how bacterial communities on eggshells correlate with species-site and nest stage. We sampled the eggshell bacteria at two sites, with two different host species sampled at one of those sites. As such, I have been analyzing the data with a combined species-site 3-level factor. Some of the ...
The Python statsforecast package has some recommendations when simulating / generating time series, that we can add a constant to avoid computational problems: https://github.com/Nixtla/statsforecast/blob/main/experiments/ray_ets/experiment.py Basically, they just do this: # the target variable for univariate forecast ...
I would like to understand the difference between simple R², predicted R², and adjusted R². I have done several research and readings, but the difference is still not clear to me. I have even reached some conclusions, but I'm not sure about my understanding. R² is a metric that ranges from 0 to 1 and measures how much ...
I'm trying to create multiple observations per model from my test set so that I have enough model results to run statistical tests of significance for differences across the models. The models I'm comparing are different types, such as random forest, logistic regression, etc. To do so, I was going to create folds in my...
Let's say that we have a time series: $$\{y_i\}_{i=0}^{n-1}, y_i \in \mathcal{Y} \subseteq \mathbb{R}^m, m \in \mathbb{N}_1$$ that we would like to model with some sort of state-space model: $$x_i = f(x_{i-1}, i) + \nu_i$$ $$y_i = g(x_i, i) + \epsilon_i$$ where $\nu_i$ and $\epsilon_i$ are (i.i.d?) noise terms. In prac...
I am looking for an example of an outlier in three dimensions but that cannot be detected with the three scatters xy, xz, yz. Can anybody help me? Thanks in advance.
I was just asked to familiarize myself with some methods looking at comparing AUROC for a few predictive scores to predict outcomes. Issue is that I have a dataset of about 200 with <5% with the outcome of interest. Given this low event rate is there any issues I should be aware of (or corrections to apply if they exis...
It seems that if a one-sided Z-test returns a p-value $>1 - \alpha$, you have enough evidence of absence to reject the alternative hypothesis in favor of the null hypothesis, because if you were to swap the null and alternative hypotheses and repeat the test, that p-value would be $1 - $ the original, and hence $<\alph...
What is the probability of any child getting two or more candies? My thinking is that if there is one child getting 2 candies, that means there is one child not getting any candies. So $(n-1/n)^n$ would be the answer. But for $n = 2$, the distribution is 1 1 0 2 2 0 which means $(n-1/n)^n$ is not correct. Can someone ...
I also posted the question at https://math.stackexchange.com/questions/4793565/how-to-evaluate-the-validity-of-my-teaching-methods-through-analyzing-the-data-o Problems I want to solve I want to be a high school teacher, and I have some self-considered great ideas of teaching methods. Before that, I want to be a tuto...
I am struggling with one question. Is goodness of fit of a model necessary when your purpose is to test hypothesis regarding a coefficient? To be specific, I am regressing formal credit access on gender (variable of interest) and other predictor variables. Logistic regression with svy prefix in Stata is used. It is obs...
We have 2 standard distributions that are independent from each other and we take smallest number of the two. That should create a new distribution although not a normal one most of the times. I have done some simulation on a spreadsheet and figured some stuff like if you increase the σ, the new σ also increases or if ...
I am referring to this example: http://www.sthda.com/english/wiki/chi-square-test-of-independence-in-r The data used are frequencies for household tasks: Wife Alternating Husband Jointly Laundry 156 14 2 4 Main_meal 124 20 5 4 Dinner 77 11 7 13 Breakfast 82 36 15 7 Tidying 53 11 1 57 Dishes 32 24 4 5...
Reference: Koller, D., & Friedman, N. (2010). Probabilistic graphical models: Principles and techniques (Nachdr.). MIT Press. Bayesian network $\mathcal{G}$ encodes that for any node $X_i$, there are always local independencies with any node that isn't a descendant of $X_i$, with the condition of all parent nodes: $$...
when I run a logistic model I get log odds that I can easily convert to probabilities. What I don't understand is how can I use percentages instead? Here's the code: testmodel <- glm(survived ~.,family=binomial(link='logit'),data=Titanic) odds <- exp(coef(testmodel)) prob <- odds / (1 + odds) If I use the allEffects ...
Problem Imagine I have a list of categorical labels: A A A B C C B B B C C A C C. I want to calculate a numerical measure that characterizes how ordered it is. So perfectly ordered lists, where there is no mixing between labels of different kind, like A A A A B B B B C C C C or C C C C C B B B B B A A A A A and so fort...
I have a question regarding calibration (train) and holdout (test) periods.I have time based data. I split my data into two sets. Fit/Train (first 2/3 of data) and validation/testing (latest third). So I validated my model to see what was predicted and compared this to what actually happened in this time period. Exampl...
I want to run a simulation using lavaan and simsem to determine the sample size to use in a study using path analysis. The conceptual model for my study is as below, with 2 independent variables, 1 mediator and 2 moderators. From what I understand, the corresponding statistical model is as below: I am following the r...
I have 10 numeric outcomes in one dataset and I want to use Kruskal-Wallis test to identify an influence via a predictor variable (group variable) and also for each age group. I am testing for each age group (4 categ.) for each of the 10 variables (10*4=40) and I am wondering if I have to correct my alpha (0.05/40). I ...
I'm conducting research on the treatment effect of tinnitus. Δ represents the pre-treatment to post-treatment change. ΔTHI yielded a p-value of 0.03, while the other p-values are above 0.5. Now, should I apply the Bonferroni correction to assess whether ΔTHI between the two groups (treatment vs. sham) is significantly ...
While desribing properties of the single auction equilibrium defined by theorem 1 in "Continuous Auctions and Insider Trading" A. Kyle conjectured that one-half of the insider's private information is incorporated into prices and the volatility of prices is unaffected by the level of noise trading $\sigma^2_u$. M...
I am running a model that looks like so: TD_PE_analysis1 <- lmer(PE ~ learn_prof * trial * condition + (1|subject) + (1|image), data=td_pref_all) Where PE is prediction error, learn_prof is a between subjects fixed effect (two groups), and trial and condition are within subject. The data appear below: structure(list...
I have a variable x that corresponds to data from a database. I've been trying to find the best distribution to fit it and looking at the histogram I figured either a normal, weibull or logistic should work. This is the variable x <- ShippingLogs$ActualShippingDays Which is taken from this csv where all values are non...
From the ordinary least squares (OLS) problem, given a design matrix $X_{n\times p}$ and a response $y_{n \times 1}$, we want to find $$ \hat\theta = \arg\min_\theta \|X\theta-y\|^2. $$ In this case, the hat matrix is defined as $H = X (X^\top X)^{-1} X^\top$ such that the predicted response is given by $\hat{y} = H y$...
Im building a Cox Regression in SAS. My code looks like this: proc phreg data = mydata; class sex hospital; model time*status(0) = sex hospital age bmi; strata treatment_variable; run; Now this code does not calculate a hazard ratio for treatment A vs treatment B. If I remove the strata statement and instead...
I'm doing a study in which a new diagnostic method is evaluated. Samples are taken from patients, both this new method and the current standard method are applied, and we calculate concordance between the methods. The problem is that some of the samples are from the same patient, and are thus highly correlated. I would...
I have been dabbling in NB regression for less than a year now. I have applied the well known g.o.f. tests. Lately I started using the Conditional Moment (CM) test, described in Cameron and Trivedi 2003 Regression Analysis of Count-Data book. (Chp. 5, pg. 194). It basically looks at the expected versus observed counts,...
I am currently working with continuous data measured from different sensors (thermometers and voltmeters). I have a matrix whose columns represent the sensors and the rows are normalized measurements (one each second). I have been asked to check if these sensors behave in the same way. Thus, I have used clusterization ...
Our hypothesis is that there is a 3-way interaction between A, B, and C. I have defined a model as follows: Y=A+B+C+AB+AC+BC+ABC+error I aim to use the likelihood ratio test (LRT) to determine if the three-way interaction effect is statistically significant. To do this, I constructed a nested model without the three-wa...
for example, if: $$\begin{aligned} f_{X_{pi},T_{pi}}(x,t|*)=& \begin{aligned}\frac{\pi s^2}{\alpha_{pi}^2}\exp\left(\frac{\alpha_{pi}(x-\frac12)\nu_{pi}}{s^2}-\frac{\nu_{pi}^2}{2s^2}(t-\tau_p)\right)\end{aligned} \\ &\times\sum_{k=1}^\infty k\sin\left(\frac{\pi k}2\right)\exp\left(-\frac{\pi^2k^2s^2}{2\alpha_{pi}^2}(t...
What is the difference between robust Hausman test and Mundlak test? Wooldridge "Econometric Analysis of Cross Section and Panel Data" (Second edition page 870) mentions robust Hausman test is obtained by adding group averages to RE estimation and testing for joint significance. Isn't Mundlak test also the same see sta...
Suppose that I have time series forecasting model, e.g. forecasting point of sales revenue in various economic scenarios represented by indicators such as inflation or interest rates. I build a model $\hat y_{t+h|I_t}=f(X_{t+h|I_t}|\hat\theta_\tau)$, where $X$ are set of scenario variables and $\theta$ - model weights/...
I have a large panel with 4 time periods and 10,000 observations per year. First I do OLS regressions for each year, and they all look fine. Then I run the FE model for the entire period, and one fairly important variable changes sign. This is odd, but what worries me most is that R2 is very small (0.058), and the adju...
I am running a beta-regression using betareg in R (with default logit link function). My response variable is a proportion, and may include 0 and/or 1. I've transformed the data following the betareg manual:"if y also assumes the extremes 0 and 1, a useful transformation in practice is (y · (n − 1) + 0.5)/n where n is ...