instruction
stringlengths
9
38.7k
I have run a pooled logit regression (using R) with a dependent variable of probability of CEO turnover. I have several binary and continuous independent variables, and an interaction term between binary and continuous variable. I am confused about interpreting the results, since interaction term does not have a margin...
I am very new in performing the Difference in Difference analysis. Before starting the analysis, I would like to check the data if it is violated the most primary assumption 'parallel trend'. For my understanding, we should examine the trends are significantly different between case and control groups in the pre-interv...
I have a time series $X_t \sim N(0, 1)$. There is a single outlier at index 347, at 8.5 standard deviations from the mean. If I now compute a rolling window standard deviation of $X_t$ with window size 100, we of course see a large spike at index 347. Once this observation has fallen out of the 100 period window, the ...
I performed a study where I took 9 measurements from each participant for 2 factors (time/ location) and 3 variables each. These created the following combinations: T1L1, T1L2, T1L3, T2L1, T2L2, T2L3, T3L1, T3L2, T3L3. My data is not normally distributed. I ran the Friedman test and Wilcoxon signed-rank test for above ...
I am reading the Performer paper https://arxiv.org/abs/2009.14794. To understand their ReLU kernel used to approximate softmax attention, I need to evaluate $\mathbb{E}[ReLU(x^T w) \cdot ReLU(y^T w)]$ where $w \sim \mathcal{N}(0, I)$. I was able to reduce the problem to the more general one of computing $\mathbb{E}[|X ...
I am using the manyglm function from the mvabund package. I have a site X species/family dataset of counts. One organism in the community is vastly more abundant than the others (by multiple orders of magnitude) so a standard practice for sampling is to use one effort to get a count for that organism. The rest of the c...
I have run a pooled logit regression (using R) with a dependent variable of probability of CEO turnover. I have several binary and continuous independent variables, and an interaction term between binary and continuous variable. I am confused about interpreting the results, since interaction term does not have a margin...
I have four different studies, each with the same two continuous predictor variables, $x$ and $z$, and a continuous outcome variable, $y$. In these studies, I use hierarchical linear regression to analyze the data, and my primary interest is the two-way interaction of $x\times z$ on $y$. I would like to do an internal ...
I am doing sarcasm detection using code mixed data. Sentences are in English and Hindi written in English alphabets. Is there a way to apply Facebook MUSE to generate word embeddings out of this data?
Say I have several regions' melon produce data. I wish to measure the variability of melon weight in each area, and summarize these as an overall variability metric accounting for the different sizes of each area. In equation, it will be similar to weighted arithmetic mean: $$ \frac{\sum_i Variability(i) Area_i}{\sum_i...
Suppose I want to get training data for a model that deals with sentiment analysis for text that indicates an affirmative (yes) or negative (no) response, such as "Alright" $\to$ "YES" "no sorry I can't" $\to$ "NO". And suppose my way of getting training data is by querying from an SQL database. Suppose I expect there ...
I have two equations of the form: $y = X\beta + Z\gamma + r\alpha +\epsilon_1$ (1) $r = Z\delta +\epsilon_2$ (2) The basic intuition here is $y$ is total cost data, $X$ is a matrix of variables relating to technologies, and $Z$ is a matrix of geographical attributes that can impact total cost. $r$ is an indicator that ...
Lets say I am classifying if a user will like a Airbnb listing or not (binary classification model) I have 2 features: Number of house rules the Airbnb host has. Since this is a count, this is a discrete (categorical) variable. We will store this as an int because it is ordered (10 house rules is greater than 9 house ...
I give a try to read the arXiv paper Distributed Adaptive Sampling for Kernel Matrix Approximation, Calandriello et al. 2017. I got a code implementation where they compute ridge leverage scores sampling sequentially using this paper, $$\widetilde{\tau}_{t,i}=\frac{1-\epsilon}{\gamma}\left( k_{i,i}-\boldsymbol{k}_{t,i}...
This is the formalization for a continuous regression model as I understand it: Assume that your outcome $Y$ is normally distributed. Assume that your predictors, $X_1, X_2, \cdots X_n$ are normally distributed and uncorrelated. We then model $$ Y \sim a_1 X_1 + a_2 X_2 + \cdots a_n X_n + \epsilon $$ with $\epsilon \si...
I have been trying to run a zero-inflated poisson model as follows: Model2_2_4 <- zeroinfl(Conflict.intensity ~ Distance.from.fence + Distance.from.water + Distance.from.roads + Elevation, data = data2_2) Here, Conflict.intensity is a continuous response variable. Can someone help me understand why I am getting NaN v...
For a university course I'm doing research on the effect of veratridine in earth worm axons. We have tested 6 axons (less than expected due to time limitations) in three conditions: control (no drug added), veratridine (10microM), and washout. Within these conditions we stimulate the axons with five different voltage s...
I was reading the helpfile for the dropterm function in the R MASS package, which is one of the main building blocks of the stepAIC function (at least for backwards stepwise regression.) The aim of this function is to identify a variable to remove from a model by sequentially considering models that drop one variable. ...
I'm a student trying to adjust a count data GLMM to zero inflation using function glmmTMB. Model family is nbinom1 family (better AICc compared to nbinom2 and poisson). My data contains about 20 % zeros and I consider the zeros true zeros due to low abundance of individuals. The ratio predicted/observed zeros stays 0.2...
I know that Sa divided by Sq (arithmetic mean/standard deviation) on a standard normal distribution is equal to 2/(2pi)^0.5 or 0.7978 but need to have the mathematical solution. Can anyone help me with the proof? Thank you.
There are various "universal approximation theorems" for neural networks, perhaps the most famous of which is the 1989 variant by George Cybenko. Setting aside technical conditions, the universal approximation theorems say that any "decent" function can be approximated as close as is desired by a sufficiently large neu...
Problem statement: I am working on a project for a major game producer. The company is planning to sell the SKUs of one of their game titles (a title has multiple games) to the people who are purchasing their consoles. Let's say there are 3 games in that title - G1, G2, & G3. I have a set of accounts (players) who have...
I am trying to get hazard ratio predictions from a coxph model at different levels of a given predictor. I know this is possible in SAS using the HAZARDRATIO function, but I do not know how to do this in R. I am using a large biomedical dataset, and in order to properly assess the relationship between my predictor of i...
I am wondering about the following: For a symmetric matrix $A \in \mathbb{R}^{n \times n}$ and vector $x \in [-1,1]^n$, if $X$ is a random vector in $\mathbb{R}^n$ such that w.h.p. $X_i \not\in [-1,1] \; (\forall i)$ does it then hold with high probability that $x^\top A^2 x = \|A x\|_2^2 \leq \|A X\|_2^2 = X^\top A^2 ...
I have a series of independent measurement of a percentage of binary events. (e.g. 60%, 65%, 55%, 59%, 60%). How can I test that the observed distribution is different from a theoretical of 50%.
I'm reading the paper "How to estimate the effect of treatment duration on survival outcomes using observational data"(https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6889975/), and it states that: "Quantifying the effect of treatment duration on survival outcomes is not straightforward because only people who survive fo...
I have a dataset consisting of 3 variables: a time series related to hourly energy load (expressed in thousands of MWh), a dummy variable related to business hours (e.g. the dummy is 1 the current hour is between 9-18, 0 otherwise) and one for weekend days (e.g. the dummy is 1 if it's Saturday or Sunday, 0 otherwise). ...
I have a dataset of 2 conditions. Each condition has 15 measurements. I tested them using paired t-test to find if the difference is statistically significant. Should I use a p-value correction method for such a single test with a small sample size? If I should, which methods are suitable for this case (except Bonferro...
I am working on a PV energy production forecasting problem. With various ML models (ANN, RNN, LSTM) I am trying to predict the energy for the following day, based on the historical data. The aggregated dataset consists of multiple individual datasets from PV systems with different peak values. My idea is to normalize e...
Working with decision tree and I have couple of questions: Should I always do random forest before or I can just do the decision tree, skip the random forest part? Should I always have a training data set and test set? Or, I can run the model just on the orginal data? What method is suitable if you don't have any fact...
I have data for hundreds of individuals over several (often tens) of years. My dependent variable is a binary event that may or may not have happened for each individual in some given year. The event can only happen once per individual. Independent variables include individual characteristics that do not vary over time...
Say I have a (generally high-dimensional) random variable $X$ with known, continuous CDF $F(X)$. Is there a good algorithm for drawing values of $X$ that doesn't require that I calculate the joint density? I'm specifically interested in the GEV distribution used in the latent variable formulation of the nested logit: $...
In my experiment, There are two fixed effects, Temperature and Condition with 4 and 3 levels respectively. There are total of 12 different containers, 3 per temperature and individuals of all 3 Conditions were reared together in each container. Since a container was shared by all condition treatments but only experienc...
I’m creating a research proposal poster in which I’m looking at if a reading scheme increases intrinsic motivations to read. I’ve chosen a sample of participants with half taking part in the scheme, and half being the control group who dont take part. All participants will complete a reading questionnaire at two points...
I am a beginner in linear mixed models on RStudio and would like some advice on what I would like to do with my data. I work in the field of cognitive neuroscience and my research focuses on understanding face processing in adults. We measure face processing using eye-tracking measures (here pupil dilation) and a parad...
I've used time-series forecasting (ETS, ARIMA, etc.) models but because of the depth of my data I'm exploring using the survival and related packages in R to forecast future period survival probabilities. For example, if we have 24 months of survival data, I'm interested in forecasting months 25-36 using the statistica...
I have inherited a dataset with a truly chaotic trial design. 32/155 varieties are duplicated at least once, most having 2-4 reps, but one is repeated x5, another x8, and another x19. I was told that the 'blocks' are just the four columns. Here's a link to the trial design: https://nbicloud-my.sharepoint.com/:x:/g/pers...
More context: these are the residuals from a mixed model where the response variable is a % that varies between 60% and 95%. Have tried the following transformations: Log Sqrt (and variations) 1/x (and variations) arcsin (after transforming % to values between 0 and 1) Yeo-Johnson
Say I have the following treatment: \begin{array}{cccccccccc} \hline unit & year & treatment & d^{-3} & d^{-2} & d^{-1} & d^{0} & d^{+1} & d^{+2} & d^{+3} \\ \hline 1 & 2000 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 2001 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\...
I have this interaction plot and I'm having some trouble interpreting it. I can see that level 3 of factor A cuts through both 1 and 2, which means that level 3 of A has significant interaction with B. However, levels 1 and 2 of A are almost parallel. I thought this would suggest that the interaction $(ab)_{ij}$ when $...
The probability that A wins when he/she has $\alpha$ points and player B having $\beta$ points is equal to $$ p_\text{win}(\alpha,\beta)=\binom{\alpha+\beta+1}{\alpha-1}p^\alpha(1-p)^\beta $$ where $p$ is the probability that A wins a point. Next I implement this into the probability mass function of the binomial distr...
so basically I want to test differences between two systems. I am collecting time needed for executing queries, every query was executed 50 times. I have defined some queries such as q1, q2... qn each query has some specific meaning for example queries q1,q2,q3 are aggregation queries, thus those are part of a group "a...
Let's say we start off by generating 2 random uniform variables between 1 and 100 rv1=np.random.uniform(1,100,1000) rv2=np.random.uniform(1,100,1000) rv2=sm.add_constant(rv2) sm.OLS(rv1, rv2).fit().summary() OLS Regression Results ===============================...
Would anyone be able to help solve this: $\dfrac{\mathbb E[|X-\mu|]}{\sqrt{\mathbb E[(X-\mu)^2]}}=\sqrt{\frac2\pi}$ for a normal distribution. Related to the mean of a half-normal distribution?
I have a dataset consisting of subjects with a number of measurements associated with each them. Each of a subjects measurements has a time series associated with it and all patients have the same set of measurements. I have been told that the nominal value of the measurements can be grouped into categories (I am expe...
I have a classiification problem with a dataset where the number of variables is very large, and the number of observations is small. Approximately 200 observations and 10000 variables. I am using a SVC model to make the predictions and I want to use SHAP to meassure the importance of each variable, to try and see of t...
I'm trying to fit a simple hierarchical model using simulated data. The model is $$y_{ij} \sim N(\mu_i, \sigma^2)$$ $$\mu_i \sim N(\mu, \tau^2)$$ The log joint distribution of parameters and data is: $$\log p(\boldsymbol y, \mu,\tau,\sigma,\boldsymbol \mu) = \sum_{i=1}^m \log f(\mu_i;\mu,\tau) + \sum_{i=1}^m\sum_{j=1}^...
How can I reduce dimensions using Partial Least Squares (PLS)? My goal is to reduce dimension in the indepentend component way.
I have a proportion data (0-100%, or it can be count data 0-20) that is not normally distributed. The hist graph in R shows: I have tried many ways to transfer data (log, coxbox, ranktransfer), but non of them works. Is there any other way that I can transfer these data to normal distribution? If not, I think the only ...
Consider two dependent random variables $X$ and $Y$, i.e. $E(X|Y) = g(Y)$, where $g$ is the conditional mean function. From the conditionning theorem we know that $E(X|X)=X$. Can we similarly simplify the expression $E(X|X,Y)$ in some way?
I'm experimenting with quantifying uncertainty in data from a Bernoulli distribution by measuring the likelihood the p parameter using the beta distribution. Specifically, I'd like to show how uncertainty changes over time as you update the alpha and beta priors of beta distribution with data from a Bernoulli distribut...
Here a few cases I run into while building a time-series model. Case 1: Two time series, both monthly, different release dates. Say I want to take the quotient of monthly time series A which is released on the 15th of each month and time series B which is released on the 1st of each month, then take the 3 month and 12 ...
I am working on a study where I have species presence/absence data for 80 independent sites, as well as the soil carbon values for each of the sites. I want to test whether the presence/absence of each species is related to the site's soil carbon value. In other words, which species coincide with site that have high so...
I am running a linear mixed model on hierarchical data. I have 500 samples from 3 regions. Within each region, samples were taken from 3 urban and 3 nonurban sites. I am interested in how the classification of the site as urban or nonurban impacts trait y. This is my model: y ~ class + (1|region) + (1|site) + (1|sex) I...
Let $X$ be a real-valued random variable with density $f(x) = (2\theta x + 1 - \theta) \mathbb{1}(x \in [0,1])$ where $1$ here is the indicator function and $-1 < \theta < 1$. I am trying to derive the most powerful size $\alpha$ hypothesis test for the hypotheses $\begin{cases} H_0 : \theta = 0 \\ H_1 : \theta = 1 \en...
I was reading this article which introduce the families of distribution for the median of an random sample. However, the writer did not state the reason why one is interested in modelling the distribution of the median of a random sample. I found articles that related to this in here and here but they still did not men...
If a distribution belongs to a certain class, then the distribution with the largest entropy in that class is typically referred to as the least-informative distribution. To me, this his highly confusing. We have the following definition of self-information (or information content): $$I(X) = -\text{log}(P(X))$$ More of...
In R, suppose you generate $10^7$ random variates of the standard Cauchy distribution. Then you plot a histogram and density of this simulated data with the actual standard Cauchy density on top of it. For some reason, the charts don't match: n = 10^7 tibble(cauchy_real = rcauchy(n)) %>% filter(cauchy_real >= -10, ca...
Suppose I have the following hierarchical distribution: $$\mathbf{y} \sim \text{Normal}(\mathbf{X}\boldsymbol{\beta} + \mathbf{K}\boldsymbol{\alpha}, \sigma^2\boldsymbol{\Sigma}_y),$$ $$\boldsymbol{\alpha} \sim \text{Normal}(\boldsymbol{0}, \sigma^2_\alpha\mathbf{I}),$$ $$\boldsymbol{\beta} \sim \text{Normal}(\boldsymb...
This was one the [question][1] which was helped and suggested by [EdM][2] how to do it in R way. So far what I have done is this The dataset6 is my complete dataset which include all my genes and the Scores of the two modules which I have already calculated based on the regression coefficient already obtained. dataset...
I am trying to understand the proof of Theorem 16.14 of Probability Theory by A. Klenke (3rd version) about the Levy-Khinchin formula. I would like to know how to prove this: $$E[X]=\int x e^{-v(\mathcal{R})}\sum_{n=0}^{\infty}\frac{v^{*n}(dx)}{n!}=\int xv(dx)$$ Where: $X$ is distributed as a Compound Poisson Distribu...
I have 24hrs of temperature measurements taken in one minute intervals for a set of individuals. Thus, there is a non-independent distribution of temperatures for each individual as each measurement is correlated with the previous and subsequent measurement within the individual (repeated measures). I want to compare t...
I am not used to working with machine learning models, and are currently sitting with an issue i hope you can help me with. I am sitting with a multi classification problem, where i try to predict whether the bitcoin will either ’increase’, ’decrease’ or ’neutral’ (neutral is a change in price within -0.5 % to 0.5%). T...
I have weekly sales data for a restaurant, with 113 observations, and every year in January, sales drop significantly and then recover after two or four weeks. I applied a SARIMA model with auto-arima in R, but when I evaluate my model, I realize that the residuals are not constant and not normally distributed. Box-Cox...
I'm trying to figure out the best way to analyze a dataset on 48 youth who were part of am 8-week summer program. These youth were given time-outs and then their behaviors were recorded during time-out as counts. # of time-outs differs across children (some have 1 time-out, others have 25 time-outs). Dataframe is in LO...
Link to data Background story: I'm trying to find out how being a grandparent affects working hours. The endogenous variable is grandparent (1 if the individual is a grandparent and 0 if not), and its instrument is child1_female (1 if the individual's first child is female). The outcome is log(work_hour), weekly workin...
I have synthetic data which is sampled from a non-central chi distribution (similar to what is obtained experimentally). I am fitting a non-linear model to this data to extract three parameters of interest. I have tried both least squares and maximum likelihood, and based on my simulations I have been getting slightly ...
doing a research project and have been trying to use combination of google/chatgpt but am still not sure. the first research question is testing whether or not kids have increased in empathy following an intervention. it would be one group (i.e. all participants), repeated measures, categorical data (before the interv...
I am working with a colleague's data from a research project comparing two groups of learners on a test of language ability. Data are repeated measures, between-subjects. Participants in each group (M or C) took the same test at time A and later at time B. Possible scores on tests could be 0-5, but in reality ranged fr...
I am trying to construct a natural cubic spline interpolation using R and test it with a Runge test function. I have implemented the following code; however, the interpolation is not passing through the original y-values of the knots. Based on my understanding of cubic spline, the first condition is that Sj(xj) = f(xj)...
This question is motivated by the need to do vector-valued discrete time series forecasting with some guarantees of "continuity" (or rather, a discretized analog of continuity expressed in terms of uniform bounds on the magnitude of coordinate-wise first derivatives). In what follows, let $h,f,k$ be integers, where $h\...
I'm currently using R to run a linear regression with 3 predictors. I am analysing the outcome likelihood of electoral success by descriptive identity of election candidates in Germany. My aim is to find the interaction between female, electoral tier and political party as well as between female and electoral tier. I s...
Let's say a professor gives different versions of an exam to her two sections. Despite attempts to make the exams equal in difficulty, the minimum score, median, and mean are all significantly higher for section 1, while the standard deviation is lower. Is there a way to normalize the scores for section 2 to approximat...
I have the following data, which produced the following plot. Predictor_Variable <- c(rnorm(1000, 0, 25), rnorm(1000, 20, 2), rnorm(100, 20, 10)) Response_Variable <- c(rnorm(1000, 0, 2), rnorm(1000, 0, 25), rnorm(100, 0, 10)) Data_Frame <- data.frame(Predictor_Variable = Predictor_Variable, Response_Variable = Respons...
I'm performing a DoD (difference of differences) hypothesis test, using a Bayesian model. I analyzed the data post-experiment and found that the mean posterior lift in metric attributable to treatment exposure was 1.53% and the proportion of the posterior > 0 was 94% (94% chance the treatment had a real effect on metri...
I apologize my knowledge in the field of statistics is limited as I am a newcomer to this area. I am trying to expand my understanding to concepts beyond simple linear regression and simple mixed effects models. I have a situation that requires the application of tobit or tobin models to a dataset that has different le...
I am trying to understand how xgboost prediction evolves by adding more trees (of course the ROC AUC will increase). But to my surprise, when there are small number of trees in the model, the average prediction for the entire training sample is always around 0.5, although my training data average of target variable is ...
I am doing gwas analyses using twins data. after quality control in plink, over 6 millions variants and 2400 individuals are left for conducting association analyses. i didvided the variants into 22 subsets based on chromosomes and run parallel analyses for each variant in each subset in R/4.2.0. i used lme4 package, C...
I have some confusion regarding Bayes rule for joint posterior (I think primarily due to the context in which notations are used) Let $P(\theta_{1}, \theta_{2} | X)$ be a joint posterior over the parameter space $\theta_{1}, \theta_{2}$. Then, the application of Bayes rule should yield: $P(\theta_{1}, \theta_{2} | X) =...
I am trying to understand if it's possible to estimate conditional effect in a GLM using an approach similar to how we would in a linear model. Specifically in a linear model, I can use a residual method to estimate the conditional effect ($\beta^\ast$) and standard error of variable $g$ in this linear model $E(y) = X ...
So I have a dataset of behavior of a certain animal (n = 36 individuals) and the observations were taken for 4 months. The data has lots of zeroes in it and is right skewed and I wanted to measure the effects of a certain set of variables on the response variable (the behavior). But I am unable to point out which mode...
I have matched paired nominal data, transmissions and non-transmissions of a risk allele M1 from parents with genotypes M1M2, M1M1, M2M2 to affected children. We can build a 2x2 contingency table and apply the McNemar test to test whether the risk allele M1 and the non-risk allele M2 are equally transmitted to affected...
I have two relatively simple questions on a two-Part Mixed Effects Model for Semi-Continuous Data I am running using GLMMadaptive . First of all, I would like to check if I am selecting the appropriate analysis. The design is repeated measure design in which I test the effect of treatment (2 levels; Between subject) o...
I have two dataframes with the same columns but with varying sample sizes. I want to compare corresponding columns for homogeneity (i.e., do they come from the same distribution?). There are different types of columns (variables) - I have categorical (nominal and ordinal) and numeric (discrete and continuous). I want t...
Problem Hey, i need some help for power calculation for a three condition counterbalanced linear mixed model with an additional within-subject factor. This is an fictious example, which doesn't make a lot of the sense, but the design we want to use is equal. We assume that stimuli are nested within participants, since ...
I have a group of individuals for which I would like to report a mean and a weighted error. The data that I observe on a daily basis are two independent $iid$ random variables with unknown distributions that can be quantified as 'number of individuals per day' which i call $W$ and some measure of 'revenue' called $R$ t...
I am using Hamiltonian Monte Carlo (HMC) to sample the posterior of a continuous-time Markov Chain (CTMC). However, after running 10 parallel chains with 100 draws each, the effective sample size (ESS) rises in a certain pattern, way beyond the actual sample size (which should be 10 * 100 = 1000 samples). Has anyone s...
Let's say that some quantity is modelled by a time-dependent Poisson distribution, $$ y(t) \sim \text{Pois}(\mu(t)) $$ where $$ \mu(t) = \alpha_0 \exp(-\alpha_1 e^{-\alpha_2 t}) $$ and $\alpha_k > 0$ for $k = 0, 1, 2$ For a given parameter $\theta_k = log(\alpha_k)$, I computed the log-likelihood and obtained the follo...
Let say I've a dataframe as : image_id image_group group x y nn I've 20 images defined by image_id ; each image belongs to a group G1 or G2 defined in the image_group column. Eeach image is a list of points from different groups (e.g. A, B and C) defined by their coordinates x and y. nn represents the number of neighb...
I am looking into assessing the effect of a condition. I have a population of several individuals that are not affected by this condition and a smaller proportion that is. Observations of a single variable are made at several points in time. I would like to assess how early (in time) I can find a significant difference...
I have a dataset of photos of dogs with both black and white fur. One person assessed the images by two criteria: Criteria 1: how much white fur does the dog have: More than 0% and less than 25% More than 25% but less than 50% More than 50% Criteria 2: how is the distribution of the white fur: The white fur forms sm...
This is really basic, but I'm having trouble interpreting the summary output of a multiple regression, including one or more interactions with a categorical variable and I couldn't find satisfactory explanations elsewhere. Consider an example based on the mpg data set: easypackages::libraries("tidyverse", "nlme", "car"...
I am estimating the effect of certain bank characteristics on the bank lending in monetary policy in the euro area. Therefore I am looking at different bank characteristics (size, liquidity and capitalization), the evolution of net loans and some control variables like GDP and inflation for the euro zone. This is my re...
I have some percentages calculated as follows: 8/51 = 15.69 12/91 =7.19 12/167 = 13.19 Is there a way to calculate a mean percentage taking into account that the denominator differs? Thank you in advance
I do understand the IMHO simple concept using weights to fit a sample to another (real) population. Calculating the weight factors is not hard. Regarding to my MWE there maybe is a more elegant R way but it works in my case. But what I don't get is to how to apply the calculated weight factors to my real data. In the e...
I am having difficulties in understanding the difference between interaction terms and test for interaction. I am using logistic regression models so maybe the concept is different compared to linear regression? As far as I understood from this explanation, interaction terms let you know how the relationship between tw...
I want to apply a filter to my data that assume its normality. The data comes from different sensors measuring the same quantity over the same period of time. Using a simple histogram plot, It seems that the data of most of the sensors follows a lognormal distribution, so my idea was to apply the following process: fi...
I'm fairly new on univariate time series forecasting and deep learning. My task is to forecast energy consumption values. May data looks like: I'm usin simple RNN, because I have tested with linear regression, xgboost, lstm and rnn, but rnn looks the best. I'm using Min-Max scaler to scale my data. and after predictio...
I am conducting regression analysis and my dependent variable is derived from dividing the number of candidates standing in an election by the number of vacancies. This gives me a discrete dependent numeric variable, which is throwing up issues in the diagnosis of my linear regression model. Are there alternative types...
From what I already know about the Johansen test, it tests the rank of the VAR matrix (in error correction form) through steps testing whether every eigenvalue is signifincantly different from 0 (first the highest eigenvalue, then the second highest one and so forth), so the number of eigenvalues statistically differen...