instruction
stringlengths
9
38.7k
I am looking for theoretical resources (books, tutorials, etc.) to learn about making sound statistical inferences given (plenty of) multivariate website conversion data. I'm after the math involved, and cannot find any good non-marketing stuff on the web. The sort of questions I want to answer: how much impact does a ...
How to deal with HMC that has continuous states? Any papers, links, materials that explain the solution?
I recently spoke to a large qualitative analysis company who were working on in-depth analysis of the potential customers of train company. I asked them how they chose the people to include in their sample, they said, that they picked them at random from list of people in the region, but they also said that had predefi...
In most forecasting packages there are two transformations easily available for stabilizing variance: the square root and the logarithnic. Is there any procedure (e.g. test) that can tell the user which one of the two transformations to choose? Finally, the variance stabilization transofrmation should be apllied to tim...
I have a question concerning the RTextTools package. When I was reading textbooks and wikipedia I imagined that text classification is all about defining a classificator. In RTextTools you define learning and testing documents in one command. For example data <- data[sample(1:3100,size=100,replace=FALSE),] matrix <- cr...
I have rewritten the old question (below) to hopefully make things a bit clearer. Basically I think that the temperature of the earth should be normally distributed but is not due to the ‘seasonal tilt’ and curvature of the earth’s surface. I have added some histograms for different ‘latitude bands’ of the temperatures...
Having used randomForest in R to produce a fairly successful classifier is there any way to emphasise sensitivity over specificity, for example, if the cost of missing a disease is much greater than diagnosing a false positive?
Some clustering algorithms require independence of variables but (especially working with real data) variables are often highly correlated. I have been suggested to apply a Principal Component Analysis to solve the problem (using the resulting linear combination as input for the clustering). But such a solution may aff...
I have carried out a study on change of call volume over a year (oct 07-mar 09). What statistical test on SPSS software can I use to show the difference in call volume on a day by day basis and on a monthly basis?
Is there any difference among the following terms or they are same? Bias Systematic bias Systematic errors If there exist some differences then, please explain them. Can these errors be reduced when one increase the sample size? UPDATE: My field of interest is statistical inference. I mean to say that how we differ...
It is quite common to discuss what metrics to be used for a model/algorithm/method. But when it comes to metrics of datasets, it is much less discussed. I wonder, what are the general metrics for datasets? That is to say, how does one quantitively measure if a dataset is good or not for its purpose? I understand, there...
What does it mean "The means are statistically equals?" I ask this question because I'm studing ANOVA (anova() function in R) and I know that this test checks if the means of N groups are statistically equals. My doubt concerns what "statistically equals" means because if I have two series like: A <- c(2,4,12,14) the ...
We have recently conducted a cluster analysis for an open card sorting task in which 19 experts grouped 112 items each. We achieved decent silhouette values for the cluster analysis but have been asked by reviewers to provide evidence that the number of experts we used was sufficient for this task (I think they are exp...
I have data from a survey with Likert-type questions (Rate how strongly you feel about this issue on a scale from 1 to 10). We know the respondents home town (as well as some other information, such as gender, age, educational level etc.). We found that the average (mean) score on one of the survey questions was a lot ...
I want to use model-based clustering to classify 1,225 time series (24 periods each). I have decomposed these time series using the fast Fourier transform and selected the harmonics that explain at least a threshold percentage of time series variance for all time series in the sample. I want to do model-based clusterin...
My colleague and I are fitting a range of linear and nonlinear mixed effect models in R. We are asked to perform cross-validation on the fitted models so that one can verify that the effects observed are relatively generalizable. This is normally a trivial task, but in our case, we have to split the whole data into a t...
I have a simple question. Suppose $X=(X_1,X_2,X_3)$ is multivariate normal. What's the best (quickest) way to draw from the conditional density $X_1\mid \exp(X_1)+\exp(X_2)+X_3$?
Based on this post, I want to digest Elements of Statistical Learning. Fortunately it is available for free and I started reading it. I don't have enough knowledge to understand it. Can you recommend a book that is a better introduction to the topics in the book? Hopefully something that will give me the knowledge need...
I'm trying to formally write out the problem: Light bulb color problem when I come up with the following equation $$\sum_{i=0}^{k-1}{C}_{2k-1}^{2k-1-i}{p}^{2k-1-i}{(1-p)}^{i}=\sum_{i=0}^{k-1}{C}_{2k}^{2k-i}{p}^{2k-i}{(1-p)}^{i}+\frac{1}{2}{C}_{2k}^{k}{p}^{k}{(1-p)}^{k}$$ where it is supposed to hold for all $k\geq1$. ...
Here are four graphs, 1, autocorrelation, autocovariance, partial-correlation and cross-correlation calculated from a time series are given. 2, The time series I need to do some predictions on them. My questions are 4 : 1, I do not quite understand what these four graphs can tell or show. Can anyone explain? 2, Does t...
[I apologize in advance for the length of this question. but it seems unavoidable.] I'm trying to do binary classification, using Bayesian methods, and I'm having some trouble figuring what methods I need to do so. Bottom line - I need some kind of decision rule. I've tentatively settled on a version of the Bayes facto...
I need to make linear model for which I need to do Gibbs sampling in MCMC simulations. The model needed to be fitted is a linear mixed model. Please suggest me for a robust R package for this task.
I saw a lot of times claims that they have to be exhaustive (the examples in such books were always set in such way, that they were indeed), on the other hand I also saw a lot of times books stating they should be exclusive (for example $\mathrm{H}_{0}$ as $\mu_1=\mu_2$ and $\mathrm{H}_{1}$ as $\mu_1>\mu_2$) without cl...
Consider the system of equations: $$\begin{align} 2000 &= \frac{2T}{\chi^2_{2n+2}(1-\alpha)} \\ 2370&= \frac{2T}{\chi^2_{2n}(\alpha)} \\ \end{align}$$ where $\alpha = 0.90$, $n$ is a degrees of freedom, and $T$ is a cumulative time of experience. How do I calculate $n$ and $T$? The difficulty is how to repl...
I initially asked this on stack overflow and was referred to this site, so here goes: I am implementing some unsupervised methods of content-selection/extraction based document summarization and I'm confused about what my textbook calls the "log-likelihood ratio". The book Speech and Language Processing by Jurafsky & M...
Anyone knows a prior (preferably conjugate) to the multivariate Polya distribution? I need it for Gibbs sampling. So if anyone has another idea, I am interested.
Is the best way to find the median survival time from a survival plot just to draw a horizontal line from $p = 0.5$ to the curve and project down to the x-axis?
The proportional hazards assumption basically says that the hazard rate does not vary with time. That is, $\text{HR}(t) \equiv \text{HR}$. When can we assume this? What if the hazard ratios at various times are: $2.4, 2.36, 2.27$ and $2.03$? Can we make the proportional hazards assumption? Also we have $$ \log[h(t|\te...
In Clinical trials - a methodologic perspective, Steven Piantadosi writes (ch.13, p. 334): In Chapter 2, I noted the objections to randomization by Abel and Koch (1997) and Urbach (1993), and indicated the worth of studying their concerns and likely errors. They reject randomization as a means to validate certain st...
I have the following small data: father <- c(NA, NA, NA, 1, 1, 1, 2, 2, 2, 3, 4) mother <- c(NA, NA, NA, 2, 2, 1, 1, 1, 3, 4, 4) idd <- c(1:11) yvar <- rnorm(11, 5, 2) xvar <- c(1,1,2, 1,2,1, 1,1, 2, 1,2) mydf <- data.frame (father, mother, idd, yvar, xvar) require(kinship) kmat <- kinship(mydf$idd, mydf$father,mydf$...
Let's say I have a large set of $S$ values which sometimes repeat. I wish to estimate the total number of unique values in the large set. If I take a random sample of $T$ values, and determine that it contains $T_u$ unique values, can I use this to estimate the number of unique values in the large set?
I have a data set with ~80 records, with ~8 features. I want to predict one of the features in future records. The feature is numeric and discrete. It ranges between -30 up to 140 with steps of 5. Until now I wanted to predict another feature which is boolean, so I used logistic regression. Which method should I use h...
How many cases are required for each variable in order to build a linear regression model and/or a Multivariate Regression Splines Model? Also, Is it a rule of thumb, or does there exist a statistical justification? Any bibliographical references?
If I have a reference data set comprising repeated measurements of 3 variables of a system in state $A$. Given new observations of these variables for a different system I would like to classify individual observations as being in state $A$ or not. My initial inclination would be to compare the new value of each varia...
I have run the General Linear Model in SPSS to analyse the effect of several demographic variables (e.g. gender, age) on the relationship between X and Y. So essentially, this is an analysis to see if there is a significant interaction between (for example) age and X on Y. (Also called moderator effect) I have found t...
Given a Bayesian network that looks like the following: A->B->C How do we compute P(A|C)? My initial guess would be: P(A|C) = P(A|B) * P(B|C) + P(A|not B) * P(not B|C)
I couldn't see a question addressing this. I think I'm just off the mark somewhere with my thinking. Here is a simple model: mod <- lm(hp ~ factor(cyl), data=mtcars) summary(mod) Estimate Std. Error t value Pr(>|t|) (Intercept) 82.64 11.43 7.228 5.86e-08 *** factor(cyl)6 39.65 18.33...
Let $X$ have the Negative Binomial distribution with parameters $r$ and $p$. The Negative Binomial distribution is a mixture distribution or compound distribution. That is $X$ is $\text{Poisson}(\lambda)$ where $\lambda$ is randomly chosen from a $\text{Gamma}(r, p/(1-p))$. Use this relation to write an R function for...
Can a hazard ratio be undefined because you are comparing a "lower value" to a "higher value?" For example, suppose you are interested in some variable $x \in [0, 100]$. Say you are interested in comparing 5 values of $x$. If you choose the highest value of $x$ to be the reference level... Would all the hazard ratios ...
Are there better alternative methods to choose C and Gamma which yield better training performance?
I found this confusing when I use the neural network toolbox in Matlab. It divided the raw data set into three parts: training set validation set test set I notice in many training or learning algorithm, the data is often divided into 2 parts, the training set and the test set. My questions are: what is the differen...
Please help me to find out simple (I mean useful with little knowledge on Bayesian statistics) resources: To learn MCMC and perform general linear or mixed models To learn different sampling techniques including reverse jump sampler. Also, I want implement these methods using R base or R packages. I can use SAS and ...
I have the opportunity to develop a simple solution to display suggested products on an e-commerce website. My first choice was to use Naive Bayes due to its simplicity of implementation. However, I got to this state: $P(buys|product.type,product.brand) = \frac{P(buys) * P(product.type|buys) * P(product.brand|buys)}{P...
I am a novice to program R and have been trying to perform a repeated measures ANCOVA with Temperature as the dependent variable, Site as the independent variable, Date as the covariate and Year as the repeated measures. My dataset consists of temperatures from 4 sites, over 20 days, during 2 different years. There app...
Consider 1000 samples drawn from an unknown distribution. Whats the difference between the following two ways of calculating sample mean and sample variance? find sample mean and sample variance over all 1000 samples. find sample mean over first 500 samples and sample variance over remaining 500 samples. What is the ...
Say I have a list of 10000 sorted counts $\ge 0$ that sum to 20000 and I want to determine that they came from placing 20000 balls randomly, independently and uniformly into 10000 cells. A straight Chi-squared test would be reasonable if I assume independence, but 10000 counts of two would be blessed by chi squared, b...
I am analysing some behaviour data from several participants in Matlab. I used to do "repeated measures" in SPSS. But is this the same as adding "subject" as a factor, and choosing it as a random effect? i.e. my normal repeated measures data matrix x looks like this condition A condition B subject...
I'm trying to understand how to analyse transformed data using ANOVA. If my data does not meet the assumption of normality, and I have transformed it using a log transformation to fix that, would I then run my analysis on the transformed scores and cite the transformed values? Edit: More specifically, when you have tra...
I have a large gridded dataset for the globe (i.e a spherical, wraparound surface) that I'm applying spatial regression to (using a CAR model). I've been using the default autocorrelation function, however as my data is global (point 0,0 lies next to max(x),0 and 0,max(y)), I wondered if a spherical autocorrelation fun...
I have run a 1 way ANOVA and carried out some post hocs to see which direction the results go in. If I report the direction of the findings - e.g. this group was higher than the other, which statistic do I quote? I have carried out Games-Howell post hoc and all it seems to come with is an associated p value, is this al...
I need two sets of data collected over 3 years. The first data has 12 waves where each wave represents a quarter. The other has 24 waves where each wave include some part of the previous wave (e.g. 1st wave 1/1/07-4/30/07; 2nd wave 3/1/07-6/30/07 ...) The variables measured were rates (specific lab tests taken from cer...
I.e. I want to put in Baseball and get out Sports & Outdoors.
I found auto.arima() function in forecast packages. As far I have understand how it works, It should find the best model for the data, my question is: Is it possible to understand if the variance is not constant during all the period(timeseries) using that function? I mean... If it fit a model it should means that the ...
I have a logistic regression model with several categorical explanatory variables and one interaction term (between two binary variables, named A and B). I know how to calculate the odds ratios for the different levels of A and B (for A=1, e.g., I need to add the coeff for A and coeff for A*B, then exponentiate), but h...
I am trying to learn how to apply unsupervised classification to spatial data. In near infra red satelite pictures; the ocean is dark and the forest is white. Each pixel in such an image is an observation. I guess the variables are [x-position, y-position, grayscale]? Which methods could I use to classify the pixels in...
Basically what I'm wondering is how different covariance structures are enforced, and how the values inside these matrices are calculated. Functions like lme() allow us to chose which structure we'd like, but I'd love to know how they are estimated. Consider the linear mixed effects model $Y=X\beta+Zu+\epsilon$. Where ...
Is there an analogue to the higher moment Chebyshev's inequalities in the one sided case? The Chebyshev-Cantelli inequality only seem to work for the variance, whereas Chebyshevs' inequality can easily be produce for all exponents. Does anyone know of a one-sided inequality using the higher moments?
In PROC PHREG, how do you set a continuous variable at a certain value as the reference level? For example, suppose x = 3.5, 3.6, 4.3, 5.4 and we want x = 6 to be the reference level. How would you do this in SAS? Would this be correct: data new; set old; x1 = (x=3.5); x2 = (x= 3.6); ...
I am suffering from a blackout. I was presented the following picture to showcase the bias-variance tradeoff in the context of linear regression: I can see that none of the two models is a good fit - the "simple" is not appreciating the complexity of the X-Y relation and the "complex" is just overfitting, basically le...
I have two time series, shown in the plot below: The plot is showing the full detail of both time series, but I can easily reduce it to just the coincident observations if needed. My question is: What statistical methods can I use to assess the differences between the time series? I know this is a fairly broad and vag...
After killing a monster there's a percent chance certain items drop that are unique to the monster, but sometimes the monsters are in groups and we only get the drops after killing all of them. Monster A, B, C sometimes appear like [A,B] A with B but never [A] alone, but sometimes as [C,A]. What is it called solving th...
What is the appropriate way of reporting significant regression coefficients of a multiple regression when all variables have been obtained at the same measurement occasion? Specifically, do I imply a causal relationship when I report that A significantly predicts B or A has a significant effect on B?
I'm trying to do some percentage based comparisons across different groups in a criminal sentencing data set (http://dl.dropbox.com/u/1156404/wightCrimRecords.csv) I have a data in an array of the form: $Female x Burglary Criminal Damage and Arson ...
The Ubuntu Software Center uses a 1 to 5 star rating system for its App Reviews. However, it's current ratings sorting algorithm looks very fishy. I believe this is a different question from this one, which seems to assume the mean of the ratings is a meaningful number. If I assume that user supplied ratings are or...
Can you calculate the Standard Error of the Mean (SEM) for a set of data given the SEM from two subsets of the data? How would you do this? (The two subsets are mutually exclusive and exhaustive.) Let's say I have the mean and SEM for both men and women on some test, but I do not have access to the original data. I k...
I need to compute the estimate the variance component for my data. I have the following model, y = gene, cell line, gene*cell line, DNA extract[cell line] How do I write this for the lme function? I am confused on how to indicate that "DNA extract" is nested within "cell line" and also have it marked as a random varia...
I have N different possible results (ex. red, yellow, or blue). I go to a population of infinite size and ask a bunch of people a question the answer to which is one of the N options.... How large will my sample size need to be to have a ~95% confidence that the sample's distribution of answers represents the full pop...
I am experimenting with Classification algorithms in ML and am looking for some corpus to train my model to distinguish among the different text categories like sports, weather, technology, football, cricket etc. Where I can find some dataset with these categories? An option would be to crawl Wikipedia for these 30+ ca...
I'm trying to classify 6-dimension feature vectors in two different classes using the nearest neighbor algorithm. After analyzing my training data, I realized that the same vector is present numerous times in both classes. What does this mean? Does it indicate a bad feature choice? During training, should I group iden...
We have 100 participants in two groups, $n=50$ in each group. We used an assessment of ability of basic functioning at 4 time-points. The assessment comprises 6 questions, each scored 0 – 5. We do not have individual scores for each question, just total scores that range from 0 – 30. Higher scores indicate better funct...
Background I have a variable $X\sim Beta(2,1)$ and another variable $Y=\frac{X}{1-X}$ wikipedia states: If $X \sim \operatorname{Beta}(n/2,m/2)$ then $ \frac{m X}{n\left(1-X\right)} \sim \operatorname{F}(n,m)$ From this, I infer that $Y\sim F(4,2)*2$. Knowing the parameterization of $X$, I would like to parameteriz...
In R, how do I specify lmer model without global fixed effect? For example, if I say something like lmer(y ~ (1 | group) + (0 + x | group), data = my_df) the fitted model will be $y_{ij} = a + \alpha_{i} + \beta_{i} x_{ij}$ How do I fit model $y_{ij} = \alpha_{i} + \beta_{i} x_{ij}$?
Suppose we want to test whether $Z$ is a confounding variable for the effect of $X$ on $Y$. Is it enough to just check unadjusted and adjusted estimates of the coefficient of $X$ and see if they differ? Also, if the difference between the two is very small (e.g $1/1000$) can we say that there is no confounding? It seem...
I have difficulty in solving unit root test by using both adf.test and pp.test in R. The result p-value using adf.test is 0.2677 (mean that it has unit root), and the result p-value using pp.test is 0.01696 (mean that is has no unit root). What means that? I wonder whether I have to use diff function to remove unit roo...
I am working on machine translation evaluation, and am looking at ratings given by humans who are judging the quality of sentences produced by machine translation systems. The evaluators give fluency and adequacy (how well the information is preserved) scores to sentences. The data is from NTCIR7 for those that are int...
We have a deck of $n$ cards. We draw cards from it uniformly at random with replacement. After $2n$ draws what is the expected number of cards never chosen? This question is part 2 of problem 2.12 in M. Mitzenmacher and E. Upfal, Probability and Computing: Randomized Algorithms and Probabilistic Analysis, Cambridge...
Can chi-square test be performed on data that does not have normal or gaussian distribution? One of the chi-square tests I am performing results in percentage points less than the 12.59 (α=0.05, v=6) using cross-tabulation. Therefore, I cannot reject the null hypothesis. Is there a test that I can perform to confirm t...
It is a straightforward approach having a set of coordinates (e.g., in 2D as {x,y}) and at least an associated variable (e.g., v) to calculate a variogram as a descriptor of the spatial dependency of the variable v through the field being studied. The question appeared to me is: how to generate a realization of a d...
I am trying to fit panel data to a model of the form $$y_{t,i} = \sum_{j} X_{t,i,j} \beta_j + \sum_k Z_{t,i,k} \gamma_{i,k} + \sigma_i \epsilon_{t,i},$$ where the regressors $X$ and $Z$ are observed along with the regressand $y$, and the $\epsilon_{t,i}$ are assumed i.i.d. (The coefficients $\gamma$ are like 'fixed eff...
How should I estimate the number of unique elements in a randomly shuffled list? I'm in a situation when the memory I have is much smaller than memory needed to store all unique elements. Something efficient with confidence interval and/or a reference for such procedure would be great
I'm trying to quanitfy how well (or poorly) different polling companies did in a recent election ina multi-party system (so, it's not as easy as saying how much they got the margin wrong in a two-horse race). So, say the real election result was: Election CompanyA CompanyB Party A 0.3 0.3 0.3 Party...
I have 2 copora: List 1 contains 1 million words in total. This represents general written usage. List 2 contains 5 million words in total. This represents a sub-genre of literature. I would like to isolate those words that are special to that genre; by comparing the two lists. Using some software I wrote, I can get ...
I'm fitting a generalized linear mixed model in R using the Laplace approximation. I'm looking for a reference for the Laplace approximation used for that, or a reference regarding the comparison between the PQL and Laplace methods for fitting generalized linear mixed models.
This figure: shows my odds ratios. I believe they have to be linear for logistic regression to work and am wondering how to pre-process these data. Thanks.
I'm trying to implement the extended binomial density function with support on c( 0 : (floor(N) + 1)), but I'm running into (I think) precision issues, as running: ######################## #---DENSITY FUNCTION---# ######################## debinom <- function(k, n, p, sum) { if (k <= n) { return( choose(n, k) * p...
Suppose I want to generate a nonnegative $n \times n$ matrix $\mathbf A$ for an odd $n$ (say, $n=5$ for a good enough example), such that the individual elements are drawn from a uniform distribution but with the equality constraints the sum of all the elements in the rows above the mid row = the sum of all the elem...
Logistic regression fits a model that predicts a binary variable whilst performing a logit transformation of the linear combination (LC) of predictors: 1/1 + exp(-LC). I have a working machine learning algorithm which does the same but fits a non linear combination of predictors by maximising the log likelihood. I woul...
I'm re-analyzing a colleague's data. The data and R code are here. It's a 2x2x2x2x3 completely within-Ss design. One of the predictor variables, cue, is a two-level variable that when collapsed to a difference score reflects a theory-pertinent value. She previously collapsed cue to a difference score within each subjec...
Suppose I do the following: proc phreg data = new; model time*censor(0) = x y; run; Also suppose $x$ is a binary variable and $y$ is a continuous variable. How would I plot the survival function for $x = 1$ and $y = 100$ (for example) in SAS?
Does this mean you can't compute the median?
Given the data points $x_1, \ldots, x_n \in \mathbb{R}^d$ and labels $y_1, \ldots, y_n \in \left \{-1, 1 \right\}$, the hard margin SVM primal problem is $$ \text{minimize}_{w, w_0} \quad \frac{1}{2} w^T w $$ $$ \text{s.t.} \quad \forall i: y_i (w^T x_i + w_0) \ge 1$$ which is a quadratic program with $d+1$ variables ...
I've been reviewing questions from a statistics exam of the last year. There is a question with the probability density function below $$\displaystyle f(x,\theta) = \frac 1{2\theta^3}x^2e^{-\frac x\theta}$$ where $\displaystyle0<x<\infty$ and $\displaystyle0<\theta<\infty$. Question is as follows: a) Find the maximu...
Typically, when one encounters continuous but skewed outcome measures in a longitudinal design (say, with one between-subjects effect) the common approach is to transform the outcome to normality. If the situation is extreme, such as with truncated observations, one might get fancy and use a Tobit growth curve model, o...
I am looking for various ways of explaining to my students (in an elementary statistics course) what is a two tailed test, and how its P value is calculated. How do you explain to your students the two- vs one- tailed test?
I am looking for help in identifying what is the best statistical approach to address the following market research question: (1) I have a dataset from an online website that helps users rent their vacation homes. For each vacation home I have information on: Their attributes (predictor variables): location (city and ...
I have found this test: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/mood.test.html unfortunately I didn't find any information on wikipedia, but what "scale" means? What do those tests check? Thanks
Suppose we have a set of key value pairs, such that the keys can be ordered based on the value . We can easily extract and report the top $n$ keys. Now suppose the we havet S such sets. From each set we are supposed to extract a set of $p$ top keys and merge them to get the top $n$ keys from all the sets. How large sho...
In a lattice xyplot with multiple smooth curves, I plotted curves categorized by color (y1, y2, y3 in blue; z1, z2, z3 in red). If we consider the following simple data : x<-1:50 y1<-rnorm(50,100,20) y2<-rnorm(50,80,20) y3<-rnorm(50,90,20) z1<-rnorm(50,60,20) z2<-rnorm(50,40,20) z3<-rnorm(50,65,20) we can make such a ...
I have a large csv file with around 45,000 rows and about 6 columns. The columns are set-up like: Module, File-path, Status, Version-Old, Version-New, Change-diff Change-diff is simply the result of doing: New - Old. There are around 30 different modules and I want to perform analysis and create different graphs for e...
Given two samples of arrival rate of a process (they should end up something like a Poisson distribution): One over a long period (something like several days) Another from a shorter period time (maybe 30 minutes) How can I compare the shorter distribution to see if it varies significantly from the longer distributio...