instruction
stringlengths
9
38.7k
Let's say X can take on 5 values X<-1:5 each of the 5 values occur with some probability: p<-c(0.2,0.3,0.1,0.3,0.1), where sum(p)=1 I would like to get the probability that number 5 occurs at least 2 times out of 3 trials. For the binomial case I would use: sum(dbinom(2:3,3,0.1)) What is the equivalent of this in the...
I have data structured hierarchically in this way, where single observations ("Member") are grouped in larger groups: Major_group Member Sample1 Sample2 Sample3 GroupA Member1 5 0 2 GroupA Member2 3 4 10 GroupA Member3 2 0 ...
I'm working at an online agency, where we run a lot of AB testing in order to test differences in proportion between two groups (test vs. control). Standard practice in the industry for testing difference of proportions is either based on the normal distribution or chi-squared. Chi base $\lambda$ tests tend to use a lo...
I am not a statistician, but I have a personal project and I need a help. I will simplify the project a lot to make it more clear and easier to understand. Then in base of your answers, I can fit it to my real project. Let's say that I have a pot with many balls inside with a number on the balls. For a week, every half...
I am an ml noob. I have a task at hand of predicting click probability given user information like city, state, os version, os family, device, browser family browser version, city, etc. I have been recommended to try logit since logit seems to be what MS and Google are using too. I have some questions regarding logisti...
My response variable is number of Fishing cat scats and I am using a zero-inflated poisson regression model to see the effect of the predictor variables on habitat use of Fishing cats. The predictor variables are Reed area, Vegetation Area and Agricultural area. Now, before using the GLM, I used scatterplots to see wh...
Does anyone know the formula to convert a z-score to a percentile rank instead of using the z-score table? I searched the website, but did not find the formula. thank you
I have a dataset depicting weekly revenue over time for a computer company. The plot for the data looks like this: I decomposed the data into its additive components using the decompose function in R and plotted the various components: Next I tried removing the seasonal component using the following code: > RevenueDe...
The Problem There's a bag with six distinct tokens in it (e.g. a six-sided die). Each token has an unknown value of some real number. A "trial" consists of drawing five tokens (five die rolls) and being told the sum (to clarify, you do know the identifier for each token, just not its value). What's the expected number ...
Can we instead of doing logistic or multinomial regression do two or multiple Poisson regressions and then combine Poisson predictions to get probabilistic predictions? If yes, how should we transform data for training?
I'm looking for a method to identify a shortlist of potentially good 2-way interaction terms rather than trying all possible interactions. This question is similarly asked before here but in a more general sense, not on a big data set. The answer that is given there ("think" about the problem) is not applicable for me ...
This is dataset that is going to be data mined for factors that affect an output that of interest A large Part of my dataset (150 of 300 potential inputs) has a heavy skew of Zero values. usually this is >90% and always >70% zeros (true zeros) This has risen as the input variables are usually OR options. -Say i have 10...
I'm rather new to statistics, so please bear with me. I would like to be able to say "to within 95% confidence, this data is exponentially-distributed." In this case, I know how the data should be distributed and I want to be able to say it is to some confidence. In other words: (Usually) $H_0$ = The data are exponent...
Let's assume we get 1 point for predicting the result (win/lose/draw) and 3 points for predicting correct score for both teams (e.g. 3:2). We've got two separate accounts where we can bet, my question is: (1) does betting twice each match (once per account, each bet with different score) allows you to get more points...
I am using linear-mixed effect models to analyse my data (the interaction between on and arc; both arc and on are continuous variables). I also used the effects library to plot the interaction of on*arc. However, I could not understand the figure: Could you please help in understanding what the 5 panels in the figure...
I am validating a logistic regression model. This is the first time i am validating a model. I am using split sampling method. I have split data randomly into two parts - 70% development and 30% validation data sets (70:30). Then i run logistic regression on development data set using SAS and rank their probabilities i...
I have a large number of factors that categorize my numerical observations in different ways and no preconception which if any of these factors may be significantly explanatory, but I have a p-value threshold that I'm obliged to observe. I want to perform an analysis of variance for each factor and then select those fa...
Given the outcome variable in a dataframe is a factored/categorical variable, when regressing the dependent variable (DV) onto a set of independent variables (IVs), what is the model predicting? The probability that the DV is the first level of the factor? Or the second? A related question: I know that given a numerica...
I have some questions about binary logistic regression. For my research, I am planning to use 12 predictors, and my sample consists of 129 cases. However, I know of a 1 to 10 rule. Additionally, my DV is divided into 2 groups (it is a binary variable). It has an unbalanced distribution, and one group has less than 30...
For two perfectly correlated Gaussian variables, the mutual information between them, and thus the KL divergence between the product of the marginal distributions and the joint distribution, is infinity. I have read that KL divergence is always finite if Q is continuous in respect to P, but I am having a hard time unde...
Suppose two time series (of light flux). The goal is to determine whether the series are from the same distribution. It is usual to use the Kolmogorov-Smirnov (KS) test in this situation. However, the times intervals are not necessarily even between the measurements, as some data may be missing. Is it correct to deduce...
I am using MATLAB 2012a to run 3 tests. With my data, I obtain very small values, and for the Anderson–Darling (A–D) tests, the results are not even normalized. Please verify my code. I am also using the A–D script which is found at this link. sample= N; h1=histfit(sample,30,'weibull'); xdata1 = get(h1(2), 'XData'); y...
I have some trouble with the last test I need to perform for my bachelor thesis. I have two variables and I need to test whether there is a significant difference. The first variable has all the returns of stocks on specific days. The second variable has these returns as well, however some days have been deleted. I wan...
I am trying to run a model to estimate how well catastrophic illnesses such as TB, AIDS etc affect spending on hospitalization. I have "per hospitalization cost" as the dependent variable and various individual markers as independent variables, almost all of which are dummy such as gender, head of household status, pov...
I dip into project time estimation and can't find intuition. What is the cumulative probability distribution of an event when two independent tasks both complete successfully (when performed in parallel)? We have two cumulative probability distribution functions on 2 independent random variables that represent duration...
I am using modprobe syntax on SPSS to test an interaction between narcissism and rumination on a dependent variable, aggression. I get a significant effect of rumination (b = .6450, t = 2.32, p = .0216) and significant effect of narcissism (b = .5646, t = 2.5, p = .0135). The interaction is not significant (b = -.069, ...
This is a more general treatment of the issue posed by this question. After deriving the asymptotic distribution of the sample variance, we can apply the Delta method to arrive at the corresponding distribution for the standard deviation. Let a sample of size $n$ of i.i.d. non-normal random variables $\{X_i\},\;\; i...
X is a real-valued random variable with characteristic function: $\hspace{20mm}$$\phi(t) = \frac{1}{2}[\cos(t) + \cos(t\pi)]$, $\hspace{10mm}-\infty<t<\infty$. Is the distribution of X completely continuous? Is there an $r$ such that $E(X^r)$ does not exist or is infinite? The distribution is not absolutely continuou...
I am interested in estimating an adjusted risk ratio, analogous to how one estimates an adjusted odds ratio using logistic regression. Some literature (e.g., this) indicates that using Poisson regression with Huber-White standard errors is a model-based way to do this I have not found literature on how adjusting for co...
My name is Abhi and I am fairly new to statistics. I found some sample exercises online & I am trying to solve them to get a better understanding of model development. Problem Statement Assume a forum like stack exchange or cross validated. Using parameters like number of comments, number of upvotes, reputation points ...
I have 2 data sets, one is binned and another is not, 9000 values each. Something like this: a = [23 45 88 9 0 29 30 60 0 2 10 100 0 60 90] b = [0 0 0 1 1 0 0 0 0 0 0 1 0 0 1] Actually, the b is the set of events (yes/no) which occurs during a continuous change of the intensity of a "signal" (the signal has values [0–1...
I read some posts about this on this forum, but didn't seem to find an easy to understand explanation. so trying to post it here, please help to explain a bit more as i am not an expert on this but would really like to learn. my question is almost just like the subject, say if I have some week over week stats like volu...
I am comparing linear regression with and without intercept for the general sampling case. For this, I have $n$ samples of two correlated random variables $X \sim N\left(0,\sigma_X^2\right)$ and $Y \sim N\left(0, \sigma_Y^2\right)$ with correlation $\rho$. For the random samples, I calculate the linear regression model...
I haven't done much time-series modelling at all and now I have a dataset which screams "time series" at me and now I am hunting for a model. The data: Imagine a video watched by ~400 people, 100 seconds long. Each person had a slider from 0 (bad) to 10 (good) to indicate if they liked a particular scene. The value of ...
I have the weekly revenue data for an electronics company the decomposed plot of which is as follows: I have decided to keep the seasonality and apply a suitable forecasting technique. I tried auto.arima: > Elec <- read.xlsx("C:/Users/Himanshu.raunak/Revenue/Electronics.xlsx", 1) > Elec$Date <- as.Date(Elec$Date, fo...
I have several datasets containing hundreds of variables, measured at the same time point and with the same method. Some of these variables have been measured more often and assume consistent values. Some were measured less often and have highly disperse values. Example: v1 2 1.8 1.5 1.9 2.1 1.78 1.95 2.0 2.1 v2 2 10...
For quite a while I believed that the proper interpretation of a Beta distribution with $\alpha$ and $\beta$ is: "what is the most likely $P$ given $\alpha -1 $ success (heads), and $\beta -1 $ of failures (tails)", which also made sense when $\alpha -1 $ and $\beta$ are equal to 1, which means that you don't have a...
A similar question to my other question about mixed distributions. Here i have quite a few variables that are populated to less than 5%, many are even populated to less than 1% this 1% would represent 10 of 1000 entries If i was designing a survey for example these groups are too 'fine' in their detail These again are ...
I am trying to build a discrete time event model. The event occurs once in 20 years period of time. Most of the example i saw use only covariates which are same over period of time. e.g. sex,race etc. But i have observed values of covariates for different time periods.And there are around 10-15 covariates which are obs...
Does it have importance in conventional PCA/factor analysis which of the criteria: communality and loading problems is taken into consideration for deleting variables in the conventional PCA/factor analysis? (should I first delete the variables that have a low communality or the variables that have cross-loadings?)
I have inherited some legacy code designed to solve the following problem - we are given a set of observable binary variables $Y_1, \dots , Y_N$ that we believe are related to a fixed set of input variables $X_1 ,\dots , X_M$ (N.B. high dimension, $M \sim 100$). For a given input we want to predict which event $Y_i$ i...
what is a good adjusted R square value for any multiple regression model or it depends? If it depends then what are the conditions?
The problem which I have at hand consists of a logistic regression model for risk evaluation that has been made on some credit card data of Quarter-1'12 (Jan'12 - Mar'12). Now I use the same model to evaluate risk for the data of Quarter-2'12(Apr'12-Jun'12). I want to devise an accuracy score that gives an insight into...
It might be a basic question but since fixed effects estimator either mean centers the data or uses first differences, is it entirely wrong to take first differences of the data and then run fixed effects regression in Stata? Here is the explanation of the problem. So my model is the following $\Delta LP = \alpha+\beta...
I'm trying to run K-fold cross-validation on a multiple regression model that was generated via the step function in R. However, the call to cv.glm returns NaN. Here is a simplified script that replicates the problem: # this works just fine library(boot) data(mammals, package="MASS") mammals.glm <- glm(log(brain) ~ log...
I have to perform a meta-regression, using mixed or random effects model, but I don't have any software (except Matlab) and I'm new on this topic (having a relativelly poor statistics background). Briefly the problem I'm addressing is as follows. I've collected several effect sized from different studies. In my case, t...
Consider the situation where n items are to be partitioned into $k < n$ distinct subsets. The multinomial coefficients. provide the number of distinct partitions where $n_1$ items are in group $1$, $n_2$ are in group $2$, . . . , $n_k$ are in group $k$. Prove that the total number of distinct partitions equals $k^n$ ...
Is it possible to use xttest0 in Stata with unbalanced panel data? I want to test whether the I should use pooled OLS or random effects estimation. What does this test actually do?
I would like to know if it is possible to create a scatterplot while controlling for covariates, such as in partial correlation. I am using R software and my code is below for the basic scatterplot. I am not interested in multiple lines of best fit or multiple scatters per graph. I am also not interested in creating a ...
I'm trying to do a linear regression in R, however I have the added constraint the coefficients from the linear regression need to sum to a user given value between 0 and 1. (I understand forcing the coefficients like this will make the fit rather poor, but it's a needed constraint) I've been though the documentation f...
I'm wondering what would be the best method to analyze a "cross-over" interaction between a factor and a continuous variable. Here's my experimental set-up and hypotheses in a nutshell: 58 participants were randomly assigned to one of two conditions (each n=29) with different manipulations. It was hypothesized that a ...
Is there a way to train a RandomForest, GBM or other classification model using a LogLoss error measure? So far I have trained it, but I get an OOB error rate. From there I calculate the sigmoid and use that as my probability in order to minimize the LogLoss... but I have a hard time to find literature or examples on h...
I've been working on putting together a survival analysis using Kaplan-Meier and the logrank test. I am doing the testing in R with survdiff(). Each plot has multiple groups/curves, and I've been testing for the difference between groups (where there are more than two) by doing individual pairwise tests, as has been su...
My data consists of one column of real temperature, and one column of calculated temperatures. I want a single number which quantifies the 'bias' in the real temperatures. Basically, if most of my data points lie below the ref line, then I should expect a negative bias, and if they lie above the line then I will expec...
My question is a really simple one but those are the ones that really get me :) I don't really know how to evaluate if a specific time series is to be decomposed using an additive or a multiplicative decomposition method. I know there are visual cues as to telling them apart from one another but i don't get them. Take...
I am looking for help in defining my problem. Essentially, I have two data processes (both continuous macroeconomic variables: $x$ and $y$). There is evidence of bidirectional causality between $x$ and $y$, proven by a Granger Causality test. What I am alleging now is that $x$ and $y$ are not causing each other, but th...
Is it recommented to delete the cases from a database if the responses are highly incomplete? Is there a percentage that can be taken into consideration? (for example, deleting a case if more than 50% of the items have not been answered).
Can we use ordinal/multilevel predictors directly into binary logistic regression model? I guess not. we usually here convert them to multiple predictors to have values 1/0 for each category. Also if we have a variable with say 20 levels(e.g. sectors like 'energy' 'IT' 'telecom') or factors, should we created 20 varia...
I have some data points and I fitted a function (2nd order polynomial here) to the data. The algorithm (scipy.optimize.curve_fit) gave me the optimal parameters and the covariance matrix of those parameters. In the documentation, it says that the square roots of the diagonal entries give the errors for the parameters. ...
I read that in a regression with $k$ regressors, the t-statistic corresponding to a certain coefficient follows a $t(n-k)$ distribution. However, later on I read that studentized residuals follow a $t(n-k-1)$ distribution. How could it be that the extra degree of freedom is lost: isn't this also just based on a regular...
This is for a simple psychology report. I was wondering if I could hypothesise an insignificant mediation. Eg: "...based on this research it is predicted that group identity is not a significant mediator (or does not sognificantly control) narcissism's relationship with aggression." Then I would run a mediation analysi...
I have run logistic regression on data. The concordant percentage is coming out 45. That is too low. However, Hosmer–Lemeshow test is coming out insignificant. It means we cannot reject the null hypothesis stating model fits the data well. That's good! The ctable also shows 70% of the data correctly predicted. How con...
Suppose we have a data set with a binary outcome variable $y$. The predictor variables are $x,w$ and $z$. This is the training data set. We obtain a logistic regression model from this training data set. Now suppose we have a test data set and want to predict $y$. In R, we use the predict function to do this. But we ...
I was reading this paper http://comjnl.oxfordjournals.org/content/20/4/359.full.pdf and in the last paragraph of the first page, Rule 1 is given as $\alpha_{j+1} > \bar{\alpha} + k s_{\alpha}$. Here, $\bar{\alpha}$ and $s_{\alpha}$ refer to the mean and standard deviation of a distribution $\alpha$ while $\alpha_{j+1}$...
I am building a random forest model to make predictions. Response variable is treated as continuous but not really continuous, e.g., integers from 0 to 10. I have problems in constructing prediction interval for new observation. Here are my questions: If prediction error is not normally distributed, can I use mean+...
I am currently reading up on assumptions for Pearson correlations. An important assumption for the ensuing t-test seems to be that both variables come from normal distributions; if they don't, then the use of alternative measures such as the Spearman rho is advocated. The Spearman correlation is computed like the Pears...
I am using spec.pgram(tsobj,spans=6, plot=TRUE) to obtain a periodogram for my univariate time series of monthly observations which were sampled over 86 years (so I have 1032 observations in total). It's defined as an object of class "ts" with frequency=12. The periodogram nicely depicts the seasonality for 1 year...
I am fitting a model in the frequency domain, and my fit looks as follows: As you can see, the model function does not fit the data perfectly, especially in the higher frequencies. So, I examined the residuals and found that a polynomial of the first degree is the missing term in the model function. What concerns me m...
Is there a way to estimate an ARMA equation using the lm() function in R without using arima()?
Should the process of feature normalization/standardization be done before or after the feature selection process?
I have a survey question where the respondent can check one choice or two choice maximum. Question looks like this: What is the more important characteristic when you buy chocolate? Sweetness (characteristic 1) Packaging (characteristic 2) Price (characteristic 3) ... (characteristic 4) ... (characteristic 5) ....
I have installed rjson in R. When I try to call a function from this package, like toJSON, it gives an error like "undefined function". But if I use require("rJSON") before to call the function it works well. Do I always need to "require" a package before using any function from it?
If we have one continuous r.v. $x$ and a discrete r.v. $y$ which takes one of the two values $y_1$ and $y_2$. Let's say we know the prior probabilities $P(y_1)$ and $P(y_2)$. From Bayes theorem we know $p(y_i,x) = P(y_i|x)\cdot p(x)$ $P$ corresponds to prob. mass function, $p$ corresponds to prob. density function. On...
When we use top down approach to induce a decision tree, we need to use some kind of splitting criteria to choose the splitting feature and splitting value at a certain internal node. The criteria could be: IG IGR Gini impurity But the feature selection seems very computationally intensive. Because we need to enumera...
I've worked with observations as vectors with both continuous and categorical variables. In both cases one can use dimensionality reduction techniques such as PCA (in the latter case through Correspondence Analysis). This has been very useful for me to draw the observations in the plane (by taking the 2 first component...
English is not my first language. Here are my questions. I am using proportions ((0.1, 0.25, 0.25, 0.4) to generate 4 classes of data (1 variable 4 levels) in SAS based on the code below, data NativeBMI (drop = i) ; array prob [4] (0.1,0.25,0.25,0.4); call streaminit(1234); do i ...
I'm having trouble understanding the ROC curve. Is there any advantage / improvement in area under the ROC curve if I build different models from each unique subset of the training set and use it to produce a probability? For example, if $y$ has values of $\{a, a, a, a, b, b, b, b\}$, and I build model $A$ by using $a$...
I was wondering if any of you could help me understand the response I got from this clustering algorithm (Metis). As you probably can see, I'm trying to cluster IP addresses based on common records accessed. The graph file contains one node per IP, and weighted edges, where the weight is equal to the number of common a...
My supervisor asked me to benchmark my method in classifying speech signal with other language. I am doing Malay language speech recognition. To benchmark my method/feature used, I need to test English speech. I am wondering, while doing testing (on the English data), should I use English data as training and testing ...
I have a multilevel problem where I want to have a random intercept and a random slope. However the random slope is the interaction of two predictors. In this case, do I also have to allow random slopes for the individual predictors? For example, with lme4 is this OK? lmer(y ~ x + w + x:w + (1 + x:w|group), data=mydata...
I need to identify relationships between multiple 'counting' independent variables (representing numbers of amino acids in a protein sequence) and one ordered categorical dependent variable (an experimental outcome) which assumes values between 1 and 7. The distribution of the dependent variable looks the following: I...
I have an empirical distribution $G(x)$. I calculate it as follows x <- seq(0, 1000, 0.1) g <- ecdf(var1) G <- g(x) I denote $h(x) = dG/dx$, i.e., $h$ is the pdf while $G$ is the cdf. I now want to solve an equation for the upper limit of integration (say, $a$), such that the expected value of $x$ is some...
Is there any nonparametric version of ANOVA able to deal with multiple factors AND evaluate their interaction(s)? If the interactions are really impossible to evaluate, is there any generalization of the Friedman test to more than two factors?
I am learning multiple regression with categorical variables and in a book I came across this problem. For yield of corn suppose there are two factors affecting, nitrogen level and depth of ploughing. Say there are three nitrogen categories(1,2,3) and two depth categories(1,2). There's a interaction term of nitroge...
I am trying to use Information Gain to select features when classifying text with a Support Vector Machine. For each word in our training data, we computed its information gain. Then, we should keep only the words with an IG superior to some threshold. When reading the litterature about this I did not find a clear exp...
I am running a multinomial logistic regression with SPSS and I have encountered a problem (?) with my data. I have a dependent variable (DV) with three categories, five independent variables (IV) as factors and four IVs as covariates. There are close to 4800 respondents in the data. The distribution of my DV is: First...
I just touched Gaussian processes two weeks ago. I am not very familiar with the selection of a model and its hyperparameters. Here is the demo code that I run for a 2-D Gaussian processes regression. Its output is not what I expected. % produce the training set for regression. % Here, the regression target Y is the su...
I have two (non-independent) OLS-parameter estimates each with its own standard error. I'm trying to find out what the standard error of the difference of the estimates should be. Can anyone help? Is this too general?
How do I define generators in Minitab 16? I have an experiment design (DOE) with 5 factors and 2 generators. I entered D=ABC E=AC in the box of generators but it says only F through G ?
Many machine learning techniques suffer from the curse of local minima, one of them is K-means. I am using a matlab script for a computer vision task. One of the first steps I do is kmeans clustering on an image in the Lab color representation, I only consider the ab components. So I consider my pixels to be a set of a...
I have a set of observations from a biological experiment. I have counted the occurrences of a particular event on each of the chromosome for $n$ cells and finally I have the final mean value for each chromosome. 2.2, 6.4, 3.4, 10.2, 4.45 So I have 5 chromosomes making on an average of above mentioned number of even...
I want to predict the success of a tweet. In my case a tweet is successful when the sum of the number of favorites and the number of retweets is greater than 5. So my outcome value y is: y= if((retweets + favorites) >5 ==1 else == 0 Therefore I created the following dataset: (This sample just shows the data for one ...
Short summary Suppose two latent variables of a hierarchical model are correlated. Let $1-\epsilon$ be the degree of correlation. As $\epsilon\rightarrow 0$ the variables become perfectly correlated and Gibbs sampling appears to only be possible if the two variables are considered as one variable (i.e. using block-Gibb...
Is it possible to estimate parameters for a truncated Generalized Pareto Distribution (Wikipedia Article) by probability weighted moments? If not, why is that so? I am aware that it would be possible numerically by MLE or similar methods, but I am specifically interested in whether a PWM approach is feasible.
I was working on a research project in which I try to estimate the the individual contribution of a group of regional political leaders to local economic growth. The major challenge is that there is relatively few locality-year observations to the number of regional leaders. Overall I have about 300 political leaders a...
I have a list of personality scores obtained from 100 people, based on the Big-Five personality test. Each person has one score for each of the five assessed traits. I put these scores into a 5 dimensional feature vector, so each person's personality is now represented by this 5 element vector. I would like to find out...
I have a dataset with 260 patients. I aim to study factors associated the certain finding in magnetic resonance imaging. I use logistic regression with six predictors. Regression yields to several significant predictors. I have philosophical concerns however. Nagelkerke´s R is only 20%. My model is however significant ...
Apologies in advance if this is very basic; I am quite new to statistics. I have a large set of 7 dimensional data, for two groups. In my example, they are express relative preferences over a certain bundle of goods (for men, and for women). (Weightings of the parameters in a representative utility function, so for exa...
I'm dealing with a large p small n problem (p>1000, n=150) and have decided to use glmnet and lars to select possible explanatory variables (as I understand is their functionality) rather than do this manually. I have gotten out both a lars, and a glmnet object from the functions, but now can't discern how to extract f...
I have been examining the use of the Point Biserial correlation as a statistic to measure the relationship between a dichotomous variable and a continuous one. Wikipedia et. al. seem to concur that the Point Biserial Correlation is a special case of the Pearson Correlation, but I cannot find a proof for this, algebraic...