instruction
stringlengths
9
38.7k
I was given an oil time series dataset (quarterly). I was trying to build an ARIMA Model in Stata. There is trend and seasonality in the data I am trying to plot acf and pacf plot to determine the order of AR and MA process I had already taken the log and differenced the data to remove the trend and seasonality and to ...
I have a classification problem. The actual outcomes are binary (0 or 1), but I want to predict probabilities, rather than predicting simply 0 or 1. I also want something with feature selection, since there are a lot of predictors. One approach that I want to try is L1-regularized logistic regression (specifically this...
Are there any methods that combine VI and MCMC? If it exists, why isn’t it used prominently over techniques such as NUTS or other VIs.
Struggling with something so hoped the brilliant minds of the internet could help me out. I have a large dataset of job postings from which I have extracted the skill demand (no. of times a skill is requested) for each occupation (which I am treating as documents for TF-IDF). Essentially each row is a different occupat...
Two related questions from statistics noob. Can someone recommend a good statistics textbook that covers Wilson confidence interval? The reason why I'm looking for Wilson CI specifically is that I am a ML practitioner and recently I had to estimate CI for precision and recall of a certain ML model. My undergrad probab...
I actually have two original datasets (each one for a departure that are related to each one in a specific way , but it's not important to know how exactly) , but these 2 datasets contain some outliers in the column 'value' that i deleted and which led to the creation of 2 new datasets filtered. My main objective is to...
I have data from 3 different sources, measuring different variables for different samples taken from the same population (a country). All of the data is from country-wide studies and should be representative of the country's population. E.g. I have data from source 1 about country-wide demographic variables (census-typ...
Paper: Isolating Sources of Disentanglement in VAEs I follow as far as, $$\mathbb{E}_{q(z)}[log[q(z)] = \mathbb{E}_{q(z, n)}[\ log\ \mathbb{E}_{n'\sim\ p(n)}[q(z|n')]\ ]$$ Subsequently, I don't follow how they get the following and beyond that: $$\mathbb{E}_{q(z, n)}\left[\ log\ \mathbb{E}_{p(\mathbb{B_m})}\left[\fr...
The question I tried to solve, but failed, goes like this: Find the expected value of $(\bar{X}_n)^2$ and find an ubiased estimator for $\mu^2$. This is the solution given by the TA: $$E[(\frac{1}{n}\sum^n_{i=1} X_i)^2]$$ $$= E[\frac{1}{n^2}\sum^n_{i=1} X_i \sum^n_{k=1} X_k]$$ $$= \frac{1}{n^2}\sum^n_{i=1} E[X^2_{i}] +...
Hi I am writing a critical review for one of my assignments, and I am struggling to extract the unit of observation. I have written a critical review for one of my assessments at university which is a data analysis course and looks at research design in social sciences. I have since second guessed myself as to whether ...
Describe the bug I'm attempting to replicate a GEE model in statsmodels from a published paper that used SPSS (https://pubmed.ncbi.nlm.nih.gov/33279717/). I am getting very different answers for what seems like the same input structure. I even signed up for a free trial of SPSS and can confirm SPSS gives the answers re...
The primary objective of Bayesian inference is to compute the posterior. For instance, if the posterior $p(\theta | x)$ is known then the expectation $\mathbb{E}$ of the test function $\tau(x)$ under the posterior $p(\theta | x)$ can be computed like $E[\tau | x] = \int d\theta \tau(\theta) p(\theta | x)$. To make a pr...
Let $\mathbf{Y}=\begin{pmatrix} \mathbf{Y_1}\\\mathbf{Y_2} \end{pmatrix}\sim N\left (\boldsymbol{\mu},\boldsymbol{\Sigma} \right ), $ $\boldsymbol{\mu}=\begin{pmatrix} \boldsymbol{\mu_1}\\\boldsymbol{\mu_2} \end{pmatrix}$ and $\boldsymbol{\Sigma}=\begin{pmatrix} \boldsymbol{\Sigma_{11}}& \boldsymbol{\Sigma}_{12} \\ ...
I had a question regarding the "choosing the optimal model" section of chapter 6 of ISLR (pg. 232). The book states that "In order to select the best model with respect to test error, we need to estimate this test error. There are two common approaches: We can indirectly estimate test error by making an adjustment to ...
I have a dataset , which is in panel nature for two time periods. I would like to whether it is possible to perform a DID analysis, and if yes is it possible to do a parallel trend analysis for only two time periods.
If an AR(2) model is stationary, how to prove that $$\rho_1^2<\frac{\rho_2+1}{2}$$ I know that $$\rho_1=\frac{\phi_1}{1-\phi_2}$$ and $$\rho_2=\frac{\phi_1^2+\phi_2(1-\phi_2)}{1-\phi_2}$$ according to Yule-Walker equation, but when I try to prove it by the two equations above it just doesn't make sense.
I am trying to answer a question about satisfaction and its relation with a certain variable (numeric, 1-10). However, my data contains a lot of missing values in the satisfaction outcome, therefore I applied multiple imputation (all other variables are complete, no missings). So far, I managed to create a MI with 20 d...
I've run SNA and got the value of centrality of each node. I classified the centrality value into two group. Then based on this grouping, I would like to find the association of the attribute(gender, race, etc) with the grouping i've constructed. What statistical test that can I use? Can the classic logistic regression...
In lavaan, I am running a two-factor CFA on a questionnaire with 28 items, all of which are scored on a 6-point Likert scale. In total I have ~350 participants who completed the questionnaire. Because of the ordinal nature of the data, I am using ULS instead of ML, and the ordered = T command. Because I have found outl...
Out of curiosity, I realised that the Kolmogorov-Smirnov normality test returns two very different p-values depending on whether the dataset has small or large numbers. Is this normal and is there a number size limit for this test? From what I saw, the Shapiro-Wilk test was much more stable. I tried this ks.test(c(0.53...
I would like to sample from a multivariate Gaussian distribution with covariance matrix $\Sigma - uu^T $, where $u$ is a vector and $\Sigma - uu^T $ is PSD. I have knowledge of a non-Cholesky decomposition matrix $L$ of $\Sigma$, such that $LL^T = \Sigma$. Is there an efficient algorithm for computing a decomposition o...
My experiment consists in testing the effect of a compound on a cell line. I have 5 groups: control, concentration 1, 2, 3 and 4 of the compound. I performed three replicates of the experiment, each using cells from a different flask and cell passage, but still from the same original vial. In the same replicate, cells ...
I performed a chi-square test for 2 groups on a categorical variable. The p-value indicates that the categorical variable is significant. I concluded that at least one level of the categorical variables differ between 2 groups. How can I find which levels are actually different and which levels are not different betwee...
Define $X_n$ a continuous random variable that converges in distribution to $X$. Morever, we know that $E[|X_n|^p] \rightarrow E[|X|^p]$ for some $p > 0$. Then, could we prove that for any continuous function $f$ $$E[|f(X_n)|^p] \rightarrow E[|f(X)|^p]?$$ Or which additional assumptions do we need? Or if $X_n$ is unifo...
I am using sklearn's DecisionTreeClassifier and LSTMs (Keras) for time series classification. To increase the accuracy and robustness of the models I augmented the training data set with jittered, interpolated, and warped data. The accuracy of the decision tree decreases from 89.35% to 88.12% whereas the accuracy of th...
Suppose we have two categorical random variables $X$ and $Y$, with both $k$ levels. We assume $Y$ is generated causally from $X$ ($X \to Y$). We also assume causal Markovian is satisfied, which means $X$ and $Y$ are probabilistically dependent. My question is: Is there always a way to re-discretize $Y$ into a new vari...
here's a pretty general question, so i do not expect to get precise answers. Instead i hope to read ideas and suggestions. I have a deployied proprietary Deep Learning model that make retail price prediction of pre-owned cars. Data are shaped like this: car characteristics, selling date and selling price and i'm receiv...
I'm trying to run a linear mixed model (in R) but my model either never seems to finish running or (with a simpler random effects structure) there is a warning about singular effects. My full model is below (this is the version that runs for ages and never completes): RT_lme <- lmer(RT ~ Condition * HighLow * Correct +...
I am trying to generate time-to-event data for two treatments, with 25 patients in each arm. I generated the survival time in the treatment arm using an exponential distribution with parameter 0.95, and in the control arm using parameter 1.0. I assumed that all patients would experience an event without censoring. The ...
This is probably a straight-forward question but I can't find a straight-forward answer. The topic is new to me. I am performing parametric survival analysis, e.g. estimating a survival function from survival data and some covariates. It seems like it would be intuitive to check the residuals of the model in the same w...
Model framework: Suppose that the loss function is given by the Kullback-Leibler divergence (KLD) as follows: \begin{equation} \text{KL}(\Theta \parallel \hat{\Theta}) = \text{KL}\big(f(x;\Theta) \parallel f(x; \hat{\Theta})\big) = \int_{\mathcal{A}}\log\frac{f(x; \Theta)}{f(x; \hat{\Theta})}f(x; \Theta) dx, \end{equa...
In the introduction of this paper Bifurcations in a predator–prey model with general logistic growth and exponential fading memory The authors claim I didn't know that this model was well known. Can anyone point to a general reference where this model is formulated and perhaps studied?
Suppose we have two discrete random variables $X$ and $Y$, both of which take values from $\{1,2,...,k\}$. $Y$ is generated from $X$ via a transition probability matrix (also known as the stochastic matrix), which is defined as: $$P:=[P_{ij}]_{k \times k}$$ with $P_{ij}=\mathrm{Pr}(X=j|Y=i)$. My question is: Which kin...
Assume that a device is traveling at a constant expected speed $\mu$, subject to random variation with standard deviation $\sigma$, for a measurement period of duration $t$. Then the expected travel distance will be $\mu t$ over duration $t$. I am only able to measure the distance that the device has traveled and not i...
I just fitted a glm with the binomial family in R and to my surprise I didn't need to specify the $m_i$ values. Checking my notes, we simply assumed that $Y =_d \text{Binom}(m_i, p_i)$ where $p_i = H(x_i^T \beta)$, and thus our predictions are $\mathbb{E}[Y|X_i] = m_i p_i$. My response was binary to begin with, and to ...
In R I have fitted a logistic model for polygenic risk scores in cases and controls as well as a number of covariates : model <- glm(phenotype~prs+var1+var2+var3...var10, family=binomial(link='logit')data=data.prs) The PRS column have values from around -0.1 to 0.2 The summary of my model looks like this: Apologies f...
I have data where people are given a limited number of tokens (1 - 10) which they can assign across five different items. The number of tokens they allocate to an item represents the importance of that item to them over the others. In other words they have to make make more trade-offs if they are given fewer tokens to ...
dataset is a time series of index values from 2015 to 2020. i would like to do see if arima is an adequate forecasting tool for this index. in a first step i am trying to figure out whether my data is stationary or needs transformation. looking at the plot i see no seasonality and a constant mean over time, however, va...
There exists a classical method for solving a certain computational problem related to random sampling. It is the "gold standard", so to speak. I'm working on an algorithm that aims to solve the same problem more efficiently. It relies on partitioning the data used in the classical method and processing it in parallel....
If we have a fully connected MRF with three random variables $a, b, c$, what probablistic assumption would we make if we break the joint potential of the three by pairwise potentials? $$ \phi(a,b,c) = \phi(a,b)\phi(b,c)\phi(a,c). $$
Given two probability densities $p(x)$ and $p(y)$, define the dot-product of their log-likelihood gradients, also sometimes known as "scores", $\langle \nabla_x \log p(x), \nabla_y \log p(y) \rangle $. I was wondering if this pops up in a specific definition of a distance measure between distributions, is there a conne...
To start I'll say I am relatively new to data analytics. How is this data set distributed? I'm debating whether I can use the Mann-Whitney test on it along with gender (M/F). I've been assuming it's very highly skewed but a couple of things are making me question whether it is considered skewed: The means and median a...
$$ \newcommand{\pset}[1]{2^{#1}} \newcommand{\NN}{\mathbb{N}} \newcommand{\PP}{\mathbf{P}} \newcommand{\OO}{\Omega} \newcommand{\oo}{\omega} \newcommand{\sal}{$\sigma$-algebra\xspace} % Sigma algebra \newcommand{\sals}{$\sigma$-algebras\xspace} % Sigma algebras (plural) $$ Background: I'm tr...
The data I have is essentially the number of times two students were seen together. So student 1 and 3 were seen the most amount of times together, then 2 and 3, then 1 and 2. The correlation matrix looks like this: 1 [2] [3] 1 0 0.4 0.7 [2] 0.4 0 0.5 [3] 0.7 0.5 0 After reading a bit, I know you cannot average cor...
In Lemma 1 of these lecture notes, Chernozhukov and Fernández-Val write that partialing out with the Frisch-Waugh-Lovell theorem has an "adaptivity" property. Namely, suppose we regress $Y$ on $D$ and $W$ and partial out $W$. The Frisch-Waugh-Lovell theorem tells us the coefficients on $D$ are equivalent to the ones we...
I have been working to try to get means adjusted for covariates. I've seen examples such as this one, but I haven't seen an example that has Dr. Lumley's survey package in R. The code I ran is: library(nhanesA) library(survey) # Get data bmx_d <- nhanes('BMX_D') demo_d <- nhanes('DEMO_D') # Merge them bmx_demo <- mer...
After an ANOVA in R, do you know if it is possible to get the group differences using Bonferroni correction ? If I use the iris dataset a<-aov(iris$Sepal.Width~iris$Species, data=iris) When I run a TukeyHSD, I get the group differences directly TukeyHSD(a) Tukey multiple comparisons of means 95% family-wise conf...
I have 2 questions. How can I calculate the probability of getting a specific sequence of heads vs tails? If I have a given sequence of tosses, how can I use this information to help me guess the next flip? Let's suppose that I have a fair, 2 sided coin. My attempts for 1: Let's suppose I want to know what the prob...
Why is the value of MSE in cross-validation is always less than 1 in the MSE values of the hidden nodes selected by the MLP function. This is the result of the code fit2 <- mlp(fit, auto.hd.type = "cv") fit2$MSEH The values of my input have a mean of 9000. Further, the MSE of my model is this
I am trying to calculate the odds ratio using the epitools package. The counts in 2 cells of my 2x2 table are $< 10$ so I keep receiving the following error "Error in chisq.test(xx, correct = correction) : (converted from warning) Chi-squared approximation may be incorrect". I tried defining the method as "fisher" and ...
In my problem, I have a condition in which I need to compute the joint distribution of two dependent distributions. The first distribution is normal and the second one is beta distribution. How can I get the joint distribution function of these two distributions? Any help would be appreciated. Update Actually, I am tes...
I am reading this article about the horseshoe prior and how it is better than lasso and ridge priors. The author makes several points that I don't understand. One of them is "The ideal prior distribution will put a probability mass on zero to reduce variance, and have fat tails to reduce bias". Another is "both double-...
I am reading Inference on Counterfactual Distributions and my knowledge of distribution functions is rusty. Suppose we would like to analyze the wage differences between men and women. Let 0 denote the population of men and 1 the population of women. $Y_j$ denotes wages and $X_j$ denotes job market-relevant characteri...
I am using lagsarlm in spdep package in r to estimate a spatial Durbin (mixed) model by m1 <- lagsarlm(f, data = d, wlist, type = "mixed") and using predict function pred <- predict(m1,newdata = d, listw = wlist) with the original data and spatial weight list to estimate the dependent variable. The estimation is diff...
I have fitted gam for a generated data with binomial responses. The problem is, many times while running this gam with different bootstrap samples, error occurred.
I am currently reading up on RealNVP, which has the following transformations according Lilian Weng: $$ \begin{aligned} \mathbf{y}_{1:d} &= \mathbf{x}_{1:d} \\ \mathbf{y}_{d+1:D} &= \mathbf{x}_{d+1:D} \odot \exp({s(\mathbf{x}_{1:d})}) + t(\mathbf{x}_{1:d}) \end{aligned} $$ I am wondering how the inverse has the scale ...
I have a phylogentic tree of samples, and some samples belong to either of two groups. I'm trying to show that the mean pairwise distance of samples in one group is larger than the one from the other group. I computed the pairwise genetic distance of all samples in a tree using cophenetic.phylo and obtaining the mean p...
I am trying to create a database with a dichotomized dependent variables and a bunch of binary (1/0) independent variables. I'd like to pre-set some associations between the independent variables and the outcome. Doing so is relatively easy - after generating the random binary covariates, I run a binomial function to p...
In Causality - Models, Reasoning, And Inference by Pearl, definition 2.3.3 reads as follows - One latent structure $L$ = $\langle D,O \rangle$ is preferred to another $L^{'}$ = $\langle D^{'},O \rangle$ (written $L \preceq L^{'}$) if and only if $D^{'}$ can mimic $D$ over $O$ - that is, if and only if for every $\Thet...
I am doing a Before/After analysis, which is aiming at evaluating the effect of a change. Assume I have made a change at the beginning of June-2022, and I want to evaluate the effect of the change based on a one-month interval. This results in two time series, related to two distinct months, i.e., the first one is for ...
In https://www.jmlr.org/papers/volume9/zhang08a/zhang08a.pdf, a Maximal Ancestral Graph (MAG) is defined as: a mixed-edge graph that: i) does not contain any directed or almost directed cycles (ancestral) and ii) there is no inducing path between any two non-adjacent vertices (maximal). An almost directed cycle woul...
I'm trying to plan a study based on previous data and I need to know the sample size required for a given effect size. Previous data looks like this: Rating 1 2 3 control 0 20 11 treatment 6 14 12 where these are counts of the number of samples given a particular ranking at some time point in the previous...
I've been asked to fit a ZeroInflatedPoisson model on a dataset to predict Y (count data) for an assignment. First, I did this manually: Create a binary variable (Y_IND) based on Y where Y_IND = 0 if Y = 0, and 1 if Y >=1. Fit a statsmodels Logistic Regression model using X variables to predict the binary variable Y_I...
For $X_1,\dots, X_n$ iid sample from $X\sim Bernoulli(p)$. I try to verity that the estimator $\hat{p}=\bar{X}$ (sample mean) is the UMVUE for unknown parameter $p$. I know that $\hat{p}$ is unbiased. I try to show that $Var[\hat{p}]=CRLB$ (Cramer-Rao lower bound), which is $$ CRLB=\frac{[I'(\theta)]^2}{nI(\theta)}, $...
I have a very specific work-related question which I would like a second opinion on. We have a device that can be powered via battery and AC mains. We have identified a specific failure mode where suddenly, the battery cannot provide power to the device. Let's call this event P(F). In order to pose a risk to the user, ...
suppose I have categorical dataset, I'm doing data pre-processing. what is the correct order of applying these 3 techniques Train Test split SMOTEN to over sampler the minority class Categorical encoding of variables (a mix of one hot, label encoding and target encoding)
I would like to generate a propensity score for a continuous treatment in R, and then control for the propensity score in a structural equation model (using the lavaan package). I'm aware that the twangContinuous package can generate propensity scores for continuous treatments, but it doesn't seem there is an option fo...
Using R, I m performing a backtest on a time series by using quantile regression (quantreg::rq) on a number of features. These features are selected based on a condition such as p-values <= 5%. If I run the routine multiple times, I always end up with the same betas/coefficients on the features, however p-values are un...
I am very new to analyzing and forecasting timeseries data so apologies if this question has an answer too obvious. I am trying to find the residuals between a stationarized price data and white noise ARIMA(0,0,0). library(forecast) library(tseries) DJT = read.csv("DJTA.csv") DJT_ts <- ts(DJT$DJTA, start=c(2013,1), en...
I am dealing with a dataset that has different input data with a different behavior but I am getting confused as I can not find any trend or pattern in my data. I checked seasonality and found nothing. I checked the literature for data that does not have trend and seasonality, but I do not know exactly what is the prop...
I have built this model in R: library(emmeans) library(lmerTest) mixed_age_interaction = lmer(basdai ~ 1 + gender + time + age + gender*time + time*age + gender*age + gender*time*age + (1|ID) + (1|country), data = dat, REML = F, control=lmerControl(optimize...
I've been struggling to find a description of an approach to a situation like mine or any R packages that seem capable of handling my needs. I have a large dataset (~80,000 rows) where my dependent variable is 1 or 0, describing the presence/absence of a feature of individual animals observed. There are two components ...
I have a dataset for a group of 66,000 subjects diagnosed with a dangerous condition, and the time it takes for death to occur (the “event”) or to not occur (survival or “censored”). I am pursuing survival analysis using R. However, what if I am not interested in time-to-event, but just want to study the end of period ...
How to compute $$\int_{-k}^{k}F(x)dx$$ where $F(x)$ is the cumulative distribution function of continuous random variable $X$ which has symmetric pdf about $x=0$ and $k>0$.
Some has given me a positive integer (5). It’s actually a forecast of the mean number of hurricanes for this summer, so we can think of it as an estimate of the mean of a Poisson distribution. But I know they rounded it, so I know the actual number was [4.5,5.5). So I’m going to sample randomly from that interval, by w...
Good evening everyone, I am here to ask a question regarding the statistical models ARIMA & SARIMA use to build predictive models based on past values and with the intent of predicting future values. My question is this: should the data that the statistical model takes as input be normalized and scaled as is the case f...
Consider a random polynomial $p(z)=\sum_0^n A_i z^i.$ where $A_i,i=0,12,3,..,n$ are iid uniform variables in the interval $(0,1).$ I want to show that that the probability of the root with min modulus lying outside the unit disc approaches 0 as the degree becomes larger and larger.That is,the probability that all roots...
This seems like it should be a really simple thing, so I apologize if this has been answered elsewhere, but I've browsed dozens of existing questions and none seem to fit exactly. Suppose I have two cohort groups, control and target. I apply a treatment to the target, and want to use DiD to compare conversion deltas b...
Why do the standard errors for gamlss are much lower than the standard errors from lmer? library(lme4) library(lmerTest) library(gamlss) fit <- lmer(Reaction ~ Days + (1|Subject), data = sleepstudy) summary(fit) # Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest'] # Formula: Reactio...
I want to run a simulation study and I need to simulate data from the Conway–Maxwell–Poisson distribution. However, it seems like the probability mass function is not available in closed-form, so, I do not know how to simulate from this distribution. Is there a method that I can use to simulate from this distribution?...
I am trying to understand how to apply SPRT to the following case. Random variable $X$ is exponentially distributed according to $f(x, \theta)$. Test the following hypotheses $$ H_0 : \theta \ge \theta_0 $$ $$ H_1 : \theta < \theta_0 $$ However, ever example I have found of SPRT uses hypotheses for the form $H_0:\theta...
I am using the multiple linear regression to work out if the glycaemic variables would influence my outcome while holding the body weight and menstrual cycle constant. Here's the thing, for these glycaemic variables, I've measured several related factors, such as glucose peak and glucose nadir, which are highly correla...
I am new to statistics and a beginner in DLNM. I am trying to understand the different functions of DLNM. In the 'crosspred' of DLNM, the exponentiated regression coefficient from the Poisson models, exp(fit), is the relative risk/rate ratio (RR), while with GAM, exp(fit) is at the original scale of the response variab...
So I'm a 3rd year undergraduate doing my thesisin football score models right now. In my thesis I want to include a proof of what the link function for the Poisson distribution is and why it relates the mean to our linear predictors. I'm almost there, but there is one part that most literature seems to gloss over. So w...
Sample $(X_1, X_2,\ldots, X_n)^T\sim{\mathcal{N}(\textbf{0}, \Sigma)}$. What is the expected cross-sectional variance of $(X_1, X_2, \ldots, X_n)^T$? In other words, if $$ S^2 = \frac{1}{n}\sum_{k = 1}^n \left(X_k - \bar{X}\right)^2\qquad\text{and}\qquad \bar{X} = \frac{1}{n}\sum_{k = 1}^n X_k, $$ what is $E[S^2]$? As ...
Goal: I am trying to compare the proportion of participants who choose one of the combined options (A-B and B-A) in questions where they see A-First vs questions where they see B-First. Data: I have data that looks like the following table. Each participant answers 3 questions. For each question, they have 3 choices: A...
Consider a general problem where we try to model an output variable $Y$ with several independent variables $X_1$, $X_2$, $X_3$, etc. that are binary or continuous. From previous study, we know that the values of the continuous variable $X_1$ are affected by a binary variable $Z$ but the $Z$ has no effect on the output....
I was recently at a seminar where a statistician used chi-squared divided by the degrees of freedom (DF) as an assessment of model performance in a logistic regression. They suggested that having a $\frac{\chi^2}{DF}$ close to 1 suggested good performance in the model. I am having some difficulty googling more informat...
When we have categorical features in a regression (say a generalized linear model for now), it is typical to let one category be subsumed by the intercept and then code binary indicator variables for each of the remaining categories, so “cat” could be subsumed by the intercept, “dog” would be coded as $(1,0)$, and “hor...
I have weight as response variable which is continuous variable. And 3 explanatory variables viz; Parity(Count), Age(continuous) and Sex(Factor). I want to fit a glm model using deviances analysis to select the best model from all possible plausible model. The models are nested. How do I go about it pls. Knowing that t...
I just recently started working with logistic regression, and I'm struggling with the interpretation of the results. Say I have brain disease (BD) as an outcome and gestational age (GE) as an explanatory variable. The OR is 0.99. I have used R to calculate this: gl1 <- glm(BD~GE, data, family = "binomial") How do I kn...
I recently came across a setup of differences-in-differences which I have previously wondered about, but had not seen before in a published study. Consider the following setting: Outcome: measured at the monthly level (e.g., employment rate) across multiple units (e.g., states). Data is available across multiple years....
I have a dataset where the first 6 columns correspond to binary entries referring to sick/not sick and 2 additional columns with age and a specific score (dim of the dataset 60x8). I need to generate a correlation matrix from the data. My dataset is pretty small (60 observations) and it doesnt follow a normal distribut...
I've encountered an interesting discussion at work on interpretation of precision (confusion matrix) within a machine learning model. The interpretation of precision is where there is a difference of opinion so my description centers a little bit simplified around precision. The problem discussed with some numbers for ...
Could you please help me to prove the following equation: $$E(x^{-1})=\int_{0}^{\infty}M_{x}(-t)dt$$ Where $M_{x}(-t)$ is the moment-generating function. I think the following equation will be useful: $$x^{-1}=\int_{-\infty}^{0}e^{ux}du$$ for $x>0$
I have a question similar to the ones described in the forum here (http://www.sthda.com/english/wiki/chi-square-goodness-of-fit-test-in-r). I want to know whether one sex is more common than the other at a study site. Unfortunately, I am dealing with a very cryptic species and my sample size is less than 5 for each sex...
I have a question that probably will sound stupid, but I am approaching myself to statistic concepts. I saw that the multivariate standard normal has a distribution characterized by the parameters $0$ (that is, a vector of 0s) and $I$ as a matrix of variance-covariance. I understand the fact that each marginal has mean...
So I got this basic concept of deterministic and stochastic trend. $$\begin{align*}\text{Deterministic trend (DT)} & : y_t = \beta t +\varepsilon_t\\ \text{Stochastic trend (ST)} & : y_t = \beta +y_{t-1} + \varepsilon_t\\\end{align*}$$ But when I'm using actual data for a ARIMA model, is it possible to identify precis...
I hope you're doing well. How do we use this expression of generalised partial correlation coefficient? I struggle with putting it into work in practical examples of multiple regression models. We have the following model : y = B1+ B2x2 + B3x3 + B4x4 + B5x5 + mu Say we want to find the expression of r14.32, the 2nd or...
I am comparing two treatment groups and I have 3 different types of outcomes. The dependent variable, treatment, is time dependent and so I conducted time dependent cox regression for each of the three outcomes. However, for one of the outcomes, one treatment group had no events. Of course, the cox regression output f...