instruction
stringlengths
9
38.7k
I wonder what differences are between t-test and ANOVA in linear regression? Is a t-test to test whether any one of the slopes and intercept has mean zero, while ANOVA to test whether all slopes have mean zero? Is this the only difference between them? In simple linear regression i.e. where there is only one predictor...
If a probability distribution has, say, 112 bins with around 29000 samples, with the maximum probability of a bin being less than 0.05, is the Jarque-Bera test an effective measure of conformance to a Normal distribution? I'm working with univariate data, whose probability distribution 'looks' normal, with some deviati...
Imagine the following simplified longitudinal data with 4 individuals and 3 variables (y1, y2, y3) measured at 50 occasions : dat<-data.frame(subject=as.factor(rep(1:4, each=50)),time=rep(1:50,4),y1=rnorm(200,50,20),y2=rnorm(200,70,20),y3=rnorm(200,20,20)) It is easy to plot at the same time the raw time series with ...
I posted this earlier in the week then retracted the question when I found a good source, not wanting to waste people's time. I haven't made much progress I'm afraid. In trying to be a good citizen here I will make the problem as clear as possible. I suspect there will be few takers. I have a dataframe in R I wish to a...
Is there a specific method to detect change points(structural breaks) in a timeseries? (stocks prices).
I am interested in applying a test of independence such as chi-square or log-likelihood in the case where the observations are not independent (observations are sequential in time and there is a temporal correlation). I have read about computing the 'effective sample size' for use in variance estimates of dependent da...
In a psycholinguistic task, participants listened to and viewed stimuli, and were asked to make acceptability judgements on them: 4 conditions 4 groups Rating scale from 1-5 I have been advised to use z scores and log transformation (for R) on the ratings scores: Questions: Should the ratings be computed into Z s...
As it is said, a picture is worth 1000 words. I have some data, and I need to put them in the right chart representation. The working scenario is this: some users have to predict how much internet bandwidth they will consume during 13 weeks. The users can form groups in order to buy more cheaper internet bandwidth. If...
I've been trying to remember my High School teachings and are falling short. I'm working on a project where I need to give a % of correctness for an integer (How close a given number is to the actual number within a 300% difference). For example if the number we want is 50, any number from -100 to 150 will return > 0%...
I have to reduce the number of variables to conduct a cluster analysis. My variables are strongly correlated, so I thought to do a Factor Analysis PCA (principal component analysis). However, if I use the resulting scores, my clusters are not quite correct (compared to previous classifications in literature). Question...
Can I suppress the intercept if I know the treatment will be zero if the independent variables are zero. Also, can I suppress the intercept if I know the right hand side of the primary regression equation CANNOT equal zero. Example: treatreg y1 x1 x2 x3, treat(y*=x4 x5, noconstant) noconstant Can I do this if I know ...
I have data for two groups, and I am investigating if the two groups perform differently on a task. I have 95% CIs calculated by bootstrapping that give lower and upper bounds to mean point estimates for each group. I have done a t-test comparing the means and it suggests that the difference between the means is signi...
What is the difference between sample variance and sampling variance? They seem same. Aren't they?
I have a study with 130 participants where most of my analyses involve examining the relative size of correlations between various psychological variables. I'm trying to comply with recommendations that request authors to say something about the statistical power of their study. Statistical power focuses on whether the...
First of all: I'm mathematically challenged. Question 1: I use the Pearson correlation coefficient to correlate people. As a real life example: I correlate those people by comparing the number of points they've given to movies. This works very well. Now I would like to correlate not 1 variable but multiple, e.g. correl...
Why is the design effect in most sample studies taken as 1.25? Who and how was it calculated first of all?
I am new to R and am hoping to use ets from the forecast package to forecast daily data which has a weekly pattern. Is there any way of setting the length of seasonality to 7?
I wrote this R function in order to test between matrix (mat1, mat2) correlation by re-sampling the second matrix numR times to obtain correlation coefficient distribution against which to test the observed value. But irrespective of the observed value I always get the distribution with SD 0.3 max. I don`t see how if t...
I am analysing CPU useage on a large network. In order to do that, I was provided with a large excel sheet. It contains batchID (means we dedicate a CPU to run that task) startTime, endTime (means we know the CPU is fully occupied during this time). Based on this data, I need to understand how many batches are running ...
I was wondering how to compare accuracy of my classifier to a random one. I'm going to elaborate further. Let's say we have a binary classification problem. We have $n^+$ positive examples and $n^-$ negative examples in the test set. I say that and record is positive with a probability of $p$. I can estimate that, on a...
It is claimed that probability of continuous R.V. is 0 for ALL x in R. That is, for every point the probability is zero. But, somehow when we sum all these zero probabilities over the entire domain $\mathbb{R}$, the total becomes equal to 1. Can somebody explain how 0s can add up to 1? This defies kindergarden math....
I was wondering what could be the reasons for a very low Spearman correlation, as low as 0.01-0.06. Basically no correlation even exists! All my other variables have moderate correlations except any correlations with this one particular variable.
I performed a CFA to reduce my items into factors. However, due to the violations of non-normality, the results were really weird, and transformations didn't help. There were some standardozed regression coefficients that were negative and ones that were over 1 despite the factors itself having good Cronbach alphas. W...
So, I want to fit a random effects negative-binomial model. For such a model STATA can produce exponentiated coefficients. According to the help file such coefficients can be interpreted as incidence-rate ratios. Unfortunately I am not a native English speaker and I do not really understand what incidence-rate ratios a...
I am still struggling with the transition from STATISTICA/SPSS to R. To get a feel for R, I used the ChickWeight data from the R package. There is one between-chick/subjects factor, Diet, and one within-chick/subjects factor. Time, which I used to analyze weight. Using the R manual, I used the aov() function: Chicken...
We ran a 3-way ANOVA getting a non-significant result, but in doing so we saw that one condition looked like it had a strong effect. We tried a Bonferroni-corrected t-test of just that group, and it turned out significant. Is it valid to consider this? Is there some other correction needed to deal with the fact that...
I listen for tweets matching keywords. When I receive a tweet, it may or may not be part of the set of things I'm interested about. Think about the Gemini Awards, a show similar to the Oscars, in Canada. #Gemini also happens to be an astrological sign, and many, many, many people talk astrology on Twitter. Now, imagine...
I have a large data set: over 100,000 data points, each with 60 dimensions. I want to display the data in 2D to visibly maximize the separation between classes, which I know for each point. I asked a similar question before, and Linear Discriminant Analysis (LDA) was suggested -- a solid answer. Now, besides knowing th...
Anyone know of one? I was looking at SVM-light but it seems like you can only use it in the binary classification setting. There is also SVM-multiclass but that doesn't have tSVM support. Any help appreciated. Thanks!
Many of the questions I've posted on SE in the last month have been in the goal of helping me solve this particular problem. The questions have all been answered, but I still can't come up with a solution. So, I figured that I should just ask the problem I'm trying to solve directly. Let $X_n \sim F_n$, where $F_n ...
Lets say there is a theoretical relationship you want to prove over all values of some variable. For example, $F(x)$ increases with $x$. You are unable to come up with a general theoretical proof. However, you can calculate $F(x)$ for any specific value of $x$, and the expected relationship holds. Presumably, you can ...
I am trying to understand how, using only the standard deviation and mean, you are able to determine the first and third quartiles on a normal distribution. I get that the area under the curve equals one; I understand that Q1 accounts for 25% of the area, and Q3 75%; but I do not understand how to leverage this informa...
I wonder if categorical data by definition can only take finitely or countably infinitely many values? And no more i.e. not uncountably many values? Related question: is the distribution of a categorical variable always a discrete distribution or a continuous distribution?
I think my question is quite simple and stupid: What do we forecast using single exponential smoothing model: the next value of the observed time series or the next value of the level which lies in its basis? If I got it correctly, an observed value of the time series with no trend is comprised of a level component a...
As context: When working with a very large data set, I am sometimes asked if we can create a synthetic data set where we "know" the relationship between predictors and the response variable, or relationships among predictors. Over the years, I seem to encounter either one-off synthetic data sets, which look like they...
I am trying to understand power calculation for the case of the two independent sample t-test (not assuming equal variances so I used Satterthwaite). Here is a diagram that I found to help understand the process: So I assumed that given the following about the two populations and given the sample sizes: mu1<-5 mu2<-6 ...
I have a number of variables for which I want to compare the standard deviations. Each of these variables is actually the data for a particular wavelength of light, and I want to produce a plot showing the standard deviation for each wavelength. However, the values that I am calculating my SD from are much higher for s...
I want to classify text by different topics. However, one of the current problems is that there are several topics/categories that are quite intuitively independent and statistically standalone, but there are also several other topics/categories that are quite intertwined with each other. In order to make a good decis...
In Method of Moments for estimation, if there are $k$ parameters to estimate, we usually consider $i$-th moments, $i=1,...,k$, so that we have k equations for k unknowns. I wonder if it is wise to consider more moments of different orders, i.e. $i$-th moments, $i=1,...,n>k$, so that we are to solve a over-determined l...
I'm wondering what difference it makes whether we talk about bias-variance dilemma where fitting a regression line to the given dataset reduces bias and increases variance or whether we talk about overfitting where the model is fitted to the dataset and does not generalize to new datasets. Essentially overfitting impli...
I have a set of data created by users answering a questionnaire. I imported their answers from a .csv file and got them as a data frame with one user per row and one question per column. However, the questions were not homogenous. I have to first evaluate some questions, which gives me an ordered list of the users' pr...
I have code that calculates $R^2$ with summations $$R^2 = \frac{(\sum xy - \frac1n \sum x \sum y)^2}{(\sum x^2 - \frac1n \sum x \sum x) (\sum y^2 - \frac1n \sum y \sum y)},$$ which is equivalent to $$R^2 = \frac{cov(x, y) \cdot cov(x, y)}{var(x) \cdot var(y)}.$$ I know the code is correct by benchmarking, but I have ne...
I have the summary of a logistic regression output in R. I used training data to make the model. How do I test the logistic regression model developed on the training data on the data left out? My naive guess is to create a function then run each test same through that (not even sure how do pull that) but I have to...
When estimating the confidence interval of mean, I think both the bootstrap t method and the nonparametric bootstrap method can apply, but the former requires a little more computation. I wonder what the advantages and disadvantages of bootstrap t over the normal nonparametric bootstrap are? Why? Are there some refer...
What is the best out-of-the-box 2-class classifier? Yes, I guess that's the million dollar question, and yes, I'm aware of the no free lunch theorem, and I've also read the previous questions: What is the best out-of-the-box 2-class classifier for your application? and Worst classifier Still, I'm interested in readi...
Imagine that you are planning a study about risk behaviours among HIV positive injecting drug users. All the individuals included in the sample are injecting drugs and all are HIV positive. The main “exposure” in the study is the person’s awareness about their HIV serostatus (some of the drug users do know that they ar...
Suppose we have the following dataset that records individual survival times (dur) and a covariate z: id| dur | z ------------- 1 | 1 | -1 2 | 2 | 1 3 | 3 | -1 4 | 4 | 1 I want to model the duration as a function of z. I may specify dur ~ weibull() and parameterize the scale as a function of z. This model c...
Possible Duplicate: Computing per cent correctness from a bell curve I've been trying to remember my High School teachings and are falling short. I'm working on a project where I need to give a % of correctness for an integer (How close a given number is to the actual number within a 300% difference). For example i...
I have a folder for each class that contains some text files related to that class and need to implement a classifier for these files in RapidMiner with KNN algorithm. Is there any sample?
Following Eqs. (3.10a) and (3.10b) from (Hyndman et al., 2008) I obtained a simulated series $y_t=l_{t-1}+\varepsilon_t$ and level $l_t=l_{t-1}+\alpha\,\varepsilon_t$, $t=1.2,\ldots,40$, see data below in case of $l_0=10$ and $\varepsilon_t\sim N(0,2)$: $y_t={}${8.78512, 10.0658, 10.9666, 10.9225, 5.77473, 7.20857, 11....
In "Mathematical statistics: basic ideas and selected topics, Volume 1" by Bickle and Doksum, Theoreom 4.3.2. Suppose $\{P_\theta : \theta \in \Theta \},\Theta \subset \mathbb{R}$, is a monotone likelihood ratio family in statistic $T(x)$, and suppose the loss function $l(\theta, a)$ is "reasonable" in the sense menti...
I'm trying to understand how Principal Component Analysis and Factor Analysis work by implementing examples. Although I'm mainly using Python and Numpy here, this isn't Python-specific, as I'd like to know how to get the correct result generally speaking. There is an example in chapter 16 of Statistics in a Nutshell, b...
How to create three dimensional matrix? For example: A = matrix 4 * 5 (4 rows, 5 columns) B = matrix 4 * 10 (4 rows, 10 columns) How to turn these two matrices a three-dimensional matrix?
A simplified explanation with the focus on the following questions is being inquired. Appreciation goes in advance to whom provides scientific--simple--practical explanation. Having an area A enveloping N number of points the density can be written as follows: $$D=N/A$$ Question 1: What is the difference between densit...
I am admittedly doing homework, but two problems are worded in such a way that is confusing me. Part (b) asks, "Determine the probability that an individual who has saved for retirement has saved less than $50,000. Use relative frequencies." Part (c) asks, "Determine the probability that a randomly chosen individual ha...
I admittedly am horrible at statistics. I know that the probability of an individual who has saved for retirement has saved less then 50,000 USD is 16.4% according to my sample data, but only 69% of workers say they have saved for retirement. So what is the probability for a random person selected from the entire popul...
I'd like to ask a question here that I've also asked on Biostar (stackexchange) and someone there forwarded me to this website. I was wondering how I could perform a Bray Curtis similarity clustering in R in which I show the similarity percentages on an inverted Y-axis and all tree nodes ending at 100% as I've shown in...
Suppose we are trying to estimate the quantity $\theta$ and we have that the estimator $\hat\theta_n$. Suppose it is efficient, i.e. is variance is the smallest among certain class of other possible estimators of $\theta$, say that this class is a class of unbiased estimators. Efficient estimators are naturally desire...
I want to measure the entropy/ information density/ pattern-likeness of a two-dimensional binary matrix. Let me show some pictures for clarification: This display should have a rather high entropy: A) This should have medium entropy: B) These pictures, finally, should all have near-zero-entropy: C) D) E) Is there ...
I am running an OLS model with a continuous asset index variable as the DV. My data is aggregated from three similar communities in close geographic proximity to one another. Despite this, I thought it important to use community as a controlling variable. As it turns out, community is significant at the 1% level (t-...
I have a classic linear model, with 5 possible regressors. They are uncorrelated with one another, and have quite low correlation with the response. I have arrived at a model where 3 of the regressors have significant coefficients for their t statistic (p<0.05). Adding either or both of the remaining 2 variables gives ...
Often as a result of several simulations which are themselves intensive a huge amount of information i.e., points/line/plane depending to the subject of investigation are available. Although there are extensive list of multivariate analysis and data-mining techniques to summarize the results however I am often amazed b...
It is said that to achieve a good result (many different metrics) for text classification, it is not always a business of selecting the algorithm/classifier. Sometimes, it is even more important to find a good feature selection method given the specific task. However, even before feature selection, selection of the cat...
I've been working for months on short-term load forecasting and the use of climate/weather data to improve the accuracy. I have a computer science background and for this reason I'm trying to not make big mistakes and unfair comparisons working with statistics tools like ARIMA models. I'd like to know your opinion abou...
I searched many websites to know what exactly lift will do? The results that I found all were about using it in applications not itself. I know about the support and confidence function. From Wikipedia, in data mining, lift is a measure of the performance of a model at predicting or classifying cases, measuring against...
I am trying to code a simple model with JAGS: set.seed(123) x1 <- rnorm(100) x2 <- rnorm(100) z <- 1.0 + x1*0.1 - x2*0.5 + rnorm(100) y <- z y[z < 0] <- 1 y[z >= 0 & z < 1] <- 2 y[z >= 1 & z < 1.5] <- 3 y[z >= 1.5] <- 4 jagsdf <- list(y=y,x1=x1,x2=x2) params <- c("alpha","beta") mcmcmodel <- jags.model(file="ordlog....
I have $n$ balls in an urn labeled from $1$ to $n$ and each of them has weight equal to its label. A ball has probability of being picked proportional to its weight, i.e. if the total weight of the balls in the urn is $w$ the probability of ball $i$ being picked is $\frac{i}{w}$. My question now is, if I pick balls fro...
I am new to R, and I am trying to automate some nonlinear modeling of several thousand sets of x,y data. These data are experimental results representing exponential decay. I want to model my data to this formula: y = (y0 - plateau)*exp(-k*x) + plateau I have created functions for the model and the initial value est...
Possible Duplicate: Averaging correlation values I have a number of users, and for each user I have 2 ordered lists of items (one is from observation, one is generated by an algorithm). For a given user, I can use the Spearman correlation to gauge how well my algorithm is performing. However, I'd like to evaluate ...
I have a dataset of gene-phenotype association in this format. I am looking at some combination of phenotypes and genes shared between combination. I would like to use a statistical test to show that the genes shared between two phenotypes are statistically significant using a p-value or a similar measure. For examp...
Can someone recommend a textbook(s) that covers the same topics as Probability and Statistics by by Michael J. Evans and Jeffrey S. Rosenthal? I find this particular textbook to be very poorly written and terse.
How would you explain to an only moderately statistically literate scientific reviewer that adjustment for multiple comparisons is not necessary when sampling from a Bayesian posterior?
What are some practical objections to the use of Bayesian statistical methods in any context? No, I don't mean the usual carping about choice of prior. I'll be delighted if this gets no answers.
I am faced with trying to demonstrate through testing an extremely low error rate for a sensor (no more than 1 error in 1,000,000 attempts). We have limited time to conduct the experiment so we anticipate not being able to obtain more than about 4,000 attempts. I see no problem showing the sensor does not meet the req...
I have objects from two class -- 11 objects in each class. Where each object has 3 features. with such small dataset, does it make any sense to train & use Naïve Bayes to classify new objects (test cases) ?
Im trying to understand how people use R packages and was wondering if there are documented cases where R packages have produced different answers. Clarification: The motivation behind this question comes from an effort I'm involved in where the goal to understand the importance of provenance in the analytical methods ...
Is there a convenient way in R to calculate a probability prediction interval for a count sampled from Poisson($\lambda$), for known lambda? That is, for a given $\alpha$, find $a$ and $b$ such that $P(a\le X\le b)\ge1-\alpha$, where $X\sim\text{Pois}(\lambda)$. Is there a generic way to do this in R for any of its bui...
This may sound very basic, but I have this problem: I've got a queue of data with a window size of 300. New data is added at one end, old values are removed from the other end. I expect the queue data to stay more or less consistent, e.g.: 10,12,15,10,20, then start to rise sharply: 15,10,20,22,25,26,28,30,32... all th...
Is there any way to edit a scatterplot created in SPSS/PASW after exporting/copying and pasting it into a Word document. I am finding that when I copy and paste my graph from SPSS/PASW into Word, the font size decreases. I can enlarge the graph in Word by dragging the corners but this makes the font look odd. I want t...
I have applied the one sample Kolmogorov Smirnov test of normality to two variables and one has a larger p value but both are greater than .05. e.g., $x_1$ (p-value) = 0.09 $x_2$ (p-value) = 0.06 Does this mean that $x_1$ is better or more normal than $x_2$?
I find that there are two ways to calculate AIC: AIC = -2ln(likelihood)+ 2K and AIC = n*ln(RSS/n)+2K I have: crf <- c(0.3333333, 0.5000000, 0.6666667, 0.6666667, 0.6666667, 0.8333333, 0.1666667, 0.3333333, 0.5000000, 0.5000000, 0.8333333, 0.5000000,0.6666667, 0.5000000, 0.6666667, 1.0000000) co3 <- c(218.20, 243.84, 2...
Following my earlier posts here, here and here, I understand the dangers of 'fishing' for a significant correlation. I also understand the 'problem' of running several correlations on the same data set. However, I am testing the relationship between variables A and B by several demographic characteristics, so I cannot ...
I am currently working on some FX rate modeling. I decided to use the dataset from UBC: http://fx.sauder.ubc.ca/data.html But I find that I have a problem about the timezone. The dataset is daily basis, with a Julian Day Number, does this number handle timezone shift? Or does it use GMT+0 or something else?
I have an issue with printing/creating black and white and greyscale images with ggplot2. I have been trying to make some black and white, and greyscale graphics for publication, they look perfect on mine and everyone's monitors, but came out in colour when printed. (An awful photo of the result is here: https://i.stac...
I am working with a model where the literature suggests there is potential endogeneity between the dependent variable and the primary independent variable of interest (a binary treatment). However, there is a logical argument that selection may be made into the treatment across the spectrum of the continuous dependent...
I have a two large lists and I want to compute the p-value that they are similar. The similarity algorithm is a black-box, but for this application we will trust it gives accurate p-values. My problem is my list is too large and the algorithm won't give answers for them. However, I think that if I take a smaller ran...
Non-statisticians can be easily misled by the phrase "missing at random". Their natural interpretation tends to be closer to MCAR than to MAR. I had to explain the concept to an ecologist today, and his reaction was something along the lines of "But why on Earth would you call it that?". I must admit, I couldn't come ...
I have had enough courses on statistics during my school years and at the university. I have a fair understanding of the concepts, such as, CI, p-values, interpreting statistical significance, multiple testing, correlation, simple linear regression (with least squares) (general linear models), and all tests of hypothe...
I have some project categories $(PC_1, ... ,PC_n)$ and some institutions $(I_1, ..., I_n)$ and would like to determine how fairly projects are assigned to institutions and their project categories by some external sources. I was thinking about using some chi square based measure for this. Basically I have a two dimensi...
The z-test to compare two proportions is $\newcommand{\p}{\hat{p}}\newcommand{\v}{\mathrm{Var}} z=\frac{\p_1-\p_2}{\sqrt{\v(\p_1-\p_2)}}$. Usually it is defined that $$\v(\p_1-\p_2)=\p(1-\hat{p})(1/n_1+1/n_2),$$ where $$\p=\frac{n_1 \p_1+n_2 \p_2}{n_1+n_2}.$$ Is there any written reference that legitimizes me instea...
This is somewhat of a beginner's question, but how does one interpret an exp(B) result of 6.012 in a multinomial logistic regression model? 1) is it 6.012-1.0 = 5.012 = 5012% increase in risk? or 2) 6.012/(1+6.012) = 0.857 = 85.7% increase in risk? In case both alternatives are incorrect, can someone please mention the...
I'm about to do a study about the merits of one stimulus compared to another with a within-subject design. I have a permutation scheme that is designed to reduce order effects of some parts of the study (task type order, stimulus order, task set order). The permutation scheme dictates that the sample size be divisible ...
Assume a general linear model $y = X \beta + \epsilon$ with observations in an $n$-vector $y$, a $(n \times p)$-design matrix $X$ of rank $p$ for $p$ parameters in a $p$-vector $\beta$. A general linear hypothesis (GLH) about $q$ of these parameters ($q < p$) can be written as $\psi = C \beta$, where $C$ is a $(q \time...
I have done an experiment in which I have measured the energy required to chew three different food samples on 10 subjects with 3 repetitions per sample. I am interested therefore in finding out whether there is a difference between samples according to the energy consumed. I have performed a Friedman test by ranks fol...
I'm looking to implement a coordinate descent solution to the Elastic Net (Friedman et al, 'Regularization paths for generalized linear models via coordinate descent') for logistic regression. The paper explicitly gives the coordinate update for the linear case, but I'm having difficulty understanding the solution for...
Say we use a ruler to make a measurement of the width of a block of wood. We get some value like 4.2 +/- 0.1 cm, where the error is our estimated error of our ruler's precision. Now we have four new individuals measure the same block of wood, and two of them obtain 4.5 +/- 0.1cm and two obtain 4.2 +/- 0.1 cm. If we tak...
I am hoping someone can help with this - perhaps trivial question of interpreting the formula below. It is the mean residual lifetime (restricted to the window of data) for the case of discrete time. Restricted Mean Residual Life Remaining time until event or upper bound--whichever comes first $$\mu_{[\gamma]}(t|\mat...
I am trying to develop an intuition for why L1 regression is more expensive than L2 regression. Can somebody point me to some material that explains why this is the case
First of all, I would like to describe some common layouts that Data Mining books use explaining how to deal with Unbalanced Datasets. Usually the main section is named Unbalanced Datasets and they cover these two subsections: Cost-Sensitive Classification and Sampling Techniques. It seems that facing a problem with a...
How to calculate confidence interval for this mix of independent(different subjects) and dependent (data of same subject from two sessions) observations? There are 12 subjects and the mean is calculated from these 12 subjects with data from two sessions, so 24 values go into the mean. Any ideas? p.s. R is the language...