instruction
stringlengths
35
38.7k
I have a dataset that contains ~7,500 blood tests from ~2,500 individuals. I'm trying to find out if variability in the blood tests increases or decreases with the time between two tests. For example - I draw your blood for the baseline test, then immediately draw a second sample. Six months later, I draw another sa...
(migrating from math overflow, where no answers were posted) suppose I have $K$ different methods for forecasting a binary random variable, which I test on independent sets of data, resulting in $K$ contingency tables of values $n_{ijk}$ for $i,j=1,2$ and $k=1,2,...,K$. How can I compare these methods based on the cont...
There's a lot of work done in statistics, while state-of-art in lossless data compression is apparently this: http://mattmahoney.net/dc/dce.html#Section_4 Please suggest good methods/models applicable for data compression. To be specific: 1) How to estimate the probability of the next bit in a bit string? 2) How to int...
My question is directed to techniques to deal with incomplete data during the classifier/model training/fitting. For instance, in a dataset w/ a few hundred rows, each row having let's say five dimensions and a class label as the last item, most data points will look like this: [0.74, 0.39, 0.14, 0.33, 0.34, 0] A few m...
I am trying to test the null $E[X] = 0$, against the local alternative $E[X] > 0$, for a random variable $X$, subject to mild to medium skew and kurtosis of the random variable. Following suggestions by Wilcox in 'Introduction to Robust Estimation and Hypothesis Testing', I have looked at tests based on the trimmed mea...
I came across an error of numerical overflow when running a maximum likelihood estimation on a log-linear specification. What does numerical overflow mean?
Can anyone recommend me an open source graphic library to create forest and funnel plots? I was aiming at using it on a Java desktop application.
I'm interested in obtaining a bootstrapped confidence interval on quantity X, when this quantity is measured 10 times in each of 10 individuals. One approach is to obtain the mean per individual, then bootstrap the means (eg. resample the means with replacement). Another approach is to do the following on each iteratio...
I am attempting to compare two diagnostic odds ratios (DORs). I would like to know of a statistical test which will allow me to do this. Please help! Thank you!
Background: In some cognitive psychology research areas N-alternative forced choice tasks are common. The most common of these is a two alternative forced choice (2AFC). This usually takes the form of participants being given a stimulus and asked to make one of two judgement, e.g. the target stimuli is present/absen...
It seems like the current revision of lmer does not allow for custom link functions. If one needs to fit a logistic linear mixed effect model with a custom link function what options are available in R? If none - what options are available in other statistics/programming packages? Are there conceptual reasons lmer d...
This definitely sounds like a homework, but I assure you that it's not. You're probably familiar with the Risk game. Now, friend of mine rolled 3 aces in one hand. I reckon that probability of such event is $$C(n,k) = \frac{(n-1+k)!}{(n-1)!k!}$$ so that's $8!/(5!*3!) = 56$, so the probability is $1/56$. Am I correct? P...
I'm exploring the use of changepoint detection or other methods (am slowly becoming aware of wavelet transformation, etc. but have tons to learn in this area) to identify key shifts in health care performance patterns over time. However, many of the metrics I'm seeking to analyze (e.g., health care quality metrics) are...
Does anybody have a nice example of a stochastic process that is 2nd-order stationary, but is not strictly stationary?
In answering this question John Christie suggested that the fit of logistic regression models should be assessed by evaluating the residuals. I'm familiar with how to interpret residuals in OLS, they are in the same scale as the DV and very clearly the difference between y and the y predicted by the model. However fo...
Do you think it can be used instead of k means? I obtained a correlation with the first 2 components as they carry over 90% of the weight. Would you agree on the technique?
This question follows from my previous question, where Robin answered the question in the case of weak stationary processes. Here, I am asking a similar question for (strong?) stationary processes. I'll define what this means (the definition can also be found here). Let $X(t)$ be a stochastic process. We say that $X...
If I have highly skewed positive data I often take logs. But what should I do with highly skewed non-negative data that include zeros? I have seen two transformations used: $\log(x+1)$ which has the neat feature that 0 maps to 0. $\log(x+c)$ where c is either estimated or set to be some very small positive value. Are...
I want to fully grasp the notion of $r^2$ describing the amount of variation between variables. Every web explanation is a bit mechanical and obtuse. I want to "get" the concept, not just mechanically use the numbers. E.g.: Hours studied vs. test score $r$ = .8 $r^2$ = .64 So, what does this mean? 64% of the variabili...
I have a data set that contains two types of points. The first type of points come from an N(0,1) distribution. The second type of points come from an N(m,v) distribution for some real m and some positive, real v. The objective is to classify each point as type 1 or type 2, and to identify m & v. We have no apriori inf...
I have a bunch of articles presenting "OR" with a- 95% CI (confidence intervals). I want to estimate from the articles the P value for the observed OR. For that, I need an assumption regarding the OR distribution. What distribution can I safely assume/use?
I find it hard to understand what really is the issue with multiple comparisons. With a simple analogy, it is said that a person who will make many decisions will make many mistakes. So very conservative precaution is applied, like Bonferroni correction, so as to make the probability that, this person will make any mi...
I am trying to build a time series regression forecasting model for an outcome variable, in dollar amount, in terms of other predictors/input variables and autocorrelated errors. This kind of model is also called dynamic regression model. I need to learn how to identify transfer functions for each predictor and would...
I am trying to figure out the best transformation of my consumption variable. I am running a probit regression to look at whether or not a household enrolls in health insurance. Consumption per capita is an independent variable and in my current model I use both consumption and consumption squared (two separate variab...
Let's say I want to make a football simulator based on real-life data. Say I have a player who averages 5.3 yards per carry with a SD of 1.7 yards. I'd like to generate a random variable that simulates the next few plays. eg: 5.7, 4.9, 5.3, etc. What stats terms to I need to look up to pursue this idea? Density funct...
Can someone recommend a text with derivations of classical estimator efficiency results? I'm particularly interested in likelihood and pseudo-likelihood estimators for multi-variate discrete models
I need to analyze with R the data from a medical survey (with 100+ coded columns) that comes in a CSV. I will use rattle for some initial analysis but behind the scenes it's still R. If I read.csv() the file, columns with numerical codes are treated as numerical data. I'm aware I could create categorical columns from t...
I want to cluster ~22000 points. Many clustering algorithms work better with higher quality initial guesses. What tools exist that can give me a good idea of the rough shape of the data? I do want to be able to choose my own distance metric, so a program I can feed a list of pairwise distances to would be just fine. I ...
I am trying to write unit tests for a whole mess of statistics code. Some of the unit tests take the form: generate a sample following a null hypothesis, use code to get a p-value under that null, repeat hundreds of times, then look at all the p-values: if they are reasonably uniform, then the code passes. I usually ch...
In a particular application I was in need of machine learning (I know the things I studied in my undergraduate course). I used Support Vector Machines and got the problem solved. Its working fine. Now I need to improve the system. Problems here are I get additional training examples every week. Right now the system st...
We have performed a microarray screening of about 200 samples. In each sample we measure about 100 different variables. For technical reasons the screening of these 200 samples was divided into two batches with a couple of weeks interval between them. When all the data has been collected, I have performed principle com...
$\chi^n_k=\sum_{i=1}^kx_i^n$ where $x_i$ are Gaussian variables and $n>2$?
Does anyone know of research which investigates the effectiveness (understandability?) of different visualization techniques? For example, how quickly do people understand one form of visualization over another? Does interactivity with the visualization help people recall the data? Anything along those lines. An examp...
I'm interested in the process of testing or validating a particular implementation of a statistical method, and what datasets and/or published analysis exist that could be used to do this in practice. For instance, if I write an algorithm to implement a simple linear regression, I might feed in some numbers and check t...
Q: Is my approach correct? Event: You toss 5 coins at once. A student of mine claimed he got 4T & 1H in 39 out of 40 trials (!!) I decided to calc the odds of this... First, P(4T & 1H) = 5C4 * (1/2)^4 * (1/2)^1 = .16 I did this 2 ways: 1) Binomial Probability n = 40 r = 39 p = .16 q = .84 P(Exactly 39) = 40 C 39 ...
I am a database developer working for a sales and manufacturing business. I am mostly ignorant about statistics. We need useful metrics. Our managers are tuned to accounting, and the vagaries of production tend to confound us. We do very little measuring of our production, and what we have is poorly formed. I shou...
In (most of) the analytical chemistry literature, the standard test for detecting outliers in univariate data (e.g. a sequence of measurements of some parameter) is Dixon's Q test. Invariably, all the procedures listed in the textbooks have you compute some quantity from the data to be compared with a tabular value. By...
Came across an interesting problem today. You are given a coin and x money, you double money if you get heads and lose half if tails on any toss. What is the expected value of your money in n tries What is the probability of getting more than expected value in (1) This is how I approached it. The probability of heads...
What is the difference between data mining and statistical analysis? For some background, my statistical education has been, I think, rather traditional. A specific question is posited, research is designed, and data are collected and analyzed to offer some insight on that question. As a result, I've always been skept...
Say I have eaten hamburgers every Tuesday for years. You could say that I eat hamburgers 14% of the time, or that the probability of me eating a hamburger in a given week is 14%. What are the main differences between probabilities and proportions? Is a probability an expected proportion? Are probabilities uncertain and...
When carrying out OLS multiple linear regression, rather than plot the residuals against fitted values, I plot the (internal) Studentized residuals against fitted values (ditto for covariates). These residuals are defined as: \begin{equation} e^*_i = \frac{e_i}{\sqrt{s^2 (1-h_{ii})}} \end{equation} where $e_i$ is the ...
I am working on some MRSA data and need to calculate the relative risk of a group of hospitals compared with the remaining hospital. My colleagues throws me an excel with a formula inside to calculate the "exact confidence interval of relative risk", I can do the calculation without difficulties, but I have no idea on ...
I've been asked to give some advice for some clinicians who are comparing two different methods of blood pressure measurement. I suggested to them that we should proceed with a two-one-sided-test technique to determine equivalence of the two techniques. Unfortunately I have now learned that the clinicians have multipl...
Does mutual information discriminate against fold change differences?
The Kolmogorov–Smirnov distribution is known from the Kolmogorov–Smirnov test. However, it is also the distribution of the supremum of the Brownian bridge. Since this is far from obvious (to me), I would like to ask you for an intuitive explanation of this coincidence. References are also welcome.
Assume you draw a uniformly distributed random number between 0 and 1 n times. How would one go about calculating the expected minimum number drawn after n trials? In addition, how would one go about calculating a confidence interval to state that the minimum number drawn is in the interval [a,b] with m% confidence?...
i'm not sure how to google for this as i am not very familiar with time series analysis. i have 500 websites, and i am measuring the number of visitors to each website each day. at some point, i turn on SEO (search engine optimization) for each of the websites. this happens on different days for different websites. ...
I have the following frequency table: 35 0 4 3 7 6 5 4 39 1 9 6 7 7 6 8 36 0 7 10 11 11 10 16 41 0 9 8 8 7 6 7 41 0 8 9 10 9 12 11 55 2 12 9 11 12 11 13 55 1 10 10 11 10 12 11 47 1 14 8 12 15 12 12 45 1 10 11 10 10 9 18 56 0 ...
What is the difference between having something statistically significant (such as a difference between two samples) and stating if a group of numbers are independent or dependent.
I am taken by the idea of James-Stein shrinkage (i.e. that a nonlinear function of a single observation of a vector of possibly independent normals can be a better estimator of the means of the random variables, where 'better' is measured by squared error). However, I have never seen it in applied work. Clearly I am no...
i have a different sample size n for every month for example i have 13890 one month then 17756, then 21425 the data every month for example 13890 is broken down into: 48 chairs, 12 tables, 2 couches etc... next month we have similar metrics like 3 chairs, 23 tables, 4 couches etc.. i would like to know how i am doing...
I have a question on subject chi-square test for independence. I have, for example, two events A and B. If chi square test is not passed: is A dependent on B (A|B) or B on A (B|A)? Or does be valid both? (A|B and B|A). Thank you in advance.
Could you inform me please, how can I calculate conditioned probability of several events? for example: P (A | B, C, D) - ? I know, that: P (A | B) = P (A $\cap$ B) / P (B) But, unfortunately, I can't find any formula if an event A depends on several variables. Thanks in advance.
I am trying to recreate (in R) a frequentist hypothesis testing in Bayesian from, by calculating Bayes factors of the null (H0) and alternative (H1) models. The model is simply a simple linear regression that tries to detect a trend in global temp. data from 1995 to 2009 (here). Therefore, H0 is no trend (i.e. slope = ...
It seems that a number of the statistical packages that I use wrap these two concepts together. However, I'm wondering if there are different assumptions or data 'formalities' that must be true to use one over the other. A real example would be incredibly useful.
Imagine You run a linear regression with four numeric predictors (IV1, ..., IV4) When only IV1 is included as a predictor the standardised beta is +.20 When you also include IV2 to IV4 the sign of the standardised regression coefficient of IV1 flips to -.25 (i.e., it's become negative). This gives rise to a few quest...
Contrary to some here, others (e.g. Brian Ripley, the authors of sensR, and the authors of psyphy) appear to think that using a standard binomial link function when analyzing two alternative forced choice data in which the minimum expected proportion correct is .5 is incorrect. However, their approach as to what the l...
If one has an r value of 0.60, can one state that an increase in one variable is 60% likely to mean an increase in the other variable?
Lots of people use a main tool like Excel or another spreadsheet, SPSS, Stata, or R for their statistics needs. They might turn to some specific package for very special needs, but a lot of things can be done with a simple spreadsheet or a general stats package or stats programming environment. I've always liked Python...
In the analysis of test scores (e.g., in Education or Psychology), common analysis techniques often assume that data are normally distributed. However, perhaps more often than not, scores tend to deviate sometimes wildly from normal. I am familiar with some basic normalizing transformations, like: square roots, logarit...
Can someone provide me with a book or online reference on how to construct smoothing splines with cross-validation? I have a programming and undergraduate level mathematics background. I would also appreciate an overview of whether this is smoothing technique is a good one for smoothing data and whether there are any ...
I'm not a statistician by education, I'm a software engineer. Yet statistics comes up a lot. In fact, questions specifically about Type I and Type II error are coming up a lot in the course of my studying for the Certified Software Development Associate exam (mathematics and statistics are 10% of the exam). I'm having ...
As an outsider, it appears that there are two competing views on how one should perform statistical inference. Are the two different methods both considered valid by working statisticians? Is choosing one considered more of a philosophical question? Or is the current situation considered problematic and attempts are ...
I came across a large body of literature which advocates using Fisher's Information metric as a natural local metric in the space of probability distributions and then integrating over it to define distances and volumes. But are these "integrated" quantities actually useful for anything? I found no theoretical justific...
One estimate of the 'quality' of a portfolio of stocks is the Sharpe ratio, which is defined as the mean of the returns divided by the standard deviation of the returns (modulo adjustments for risk free rate, etc). The sample Sharpe ratio is the sample mean divided by the sample standard deviation. Up to a constant fac...
How are the values in a z-table computed? Is it possible to compute confidence without looking up a z-table?
I'm sure I've got this completely wrapped round my head, but I just can't figure it out. The t-test compares two normal distributions using the Z distribution. That's why there's an assumption of normality in the DATA. ANOVA is equivalent to linear regression with dummy variables, and uses sums of squares, just like OL...
So far, I've been using the Shapiro-Wilk statistic in order to test normality assumptions in small samples. Could you please recommend another technique?
Imagine that: You have a sample of 1000 teams each with 10 members. You measured team functioning by asking each team member how well they think their team is functioning using a reliable multi-item numeric scale. You want to describe the extent to which the measure of team effectiveness is a property of the team memb...
Say I observe two groups of 10 people, measuring some quantity 100 times in each person. There will presumably be some variability across these 100 measures in each person. Can I use mixed effects analysis to assess whether this within-person variability is, on average, different between the two groups? For example, us...
I need to fit $Y_{ij} \sim NegBin(m_{ij},k)$, i.e. a negative binomial distribution to count data. However, the data I have observed are censored - I know the value of $y_{ij}$, but it could be more than that value. The log-likelihood is \begin{equation} ll = \sum_{i=1}^n w_i (c_i \log(P(Y_{ij}=y_{ij}|X_{ij})) + (1- c...
I need to define what a test of independence is, without the use of heavily statistic terms.
X1 is wing length, X2 is tail length for 45 male and 45 female bugs. Which 2-sample univariate t-test should I use? My thought was to use Hotelling's T-square? But Hotelling's is multi-variate not univariate. Now, I'm not sure... Any ideas?
As an engineer, I'm interested in topics such as designing experiments that are statistically valid, quality control, process control, reliability, and cost control. I took a course in engineering statistics, but unfortunately neither the book nor the professor were that good. I did OK in the course, but I'm interested...
As a software engineer, I'm interested in topics such as statistical algorithms, data mining, machine learning, Bayesian networks, classification algorithms, neural networks, Markov chains, Monte Carlo methods, and random number generation. I personally haven't had the pleasure of working hands-on with any of these tec...
On page 331 of "Elements of Information Theory" (1991), author says that while entropy is related to the volume of the typical set, Fisher information is related to the surface area of the typical set, but I can't find anything more on this...can anyone explain this connection?
Duplicate thread: What R packages do you find most useful in your daily work? Are there any R packages that are just plain good to have, regardless of the type of work you are doing? If so, what are these packages? If not, what packages do you find the most useful?
Chernoff bound (for absolute error) gives a bound on probability of large deviation in terms of sample size and amount of deviation, but it doesn't seem possible to rewrite it to give an explicit bound on the amount of deviation. So, what is good way to bound the largest deviation from the mean in terms of sample size ...
The problem I’m trying to solve is “How do I figure out how much gunpowder should I put into a cartridge so that I can give myself a good probability of making the minimum power factor?” I compete in USPSA/IPSC which requires that a competitors rounds make a minimum power factor. Power Factor is computed to be the FLOO...
I am trying to solve for an efficient portfolio in R. How do I translate my constraints for a tangency point for 2 risky asset portfolio, and a given risk free rate to R solve.QP function? So basically I have the following equations: w = weight of the first risky asset R1 = mean return of the first risky asset R2 = mea...
I have weights of SNP variation (output through Eigenstrat program) for each SNP for the three main PCs. I wish to reduce my list of SNPs to those that show maximum differentiation between the three PCs. Can anyone help me with which statistical method to use to do this. say, if each PC describes the magnitude of vari...
I have collected positional data. To visualize the data, I'd like to draw a 'typical' outcome of an experiment. The data comes from a few hundred experiments, where I identify a variable number of objects at different positions relative to the origin in 2D. Thus, I can calculate the average number of objects, as well ...
For some measurements, the results of an analysis are appropriately presented on the transformed scale. In most of the cases, however, it's desirable to present the results on the original scale of measurement (otherwise your work is more or less worthless). For example, in case of log-transformed data, a problem with...
Well, I'm an engineer by day. Although most of my work revolves around modeling, we generally do pretty basic stuff. An "Advanced" model would be a monte carlo simulation validated using R2 tests. Currently, in my field, there is a lot of research using Logistic and bayesian analysis. My question is, which courses wo...
I am trying to format the output from pairwise.t.test into LaTeX, but have not found a way of doing this. Has anyone got any suggestions? EDIT: As this is a one-time only report where I do need to customize the variable names, and row-/column headings, I was hoping to avoid using Sweave.
I am regressing two butterfly richness variables (summer and winter) against a set of environmental variables separately. (variables with continuous numbers) Environmental variables are identitcal in each model. In the summer model, the weight rank of coefficients is temp > prec > ndvi. The weight rank in winter is ...
I am wondering if there are any packages for python that is capable of performing survival analysis. I have been using the survival package in R but would like to port my work to python.
I want to calculate a summary of a variable in a data.frame for each unique combination of factors in the data.frame. Should I use plyr to do this? I am ok with using loops as opposed to apply() ; so just finding out each unique combination would be enough.
I'm uncertain whether I should be able to intuit the answer to my question from a question that has already been asked but I can't, so I am asking the question anyway. Thus, I am looking for a clear easy to understand answer. A recent newspaper article reported that on average couples were able to conceive a child af...
I came across an example where standard deviation was being plotted on a Cartesian plot (standard 2D with X and Y axes.) This seems like a valid thing to do but in this case the example only had a single line running across the graph to "indicate" standard deviation. This to me seems not very useful, possibly dangerous...
I am taking the time to learn how to analyze networks and want to test if there are differences between two networks over time. Since I am new to R and networks in general, I am hoping to get some help how to compare and analyze network graphs. Simply, my dataset will contain information on flows between two geographi...
There was already a request for Mathematical Statistics Videos, but it explicitly asked from people for videos that provide a rigorous mathematical presentation of statistics. i.e., videos that might accompany a course that use a textbook mentioned in this discussion on... So at the same time I am wondering,...
Users are often tempted to break axis values to present data of different orders of magnitude on the same graph (see here). While this may be convenient it's not always the preferred way of displaying the data (can be misleading at best). What are alternative ways of displaying the data that are different in several or...
Precision is defined as: p = true positives / (true positives + false positives) Is it correct that, as true positives and false positives approach 0, the precision approaches 1? Same question for recall: r = true positives / (true positives + false negatives) I am currently implementing a statistical test where I ne...
The purpose to run regressions for butterfly richness again 5 environmental variables is to show the importance rank of the independent variables mainly by AIC. In non-full models, they reveal that variable A tends to be more influential than the others by delta AIC. However, in the full model, the regression coefficie...
(I'm a bit outside my comfort zone, so apologies if this is badly worded, or off-topic) I have a bibliographic database, containign details of about 1200 different papers, books, web sites etc, all with various details, including keywords and an abstract. I want to somehow analyse this database and produce some graphi...
Chemical analyses of environmental samples are often censored below at reporting limits or various detection/quantitation limits. The latter can vary, usually in proportion to the values of other variables. For example, a sample with a high concentration of one compound might need to be diluted for analysis, resultin...
I am fitting a GLM model (in R), and would like to get an estimation of the variability of the coefficients estimated by the model. If I understand it correctly the method to use in such a case is bootstraping (not, cross validation). Am I correct that an easy way to do this is by using the boot command from the boot p...
I'm trying to compare several methods by their performance on a set of synthetic data samples. For each method, I obtain a performance value between 0 and 1 for each of those samples. Then I plot a graph with the average performance per method The problem now is that the achievable quality per sample varies strongly be...
I was looking at this page and noticed the methods for confidence intervals for lme and lmer in R. For those who don't know R, those are functions for generating mixed effects or multi-level models. If I have fixed effects in something like a repeated measures design what would a confidence interval around the predic...