instruction
stringlengths
9
38.7k
I'm doing research which involves data pertaining to the physical characteristics, recorded at consistent intervals, of mice, with the mice's time at death being recorded as well. As such, some mice have more timepoints recorded than others. How should I approach modelling this? I've considered using a hierarchical lin...
Let $X_t=\sum_{j=0}^{\infty} \phi_j \varepsilon_{t-j}$ be an MA($\infty$) process with square summable coefficients. We know that if we truncate the process at $n$, creating the sequence: $$X_{t,n} = \sum_{j=0}^{n} \phi_j \varepsilon_{t-j},$$ then $X_{t,n}$ converges to $X_t$ in mean square as $n$ approaches infinity. ...
I’d like to compare two randomized (independent) patient groups regarding quality of life. The challenge is that each of these two groups comprises patients having two clinical diagnoses. For each diagnosis, there is a disease-specific validated questionnaire available which needs to be applied to assess quality of lif...
So my logistic regression model aims to predict the likelihood of a severe accident (yes/no) based on the characteristics of drivers, car types and other factors. I have data which has all this information for the past three years. When looking at car type, I'm unsure how to include it in my model since there are at le...
I am trying to use the adfuller test to determine whether the following timeseries is mean reverting (stationary) From the chart we can see that its obviously (at least my non-expert eye) non stationary, not even trend stationary. However, here are the results of the adfuller test: adfuller(x=series, regression='c', a...
In genomics, you have an input control (I) and a treatment (T) where then you determine the ratio T/I. You perform multiple replicates for each but the number of replicates is not always the same. Typically, you just average out each of them before finding the ratio. I want to use the information of the variation in th...
I've been having no luck building a general LMM. The residuals are not normally distributed, they follow somewhat of a leptokurtic distribution and homoskedacity is also present. Using log transformation of the dependant variable fixes the homoskedacity but the long tails on the QQ plot are still present: The obvious ...
Using the "classic" transformer model describing in "Attention is All You Need", I'm struggling to understand how the Encoder output is used by the Decoder during cross attention while in inference mode, specifically how the actual matrix multiplication can happen. During training mode, everything makes sense to me: T...
I have data tracking the outcomes of young people participating in an intervention project (between the ages of 12-16). In 2016, data was taken of all young people who had joined the project that year. These included children of a range of ages. On a 3 year follow up, we then recorded who had dropped out of the project...
I am conducting an ecological study that has data on municipalities as a sample. In this data, I have bins with proportions of individuals within a certain category that resides there, for example, % of catholics, % of protestants, % of elderly, of children and of all ages by 5-year bins, % of females, etc, together wi...
My study design seeks to answer the following question: What are the potential risks of switching medications from pre-pregnancy to pregnancy for (1) individuals who switch from medication A to B; (2) individuals who switch from medication B to A; (3) individuals who stopped medication from pre to post-pregnancy; and (...
I'm assessing a paper, the authors of which state that they recruited 3000 patients because that was what the power calculation suggested was necessary to detect a 5% difference at 85% power. They actually only found an effect size of 2% (0.2-5.6), but calculate that this was statistically sinificant (p=0.045). I'm won...
Suppose I have a data set that I believe is well-described as draws from a particular four- or five-parameter distribution, such as the Amaroso or the GB2. Some of those parameters can be made to disappear for certain parameter values, most often zero or one. In the case of interest to me, there are several 3- or 4-par...
Some context: When someone defaults on their loan, we keep track of the recoveries as a percentage of the exposure (loan amount), we have a limited time T (legally) to collect recoveries, those recoveries are accumulated through time, usually they only go up, but sometimes they go down as well in some specific cases. R...
I am using the Levenberg-Marquardt method for calibration purposes. Typically, the RMSE of my calibration looks like: I want to break the algorithm when the algorithm step-updates start to slow down, which is when the RMSE flat-lines at $\approx 150$. But the issue is at the start $\approx 1$ to $5$, the incremental s...
A crowd of size $N$ outside a club is made up of $N/G$ groups of friends, for argument's sake, e.g. $G = 5$. This is a fictitious setup… groups are usually differing in size outside nightclubs… but please ignore this and assume all groups are the same size: i.e. $G$. The bouncer selects people to enter the nightclub at...
I have always wondered about this point : Longitudinal Regression models for repeated measures essentially allow for previous response measurements for the same patient to influence future response measurements for the same patient. In a very naive sense, one could make the argument that Longitudinal Regression model...
I refer to the article "Bayesian Unconditional Power Analysis" by John S. Uebersax (2007). I'd like to explore the subject further. I haven't checked yet the references that the Uebersax's article mentions, but I was wondering it there are other good references or resources about the subject. I'm looking preferably, bu...
For the past few days I have been trying to implement the EM-algorithm in order to segment stores into k-clusters. What I already did was derivation of the complete-log-likelihood and also performed the E-step. Where it goes wrong is the M-step. I showed that I need to optimize the following (See derivation): $-\frac{1...
Hi i have a certain task i want to solve: For two months, participants played an app, in which they played 5 different therapeutic games (TGs). At the beginning of each session, they also completed a 5-scale State-of-Mind questionnaire, rating the extent to which they feel tired (or rested), distracted (or focused), ca...
Suppose $X_i$ are i.i.d. and have density $f_\theta(x) = \frac{1}{\theta}$ if $x \in (\theta, 2\theta)$ for positive $\theta$. $(\min_iX_i, \max_iX_i)$ is a sufficient statistic for $\theta$? To apply the Rao-Blackwell theorem to an unbiased estimator, I start with $aX_i$. We want $\mathbb{E}aX_i = \theta$. $$ \begin...
If highly specific tests are usually used for confirmatory testing (and highly sensitive tests for screening), it seems that True Positive would be the most important factor for highly specific tests. However, it is not a factor in its equation TN/(TN+FP). I understand wanting the least FP for highly specific tests, bu...
I have two questions regarding modeling a 3-level multilevel model in R. I have a dataset of different variables that were assessed 4x as part of a longitudinal study. At each of the four assessments that were 1 month apart, participants filled out questionnaires (= one mean score per participant per assessment) and us...
I have a model like this: Y = endog + exog1 + exog2 + exog3 + entity + time endog = exog1 + exog2 + entity + time (where entity and time are for fixed effects.) In Stata, I am running: . ivreg2 Y exog3 (endog = exog1 exog2), vce(cluster ccode) > ---------------------------------------... | R...
I'm making an implementation of the softmax regression and I'm struggling to understand the nature behind the problem of increasing value of Cross-Entropy: $H(y_i, p_i)=-\sum_{i=1}^C y_i log(p_i)$, along with an increasing accuracy: This is utmost confusing to me, because there's no class imbalance: I am not entirely...
Let $\mathcal{D}_1$, $\mathcal{D}_2$ and $\mathcal{D}_3$ be three distributions defined on some space $\mathcal{X}$. Assume $\mathcal{D}_1 = \mathcal{D}_2 + \mathcal{D}_3$ and $\mathcal{D}_1$ is assumed to be known and for example it's a (multi) variate normal distribution, what can we say about $\mathcal{D}_2$ and $\m...
In Langevin dynamics and diffusion models we see the score $\nabla_{\mathbf{x}}\log p(\mathbf{x})$. Here the notation seems to suggest we're taking partial derivatives w.r.t the free $\mathbf{x}$ variables in the support of $p$. And diagrams (see the section on Langevin dynamics) show arrows in a vector field superimpo...
I am attempting to model log price returns using a company specific variable and several macroeconomic variables on panel dataset. I have several hundred entity observations and 7 years of annual data. My OLS and random effects (RE) models return completely identical results, which is unrealistic, as there must be at l...
A. Suppose I want to fit the regression $Y = f(\lambda X_1 + (1-\lambda) X_2)$ where $f(x) = ax^2 + bx + c$, and $\lambda$, a, b, c are to be estimated using the data. This is nonlinear, but it's straightforward to least-squares fit using the Levenberg–Marquardt algorithm. B. Now, suppose I instead want to handle nonl...
Assume we have the following model: \begin{equation} Y_{it} = \beta_0 + \beta_1X_{it} + \alpha_{\text{country}_i} + \alpha_{\text{industry}_i} + \gamma_t + u_{it} \end{equation} We have country, industry and time fixed effects. Observations are companies. Dependent variable = Output in terms of production. Generally,...
Let the multi-class hinge loss be given by: $$ L(\Theta,(x,y)) = \max_{j \neq y} \Big[ 1+ \sum_{i=1}^{d} x_i(\Theta_{ij} - \Theta_{iy}) \Big]_{+} $$ $$ = \max_{j \neq y} \Big[ 1+ \langle x, \Theta_{\cdot j} - \Theta_{\cdot y} \rangle \Big]_{+} $$ where $\Theta \in \mathbb{R}^{d \times K}$ is the classifier, $x \in \ma...
When we do OLS, as I understand it, we do all our derivatives to obtain some $\beta_0$ and $\beta_1$ that minimize the SSE (unexplained error between the observed data and the estimated response $y_i$-hat). Since we have optimized the SSE and obtained values for $\beta_0$ and $\beta_1$ then why are they treated as rand...
This question is asked to evaluate $\mathbb{P}(X>Y>0)$. I was thinking if this probability can be evaluated as $\mathbb{P}(X>Y | Y>0) \cdot \mathbb{P}(Y>0)$ by conditional probability. But I had no idea how to calculate $\mathbb{P}(X>Y | Y>0)$. Any hints will be appreciated!
Good afternoon. I'm have a coefficient interpretation question. I have two tables that all have the same outcome variables. Table 1 has no county fixed effect and table 2 has a county fixed effect. The estimates are of the percentage of a census tract that identify as a specific demographic. Subsequently, they can only...
BACKGROUND: I do research in budget-proposal aggregation: each person reports their ideal budget-allocation, and a central authority has to decide on an actual budget-allocation. An important component in designing such procedures is the form of the voters' dis-utility function: given that a voter's ideal budget is X a...
$X:\Omega\to [0,1]$ is a random variable. It is known that first order stochastic dominance FOSD is a partial order that is transitive: $X$ FOSD $Y$, $Y$ FOSD $Z$ implies $X$ FOSD $Z$. Now consider the relation not FOSD. $Z$ not FOSD $Y$ and $Y$ not FOSD $X$. Is it true that $X$ FOSD $Z$ is not possible?
Having my first go at R and stats. I sampled and analyzed tree rings for different measures (width, density, etc.). There are 3 treatments, 3 plot per treatment, and 5 trees per plot. The ring time series is 2000-2020, and treatment begun in the middle. I would like to test whether there are differences between the 3 t...
Having found nice formulas for testing the null hypothesis under exponentially-distributed samples, I wanted to see how well permutation tests could do the job. And the answer, assuming no mistakes, appears to be: very poorly! Are permutation tests really this weak, or is something wrong here? The challenge: Given tw...
Recently I read a lot about error covariance structures, especially for longitudinal models. I have found that it is not possible to specify such a structure in lme4. So my question is, what kind of structure does it assume/estimate ? It seems that it's something like $\delta I$, where $I$ is the identity matrix and $\...
I have been asked to help analyse some recurrent-events survival data (using an Anderson-Gill model) looking at risk of disease relapse among two different subtypes of the disease (primary covariate) adjusting for other covariates. That's all fine. I was then advised that the subtype groups were systematically differen...
Let $\Omega, F, P$ be a probability space and $A, B, D \in F$. If $P( A \mid D ) \ge P(A)$ and $P( B \mid D) \ge P(B)$. Show that if $A \cap B = \emptyset$ then $P(A^c \cap B^c \mid D) \le P(A^c \cap B^c)$. I know that given that $A \cap B = \emptyset$ then they are mutually exclusives, this means that $P(A \cap B) = 0...
Let $\Theta$ be a compact metric space, $\theta \in \Theta.$ Let $m_{\theta}:\mathbb{R}^d\to \mathbb{R}: x\mapsto m_{\theta}(x)$ be a family of measurable function indexed by $\theta \in \Theta.$ Let $P(f):=E[f(X)],$ where $X:\Omega \to \mathbb{R}^d, f:\mathbb{R}^d\to \mathbb{R}.$ So below, $P(m_{\theta}-m_{\theta_0})...
Let's say we have two estimators for $\beta$. $\beta$ denotes all a full set of coefficients, one for each covariate in a dataframe. $\beta$ can be split into $\beta_p$ and $\beta_r$, where $p$ denotes a subset of features and $r$ are the removed covariates. So we estimate two models, $y = X_p \beta_p$ and $y = X\beta$...
Goal I am conducting a pre-experiment analysis to determine what the necessary sample size is given a specific power, significance level, and lift. Data This is for a research question where I have a distribution of monetary deposits from a large sample (large enough to be considered the population it is drawn from). M...
I would like to understand the following post with regards to the code below. https://www.kaggle.com/competitions/optiver-realized-volatility-prediction/discussion/276137#1559582 Initially, Principal Component Analysis (PCA) of a feature array (e.g. returns) with dimensions [ time ids x stock ids ] is carried out. Ther...
So I'm trying to make a multivariate logistic regression model in R studio. I'm not sure how to go about this. What seemed to make sense to me was to model every predictor against the response individually and see whether there's any individual significance. If there's no relationship between a single predictor and the...
Let X be a discrete random variable such that X = 0 with probability 0.5 and X = 1 with probability 0.5. Let Y be a discrete random variable such that Y = 1 when X = 1 and Y = 0 when X = 0. What is the mean and variance of X - 3Y (let W = X – 3Y)? Calculated below X and Y Mean 0.5 X and Y variance 0.25 Mean X-3Y - >> ...
I'm analyzing a computationally demanding numeric model where I want to show that nonlinearities play a certain role for my problem. I want to do this using Sobol sensitivity indices of first oder by showing that their sum is less than 1. However, I am a bit unsure how to prove this, as the difference may also come fro...
Introduction Consider a well-behaved Markov chain with desirable properties (irreducible, aperiodic, positive recurrent), characterized by a transition matrix $P$ and a stationary distribution $\pi$. The stationary distribution satisfies the equation: $$ \pi = \pi P \tag 1 $$ Here, $\pi$ is a row vector whose summation...
Why do we need discretize our judgements using hypothesis tests? Why can't we just have people report the data every time a study is done, and the p-values and effect size, and then report how the data altered their subjective probabilities? It is more valuable for people to have their own probabilities of certain stat...
I have seen regression models with a continuous predictor fitted as a spline written like this: What is the meaning of the little "addition symbol" subscript that I have circled in red? Is it simply a "pointer" to the next equation below, where extra information is given regarding the particular values we assign to x ...
I am trying to fit a dataset that depends on one observable, i.e. x. The model has two parameters that are highly correlated, of the form: $$f(x, \frac{\alpha}{\beta})=f(x | \alpha, \beta)$$ For the fit I am using a gradient descent algorithm on a likelihood function. The likelihood won't see the $\alpha$ and $\beta$ p...
There are statistical test suites (below) that are commonly used to determine whether a sequence appears to be (pseudo) random. Some of these test suites have a few tests (ent/ent3000), whilst others have over a 100 (NIST STS). All of them assume the same null hypothesis that the samples are from an independent and un...
In R, I can simulate data from 3 groups: data = data.frame(Group=factor(c(rep("A",50),rep("B",50),rep("C",50))), Y=c(rnorm(50, 50, 0.5),rnorm(50, 100, 0.5),rnorm(50, 10, 0.5))) The default contrast matrix is B C A 0 0 B 1 0 C 0 1 so the intercept will correspond to the estimate for group A, and t...
I'm reading a paper which says: In performing the logistic regression analyses, the order of entry of predictor variables was guided by our theoretical rationale and our major hypotheses. In each analysis, control variables reflective of selection effects (income-to-needs ratio, beliefs about the benefits of maternal ...
Originally I posted this on Quantitative Finance SE here but got no response. Months later, I am posting it here hoping for better luck. Suppose we are given a dataset with $T$ time periods and $N$ assets or portfolios. We are interested in estimating and testing an augmented CAPM or a multifactor model with an additio...
I have been using PCA for the pattern recognition of my gas sensor array data. But recently decided to use PLS using OriginPro software. My sensor array data consists of responses coming from 8-10 sensors (used as columns) which I use as variable data. My target is to quantify the analytes which in my case is for 4-5 d...
I have a question how to compare the distribution of one tested biomarker among patients with different overlapping clinical syndromes. In my case, I am investigating patients with multiple sclerosis and their clinical symptoms can be attributed to several different syndromes, for example pyramidal, sensory, etc. Moreo...
For a VAR process $$ X_t = A_1 X_{t-1} + \epsilon_t $$ The covariance of $X_t$ can be computed in the following way: $$ \text{vec}(\Sigma) = (I -(A \otimes A))^{-1} \text{vec}(\Sigma_{\epsilon}) $$ For large dimensions computing $(I -(A \otimes A))^{-1}$ is computationally expensive. I want to know if there are efficie...
I have a time series data with a dependent variable representing a stock market value of some stock. This data is available for weekdays, but unavailable for weekends as there is no trade. In addition I have values of some independent variables. This data includes weekends in addition to weekdays. What should I do in t...
I have just run a DCC GARCH model in R and am trying to interpret the output. I have run the model with 3 time series. I know that alpha and beta tell about the short- and long-term spillover effect. However, I only get one dcca1 and dccb1 even though the values of dcca1 and dccb1 should be different for the different ...
I'm trying to run a multiple logistic regression model where the dependent variable is dichotomous and independent variables are either bynary or continuous. At first I only had access to PSPP, but ended up getting access to a SPSS license. I ran the model on both softwares with the same dataset and got very different ...
I have a sample of $(Y_{i,t},X_{1,i,t},X_{2,i,t})$ for $i=1,\dots,N$ and $t=1,\dots,T$. I want to figure out which data generating process (DGP) it comes from, DGP1 or DGP2. DGP1: $$ Y_{i,t}=\lambda_0+\lambda_1\beta_{1,i}+\varepsilon_{i,t} \tag{1} $$ with $\lambda_0=0$ and $\varepsilon_{\cdot,t} \stackrel{\text{i.i.d.}...
An urn contains ​B black balls and ​W white balls. One ball is ​d​rawn at random and a ball of the opposite color is placed in the urn. W​hat is the mean and variance ​o​f the number of draws necessary to have the urn filled with balls of the same color? In the first draw, P(black) = B/(B+W) and P(white) = W/(B+W). If ...
I am trying to fit a hierarchical model that estimates the covariance of some parameters, using the probabilistic programming language pyro. In simulation experiments, I saw that the MCMC generates good posterior samples that estimate the ground truth covariance well. However, to scale up the model to high-dimensional ...
I trying to sample using Gibbs from a proportional distribucion $f_{Z}(z)$: \begin{align*} f_{Z}(z) \propto e^{-z}\left(1-e^{-z}\right)^4, \quad z >0 \end{align*} using the joint $f_{Z,\textbf{U}}(z,\textbf{u})$ $$ f_{Z,\textbf{U}}(z,\textbf{u}) \propto e^{- z} \prod_{i=1}^4 I_{\left(e^{-z}, 1\right)}\left(u_i\righ...
I ran a pilot study for a within-subjects experiment where the fixed effect of interest is categorical, with 4 levels. The research question involves comparing which levels of this IV can statistically be considered similar versus different. Here's a simplified example. Let's say that for Levels A, B, C, D, the mean re...
Does anyone know if it is possible to fit a left censored GEE model with autoregressive correlation structure ? I know censReg can handle left censored repeated data but I am not sure if I can specify a autoregressive correlation structure ?
I'm currently in the planning phase of an experiment involving 2 factors, each with 2 levels, and 3 replications per combination, resulting in 12 experimental runs. In Minitab, the suggested blocks in the factorial design are numbered 1, 2, 3, and 6. However, practical constraints limit me to conducting only 3 experime...
I have two densities, $p, q$ with sample space $\mathbb{R}^n$, and we can assume both $p,q>0$ (full support). I can compute and sample from $q$. I can compute $p$ up to a constant and I cannot sample from $p$. (A general example is $p(t) = \exp(f(t))/Z$, where we cannot compute the normalization constant $Z = \int_t \e...
Imagine you have three variables: X, Y, and Z. X and Z are both separate causes of Y. You want to know if changes in Y caused by Z correlate with X. So, you manipulate Z to cause changes in Y. Let's call the observed changes C. When you manipulated Z, you also unknowingly manipulated X. So, C contains effects from both...
Please pardon my ignorance, what is a mixed effects model without random effects, without any random intercept or random slope? Is this similar to marginal GEE model?
Mean of a random variable $X$ is its expectation. I am interest in the new definition, mean of probability distributions Let $p,q$ be probability density distributions. $0.5p+0.5q$ is the mean distribution. How to generalize this definition of mean to uncountable infinite number of distributions $p$? What is the proper...
Design: We tested mixtures of 12 varieties of species A with species B in multiple growing seasons using an RCBD (Randomized Complete Block Design). The content of species B in the mixture was consistently 15%. After harvesting, we determined the proportion of each species' seeds in the harvested sample. Hypothesis: Ou...
I apologize if I am not being very clear, I have basic knowledge in statistics! I am trying to analyse my data but I am unsure if repeated measures ancova is the way to go. I have a variable named "A" measured in three different conditions "1", "2" and "3" (the sample size between groups is unequal). I also have a cont...
This is an exercise of the textbook Nonparametric and Semiparametric Models by Wolfgang Hardle Exercise 8.1. Assume that the regressor variable $X_1$ is independent from $X_2, \cdots, X_d$. How does this change the marginal integration estimator now? Intepret the change. We know that the estimation of marginal effect...
Are both terms equivalent? They seem very similar to me. Or does one imply the other?
I've conducted a regression analysis using an event study methodology to explore the Cumulative Abnormal Returns (CAR) linked to stock repurchases over one and two years. Interestingly, while year 1 showed statistical significance, year 2 did not. Now, I'm investigating the factors influencing CAR in both periods, usin...
I have a time series data from a wearable device. I have two time series as arrays df1.VALUE1 and df2.VALUE1. I would like to to measure similarity of these arrays. These arrays have different sampling rates and different array lengths. For both arrays measurements happens in different intervals, usually around 15-30 ...
I am working on a project to automatically evaluate Raman spectra from a production process. It already works for some compounds with the chemometrics software Ramanmetrix (desktop version 0.5.0). This are a few entries of the metadata table: file date device standard type batch time Glycerol Produ...
I have been unable to find references to understand how count data can be modeled where each count observation has an unknown upper bound lying in a particular range. Let's consider the following example so that I can make my problem statement clear: In a study, a statistician is trying to model number of cigarettes ea...
I'm estimating the simple model communication_share ~ grid_size * n_procs. From the theoretical background I would expect a negative effect of grid size and a positive effect of number of processors. Estimating my model gives me the following coefficients. Predictor B SE t p Intercept -5.24327 0.36280 -14.45 <0...
Introduction. In a test, I would like to use both the Fisher's moment coefficient of skewness (Joanes, 1998) $g_{\text{Fisher}} = \frac{m_3}{{m_2}^{3/2}} = \frac{\frac{1}{n}\sum_i (x_i - \overline{x})^{3}}{\left(\frac{1}{n}\sum_i (x_i - \overline{x})^{2} \right)^{3/2}}$ and the Bowley’s coefficient of skewness (Ekström...
I have data from 4 populations : A (n=16), B (n=16), C (n=14) and D (n=16). Data from A and B are not normally distributed. Data from C and D are normally distributed. All data passed the Levene's test for equality of variance. Kruskal-Wallis test does not show any differences between group. The independent Mann-Whitne...
I am working with data consisting of concentrations of different metabolites taken from different subjects at different time points. I want to find out the relationship between Metabolite A specifically and Metabolite B, Metabolite C, Metabolite D and so on, to see if there are any metabolites that can be used to predi...
Question: Customers arrive at a shop according to a Poisson process with rate $\lambda > 0$ per hour, with probability $p$ being male and $1-p$ being female. During the first hour $n$ people arrived ($n \ge 1$) Calculate $\mathrm{E} (Z|A)$, where $Z$ is the arrival time of the first male customer and $A$ is the event t...
I am conducting a study aiming to determine whether repetitive sedentary time over 7 consecutive days is associated with hypoglycemic events during the same period. Here are my variables: Independent Variable: Sedentary time (measured over 7 days using accelerometry) Dependent Variable: Hypoglycemic events, daily avera...
I am trying to analyse my data but I am unsure if repeated measures ancova is the way to go. I have a variable named "A" measured in three different conditions "1", "2" and "3" (the sample size between groups is unequal). I also have a continues covariate measured just once in the first moment. My r code until now is: ...
I want to learn statistics and probability for machine learning and data science, and I'm don't know what textbook I should use for self-study. Now my choice is between The Elements of Statistical Learning - Trevor Hastie or Fundamentals of Probability: A First Course and Probability for Statistics and Machine Lear...
I'm new to stats and I'm not sure how to interpret the output of my glm model. I have two fixed factors, task which has two levels (task A and task B), and condition which has four levels (conditions a, b, c, and d). Both factors are sum-coded (because I don't have a clear baseline/reference level). > contrasts(data$co...
Let's say I am promised that a coin is biased to have probability of heads either $p_1$ and $p_2$. How many times should I toss it to ensure that I know which coin I got, assuming I can be wrong in my conclusion with probability $\varepsilon$? According to this video, if $p_1 = \frac{1}{d}$ and $p_2 = \frac{2}{d}$ for ...
UPDATE----------------- I have data where one ID can serve as a comparator several times. This is done by creating a variable to group the treated in variable GROUP. Assume variable GROUP, as an example, containing the number of visits to a physician until a therapy is initiated. Thus, ID 4 initiated the therapy after ...
I am working on a GLMM and want to know: if you add a quadratic term to one variable (x1^2) do you also then need to include a quadratic term in any of its interactions (e.g. x1:x2)? My formula: quadratic.model(glmm) <- y ~ x1 + + I(x1^2) + x2 + x1:x2 + I(x1^2):x2 OR how would I know if I should only apply it to the ...
I'm trying to implement equation 3 from this article research paper, for ease here's a screenshot of the equation: Here's my code for it taper_model = nls(d ~ (Is*((D^2)*(1 + (((b2 + (b3/D^3))*((1 - (h/H)^b1) - (1 - (1.37/H)^b1)))/(1 - (1 - (1.3/H))^b1))))) + (Ib*(((D^2) - ((((D^2) - (F^2))*(((1 - (1.37/H))^...
I'm trying to implement a logistic regression model with random effects and interactions. For some reason, when I remove an interaction between a parameter and a random effect parameter (Player and Shot.after.PC), the variance and random effect values decrease to 0. glmer(GOAL~ (1|Player) + match_seconds_bin * Score.Di...
I asked this question earlier this week but I hadn't really done my research yet or inquired into my error. So my data is heteroscedastic which has necessitated computation of robust standard errors to account for the violation. This is what my model looks like (as implemented in R) TD_PE_analysis1_v2 <- lmer(PE ~ lear...
I'm analyzing the product field failure data where each product can have one or more failures (Failure A, Failure B, Failure C, Failure D etc.) My goal is to understand the correlation between failure A and failure B. The challenge is the sample of the failure data I have is biased i.e. for example if 10000 products ar...
I am carrying out a multivariate multi-level meta-analysis, and I have a question regarding including moderator variables in the context of publication bias. Doucouliagos and Stanley (2009) recommend modelling 1/SE as an independent variable in an ordinary least squares regression to test for evidence of publication bi...
I'm using interrupted time series analysis to estimate the impact of an intervention in the same group. However, my target variable is a satisfaction index that goes from -1 to 1. How can I model a dependent variable that is bounded between -1 and 1? The distribution of the dependent variable looks like this:
With two groups I can either perform ANOVA or T-test. Additionally I can have one-sided test, if I want to make sure I get the same conclusion from both tests and for t-test I choose alpha=0.05, I need to choose an alpha of 0.1 for the ANOVA. So that means the critical areas are different ? I'm confused because it seem...