instruction
stringlengths
35
38.7k
My workplace has employees from a very wide range of disciplines, so we generate data in lots of different forms. Consequently, each team has developed its own system for storing data. Some use Access or SQL databases; some teams (to my horror) are reliant almost entirely on Excel spreadsheets. Often, data formats c...
The nonlinear model I am fitting gamma distribution with inverse or log is not converging. There is one observation having zero value in the response variable. Does this zero affects to model the data? Any answer warmly appreciated!
I know that if events $A$ and $B$ are independent, then $P(A\cap B) = P(A).P(B)$. Lets say I roll a die, and define the following events: $x$ = Number is a multiple of $3 = \lbrace 3, 6\rbrace$ $y$ = Number is more than $3 = \lbrace 4, 5, 6\rbrace$ $z$ = Number is even = $\lbrace 2, 4, 6 \rbrace$ Therefore, $P(x) * P...
What statistical test can I use to compare two ratios from two independent samples. The ratios are after to before results. I need to compare the after/before ratios for two independent models and show whether they are have significant difference or not. Please help!
I have data from patients treated with 2 different kinds of treatments during surgery. I need to analyze its effect on heart rate. The heart rate measurement is taken every 15 minutes. Given that the surgery length can be different for each patient, each patient can have between 7 and 10 heart rate measurements. So ...
This question is related to my previous question. I would like to put values over bars in barplot. I am beginner in plotting in R.
Three unbiased estimators of standard deviation have been presented in the literature for m samples of size n. The first one is based on the sample ranges and can be obtained by $\hat \sigma_1 = \frac{\bar R}{d_2}$ The second one is based on sample standard deviations and can be calculated by $\hat \sigma_2 = \frac{\ba...
I have a series of boxplots that i am generating with ggplot2. I want to control the order in which they are displayed. Is there a way to control this order? I have two genotypes and i want them displayed as WT then KO rather than the reverse (which is what i am getting as a default). My code right now is: p <- qpl...
I would like to use the fuction weighted.median() in package R.basic (and some other ones too, although this one is most important). install.packages("R.basic") gives me: package ‘R.basic’ is not available and library(R.basic) says Error in library("R.basic") : there is no package called 'R.basic' There is a do...
Why does OLS estimation involve taking vertical deviations of the points to the line rather than horizontal distances?
In all contexts I am familiar with cross-validation it is solely used with the goal of increasing predictive accuracy. Can the logic of cross validation be extended in estimating the unbiased relationships between variables? While this paper by Richard Berk demonstrates the use of a hold out sample for parameter selec...
I was wondering whether it's me mis-remembering something or is there a dimensionless measure of dispersion calculated as: range/(mean or median). Where range is a difference between max and min values. P.S. Could this be called "relative range"?
I am working with a given factor model of the form $$y=B x +\epsilon$$ where $x$ is a random vector in $R^M$, $B$ is an $N\times M$ matrix of factor loadings, $y$ is a random vector in $R^N$ (with $N \gg M$) and $\epsilon$ is a vector of mean-zero innovations, independent of $x$. For simplicity, the innovations are no...
Does 'corr' function in Matlab consider correction for tied ranks while calculating Spearman correlation coefficient? Thanks.
We have prospective data from an observational registry and wish to consider the affects of a gene on time to cardiovascular events. The data includes standard data like age, gender, ... and also the date(age) of a cardio event. In general terms what are the conditions/assumptions/requirements of a starting time for su...
If I understand correctly a confidence interval of a parameter is an interval constructed by a method which yields intervals containing the true value for a specified proportion of samples. So the 'confidence' is about the method rather than the interval I compute from a particular sample. As a user of statistics I ha...
I am trying to assess a 20-item multliple choice test. I want to perform an item analysis such as can be found in this example. So for each question I want the P-value and the correlation with the total, and the distribution of the options selected. I don't know anything about the various statistical software packa...
What are good ways to visualize set of Likert responses? For example, a set of items inquiring about the importance of X to one's decisions about A, B, C, D, E, F & G? Is there something better than stacked bar charts? What should be done with responses of N/A? How might they be represented? Should the bar charts repo...
Sorry if this is a very basic question, my statistics knowledge is very low! I've got a dataset which is basically a set of greyscale values in a greyscale texture (ie. 0-255). What I want to do is take the mean value, and find out what the values would be at a specified standard-deviation to the left and right of the ...
I'm looking at two plant categories (all species fall into one type or the other) at several different types of locations. Within each type of location, I have several samples, so I have an average of each type of plant as it is found in each type of location. Within each type of location, I want to compare the average...
I have developmental data collected across several grades (1-6), where each child in each grade is measured many times. I would like to be able to assess whether there are any linear or non-linear trends in the response variable across grade. Does it make sense to run a first lmer treating grade as continuous, obtain t...
Most standard distributions in R have a family of commands - pdf/pmf, cdf/cmf, quantile, random deviates (for example- dnorm, pnorm, qnorm, rnorm). I know it's easy enough to make use of some standard commands to reproduce these functions for the discrete uniform distributions, but is there already a preferred built-in...
I was asked today in class why you divide the sum of square error by $n-1$ instead of with $n$, when calculating the standard deviation. I said I am not going to answer it in class (since I didn't wanna go into unbiased estimators), but later I wondered - is there an intuitive explanation for this?!
In which cases should one prefer the one over the other? I found someone who claims an advantage for Kendall, for pedagogical reasons, are there other reasons?
Reading about methods and results of statistical analysis, especially in epidemiology, I very often hear about adjustment or controlling of the models. How would you explain, to a non-statistician, the purpose of that? How do you interpret your results after controlling for certain variable? Small walk-through in Stata...
I understand the basics of what a Support Vector Machines' aim is in terms of classifying an input set into several different classes, but what I don't understand is some of the nitty-gritty details. For starters, I'm a bit confused by the use of Slack Variables. What is their purpose? I'm doing a classification proble...
I am currently working with feature-vectors that are made up of continuous attributes, so I can use the euclidean distance for things like KNN-classification and clustering. Now I want to add a nominal attribute that has a special distance function defined. What options do I have of combining these distance functions, ...
Context: I have a group of websites where I record the number of visits on a daily basis: W0 = { 30, 34, 28, 30, 16, 13, 8, 4, 0, 5, 2, 2, 1, 2, .. } W1 = { 1, 3, 21, 12, 10, 20, 15, 43, 22, 25, .. } W2 = { 0, 0, 4, 2, 2, 5, 3, 30, 50, 30, 30, 25, 40, .. } ... Wn General Question: How do I determine which sites ar...
Possible Duplicate: What are some valuable Statistical Analysis open source projects? I understand the basics of statistical analysis, but I am not good at math. What is the best website or software package (preferably FOSS) that can analysize the data, find correlations, levels of confidence, etc. automagically/wi...
Suppose you have an $n$-vector $X$. For a fixed real number, $r$ between $-1$ and $1$, can one generate a random permutation of the integers $1,2,\ldots,n$, call it $i_1,i_2,\ldots,i_n$ such that the vector $X$ and the vector $\tilde{X}$ defined by $\tilde{X_j} = X_{i_j}$ have expected sample correlation of $r$? I am ...
Below is part of the proof of large deviations result. K is cumulant generating function. Can anyone explain how the last step follows? This is page 157 of McCullagh's "Tensor Methods in Statistics"
i am working with a set of distributions. I have so far analyzed several probability distributions with respect to each other, that means i have made a t-test, to see how probable it is that two events happen at the same time according to those distributions. That means i have computed: let x1 and x2 be probability dis...
I'm a pharmacologist and, in my experience, almost all papers in basic biomedical research use Student's t-test (either to support inference or to conform to expectations...). A couple of years ago it came to my attention that Student's t-test is not the most efficient test that might be used: sequential tests offer mu...
I have (trivariate: multivariate with three variables) data that appears to be good empirical and reasonable theoretical fit for a (univariate) convolution of an exponential and a normal distribution (some times called exp-norm or exGauss distributions). My data are samples from the joint distribution: J(R,G,B) It a...
M or MM? I prefer "M" -- it's shorter, but someone here was pushing for "MM".
I have some data corresponding to changes in a binomial variable - i.e, in month 1 there were n1 trials and k1 successes, and in month 2 there were n2 trials and k2 successes. Say I have M of these cases, and in between month 1 and month 2 there were performed a number of different operations (so for case 1 we might h...
var w = 810, h = 400, mapMargin = 30; geo = pv.Geo.scale().range(w, h); var vis = new pv.Panel() .width(w) .height(h) .top(50) .bottom(30) .def("i", -1); var dot = vis.add(pv.Dot) .data(geoPopList) .left(function(d) {return geo(d.center).x}) .top(function(d) {return geo(d.cen...
I am running a logistic model. The actual model dataset has more than 100 variables but I am choosing a test data set in which there are around 25 variables. Before that I also made a dataset which had 8-9 variables. I am being told that AIC and SC values can be used to compare the model. I observed that the model had ...
Let $Q_n = C_n.\{|X_i-X_j|;i < j\}_{(k)}$ so for a very short sample like $\{1,3,6,2,7,5\}$ it can be calculated from finding the $k$th order static of pairwise differences: 7 6 5 3 2 1 1 6 5 4 2 1 2 5 4 3 1 3 4 3 2 5 2 1 6 1 7 h=[n/2]+1=4 k=h(h-1)/2=8 Thus $Q_n=C_n. 2$ Obviously for large samples sayi...
I have a dataset with a very simple logfile-like structure, I want to subset the data according to date ranges but can only do on one parameter. my data looks like this: date_time loc_id node energy kgco2 1 2009-02-27 00:11:08 87 103 0.00000 0.00000 2 2009-02-27 01:05:05 87 103 7.00000 3.7590...
I have 5 categories, each category is divided into the subcategories low, medium and high. An object can belong to one or more of these categories with a number between 1 and 100 in each subcategory but the sum for each category can no exceed 100. Is there are a way to summarise this into one single number? Any hints o...
Does anyone know of a step-by-step guide for the practical implementation of Gifi Methods for Optimal Scaling in R: The Package homals? Although I have an OK theoretical understanding (thanks chl for directing me to articles), I'm a tech novice and some of the language/technical information is a bit too complicated for...
I am trying work out the variance of the population estimate var (R) where R = X/Y (X = sum(x) and Y = sum(y)). For each member of the population I know y and I have stratified the population and taken a random sample of each strata. For each member of the sample I need to estimate x. x is not known with certainty a...
Initial Question: I am trying to calculate inter-rater reliability. Previous researchers in this area have used intraclass correlation. SPSS has options for two-way random, mixed random and one-way random models. SPSS help says choose the right one based on whether the 'people effects are random' and 'item effects are ...
I am now having a sequence of numbers, e.g. $x_1, x_2,\dots , x_N$, ($0\leq x_i\leq 1$), which may represent the correlation between a couple of measurements. I want to set a threshold for this sequence, that for $x_i$ which are greater than the threshold may have a significant difference with $x_j$ which are smaller t...
I've read through this thread, and it looks to me like it can be said that: statistics = induction ? probability = deduction ? But I am wondering if there might be some more details on the comparison that I am missing. For example, is statistics equal to induction, or is it just a particular case of it? It does see...
I would like to learn to use Rcpp. I went through the docs on the package's CRAN website, but i feel working on a practical example (second practical, considering convolve3) would be more helpfull . I propose the following code, from the the robustbase package because it's neither too long nor too short, uses a combin...
Let us consider a comparison of two machine learning algorithms (A and B) on some dataset. Results (root mean squared error) of both algorithms depend on randomly generated initial approximation (parameters). Questions: When I use the same parameters for both algorithms, "usually" A slightly outperforms B. How many di...
I am comparing two groups of mutants each of which can have only one out of 21 different phenotypes. I would like to see whether distribution of these outcomes is similar between two groups. I found an online test that calculates the "Chi-square test for equality of distributions" and gives me some plausible results....
I am using the naivebayes function of the e1071 library. Some example commands are: model = naiveBayes(Species ~ ., data = iris) pred = predict(model, iris[,]) My question is: how can I obtain the maximum likelihood estimate for the conditional probability distribution of this model?
I want to extend the standard VECM form: Δx[t] = δ0 + ... + Π x[t-1] + Φ1 Δx[t-1] + Φ1 Δx[t-2] + ... + ε to include exogenous variables (i.e. variables that are participant in describing the relationships amongst Δx[t], but are not in the dependent set Δx[t]). Let's call these new variables z. Would like to determi...
This may be a naive question, but here goes. If I have a set of empirical data and fit a kernel density to it, and then obtain a new single value which possibly comes from the same process which generated the original data set, can I assign a probability that this new value belongs to the set/process by simply reading ...
In R, I have a data frame comprising a class label C (a factor) and two measurements, M1 and M2. How do I compute the correlation between M1 and M2 within each class? Ideally, I'd get back a data frame with one row for each class and two columns: the class label C and the correlation.
I have a few time series that were (for technical reasons) acquired with slightly different time intervals, ranging between 19 and 21 seconds. Now, I would like to average the values of these different time series over time, so I thought that I could do some sort of interpolation of the values at some regular interval ...
I'm looking for some good terminology to describe what I'm trying to do, to make it easier to look for resources. So, say I have two clusters of points A and B, each associated to two values, X and Y, and I want to measure the "distance" between A and B - i.e. how likely is it that they were sampled from the same distr...
Is the power of a logistic regression and a t-test equivalent? If so, they should be "data density equivalent" by which I mean that the same number of underlying observations yields the same power given a fixed alpha of .05. Consider two cases: [The parametric t-test]: 30 draws from a binomial observation are made a...
I am analyzing social networks (not virtual) and I am observing the connections between people. If a person would choose another person to connect with randomly, the number of connections within a group of people would be distributed normally - at least according to the book I am currently reading. How can we know the ...
One of the assumption of logistic regression is the linearity in the logit. So once I got my model up and running I test for nonlinearity using Box-Tidwell test. One of my continuous predictors (X) has tested positive for nonlinearity. What am I suppose to do next? As this is a violation of the assumptions shall I get...
I'm referring to something like this: suggested dataset for showing a solutions: data(mtcars) plot(hclust(dist(mtcars)))
Hello fellow number crunchers I want to generate n random scores (together with a class label) as if they had been produced by a binary classification model. In detail, the following properties are required: every score is between 0 and 1 every score is associated with a binary label with values "0" or "1" (latter is ...
I was horrified to find recently that Matlab returns $0$ for the sample variance of a scalar input: >> var(randn(1),0) %the '0' here tells var to give sample variance ans = 0 >> var(randn(1),1) %the '1' here tells var to give population variance ans = 0 Somehow, the sample variance is not dividing by $0 ...
I'd like to make an assertion about whether individuals in my dataset exceed legal standards for commitment, which is largely determined by estimated risk of recidivism. I have estimated a logit model predicting recidivism. Here is sample code written trying to determine what percentage of individuals had predicted r...
I have two populations, One with N=38,704 (number of observations) and other with N=1,313,662. These data sets have ~25 variables, all continuous. I took mean of each in each data set and computed the test statistic using the formula t=mean difference/std error The problem is of the degree of freedom. By formula of d...
I asked this question at Mathoverflow but they recommend me to ask here. I need to find factored joint distribution of Tree Augmented Naive Bayes algorithm. I read the paper but I couldn't figure out the answer. Any help or pointers appreciated.
I had been using the term "Heywood Case" somewhat informally to refer to situations where an online, 'finite response' iteratively updated estimate of the variance became negative due to numerical precision issues. (I am using a variant of Welford's method to add data and to remove older data.) I was under the impress...
I've got a large set of data (20,000 data points), from which I want to take repeated samples of 10 data points. However, once I've picked those 10 data points, I want them to not be picked again. I've tried using the sample function, but it doesn't seem to have an option to sample without replacement over multiple cal...
I am not that familiar with the analysis of time series data. However, I have what I think is a simple prediction task to address. I have about five years of data from a common generating process. Each year represents a monotonically increasing function with a non-linear component. I have counts for each week over a...
I'm sure I've come across a function like this in an R package before, but after extensive Googling I can't seem to find it anywhere. The function I'm thinking of produced a graphical summary for a variable given to it, producing output with some graphs (a histogram and perhaps a box and whisker plot) and some text giv...
Can anyone help me in interpreting PCA scores? My data come from a questionnaire on attitudes toward bears. According to the loadings, I have interpreted one of my principal components as "fear of bears". Would the scores of that principal component be related to how each respondent measures up to that principal compon...
I am currently assessing multicollinearity in my datasets. What threshold values of VIF and condition index below/above suggest a problem? VIF: I have heard that VIF $\geq 10$ is a problem. After removing two problem variables, VIF is $\leq 3.96$ for each variable. Do the variables need more treatment or does this VIF...
I would like to do an intervention analysis to quantify the results of a policy decision on the sales of alcohol over time. I am fairly new to time series analysis, however, so I have some beginners questions. An examination of the literature reveals that other researchers have used ARIMA to model the time-series sale...
I would like to use data mining to try to find a good workout schemes. The input dataset will contain the parameters of a set of workouts with dates and different performance and medical measures. The problem is that the influence of each individual workout will be different depending on the time that has passed after ...
A student asked me today, "How do they know how many people attended a large group event, for example, the Stewart/Colbert 'Rally to Restore Sanity' in Washington D.C.?" News outlets report estimates in the tens of thousands, but what methods are used to get those estimates, and how reliable are they? One article appa...
I've been reading some about Generalized Least Squares (GLS) and trying to tie it back to my basic econometric background. I recall in grad school using Seemingly Unrelated Regression (SUR) which seems somewhat similar to GLS. One paper I stumbled on even referred to SUR as "special case" of GLS. But I still can't wrap...
I'm working with a dataset for which I only have means, standard deviations, and sample sizes for different levels of a continuous predictor. E.G. Y X SD_Y N_Y 5 1 3 4 10 2 6 2 15 3 2 8 I would like to determine the regression line that fits this data. I'm wracking my brains to remember how data points...
If X and Y are standardized variables and are perfectly positively correlated with respect to each other, how can i prove that $E[(X-Y)^2] = 0$?
How do you show that the point of averages (x,y) lies on the estimated regression line?
CONTEXT: I am modelling the relation between time (1 to 30) and a DV for a set of 60 participants. Each participant has their own time series. For each participant I am examining the fit of 5 different theoretically plausible functions within a nonlinear regression framework. One function has one parameter; three func...
Given a $n$-dimensional multivariate normal distribution $X=(x_i) \sim \mathcal{N}(\mu, \Sigma)$ with mean $\mu$ and covariance matrix $\Sigma$, what is the probability that $\forall j\in {1,\ldots,n}:x_1 \geq x_j$?
I feel I'm pretty new to this, since some time passed since my last statistics assignment, so please bear with me. I am analyzing results of a biological experiment. Basically, I'm looking at a some graph over a genome, where each position in the genome has a value, and I'm looking for local minima (peaks). Now, I hav...
I have two statistical tests which are inverse of each other, meaning that the null hypothesis are reversed. I want to use both the tests to take a decision. For this purpose, I am planning to do the following: If both the tests point to same result (by, say, rejecting the null hypothesis in test A and not rejecting t...
When developing a general purpose time-series software, is it a good idea to make it scale invariant? How would one do that? I took a time series of around 40 points, and then multiplied by factors ranging from 10E-9 to 10E3 and then ran through the ARIMA functions of Forecast Pro and Minitab. In Forecast Pro, all resu...
I have about 1000 data points from some thick tailed distribution that I would like to fit a parametrized distribution to. From my data, I've made some adjustments and constructed an empirical distribution (so I have percentiles). What is the best way to fit a mixture of parametrized distribution functions (pareto, lo...
I've been learning X12-ARIMA by looking at data from a friend's service company, and wondering how to model the capacity of the company. That is, if the company is limited by a particular resource to only be able to handle 1,000 customers a week, how do I keep my ARIMA model from happily predicting 1,200 customers next...
I've really only seen EM used for mixtures where one can point out multiple modes visually - e.g, the classic mixture of gaussians example. I would like to use EM for a mixture of an empirically defined, sharply peaked distribution and something that is more uniform - does anyone have an idea as to how much confidence...
I wish to decide if I should take a course called "INTRODUCTION TO STOCHASTIC PROCESSES" which will be held next semester in my University. I asked the lecturer how studying such a course would help me as a statistician, he said that since he comes from probability, he knows very little of statistics and doesn't know h...
I am new to the area of statistics and I am hoping you can suggest methods I may use. Sorry if this is long but I might as well be as clear as possible on my first post :) What I am worried most is that I may miss out on assumptions and draw conclusions based on statistical tests that, in fact, cannot be applied to my ...
At work we have a hardware device that is failing for some yet to be determined reason. I have been tasked to see if I can make this device not fail by making changes to its software driver. I have constructed a software test bench which iterates over the driver functions which I feel are most likely to cause the devic...
I am trying to understand how I can use resampling techniques to compliment my pre-planned analyses. This is not homework. I have a 5 sided die. 30 subjects call a number (1-5) and then roll the die. If it matches it's a hit, if not it's a miss. Each subject does this 25 times. N is the the number of trials (=25) and ...
[Cross post from here, figured this community may be more relevant] I am working in the field of machine learning, and I have come across a few papers that show relationships between Gröbner bases and discrete probability. So I come here for help. Can you please explain how can Gröbner bases used to describe discrete p...
Here is a link that describes the formula to find the mode of grouped data. Here is a link that gives a graphical method to finding the mode of grouped data. Question: Can someone please explain how the formula corresponds with the graphical method? The formula is an interpolation but I am not able to see how it expres...
Hello I have two problems that sound like natural candidates for multilevel/mixed models, which I have never used. The simpler, and one that I hope to try as an introduction, is as follows: The data looks like many rows of the form x y innergroup outergroup where x is a numeric covariate upon which I want to regress ...
MCMC algorithms like Metropolis-Hastings and Gibbs sampling are ways of sampling from the joint posterior distributions. I think I understand and can implement metropolis-hasting pretty easily--you simply choose starting points somehow, and 'walk the parameter space' randomly, guided by the posterior density and prop...
Most asymptotic results in statistics prove that as $n \rightarrow \infty$ an estimator (such as the MLE) converges to a normal distribution based on a second-order taylor expansion of the likelihood function. I believe there's a similar result in Bayesian literature, the "Bayesian Central Limit Theorem", which shows t...
I have a time series $X(t)$. Each $X(t)$ has three possible outcomes: A, B or C. I am interested in the ratio of A, B and C to the total. Assuming $N$ is the number of data points I have gathered for $X(t)$, How can I compute the confidence levels for A/N, B/N and C/N when the $X(t)$ are "intuitively" not independent ?...
I have a large number (hundreds to thousands) of noisy time series that represent contemporaneous observations from different subjects. I hypothesise that there exist lead-lag relationships between observations for different subjects (or groups of subjects.) I would like to explore the potential use of such lead-lag re...
Suppose I have a set of $N$ experimental points of the form \begin{equation} \{x_i, y_i, d_i\}, \end{equation} where $i=1,...,N,$ and $d_i$ are errorbars for $y_i$. To fit the data, I minimize the reduced chi-square \begin{equation} \chi^2(p) = \sum_{i=1}^N \frac{[y_i - f(x_i,p)]^2}{d_i^2}, \end{equation} where $f(x,p...
I have a data like this: > table(A,B,C) , , C = FALSE B A FALSE TRUE FALSE 177 42 TRUE 6 8 , , C = TRUE B A FALSE TRUE FALSE 5 31 TRUE 4 10 How can I plot this on a single graph, possibly without imposing any hierarchy?
On both a practical and philosophical level, how should you choose the scope when performing multiple comparisons? When a study performs 10 tests to check the hypothesis that 10 explanatory variable are predictive for "something" (on the same dataset), the test should obviously be corrected. What if there where ten stu...
I'm using McNemar's test. Basically this question is about best practices when reporting results using McNemar's test. I want to report the effect size. What is a sensible effect size for McNemar's test? I've seen the odds ratio b/c and the proportions b/(b+c) and c/(b+c) both used in papers. If I say what b and c are ...