instruction
stringlengths
9
38.7k
I've got a problem choosing the right model. I have a model with various variables (covariables and dummy variables). I was trying to find the best size for this model, so I first started by comparing different models with AIC. From this it followed, that the minimum AIC was reached when allowing all variables to stay ...
Let's say that N randomly chosen persons where asked a question where the answer could be in either of X categories. For example, 500 persons where asked which of the top 5 political parties they support the most. Each person can give only one answer. How do I determine if the leading party which, for example, got 33 %...
Let $T_1, T_2, \dots$ be iid sequence of exponential random variables with parameter $\lambda$. The sum $S_n = T_1 + T_2 + \dots + T_n$ is a Gamma distribution. Now as I understand the Poisson distribution is defined by $N_t$ as follows: $$N_t = \max\{k: S_k \le t\}$$ How do I formally show that $N_t$ is a Poisson rand...
I am having trouble determining what kernel I should use in a non-linear SVM without testing in advance. I want to know if there are any other ways to determine the best kernel without tests? How does it relate to the data?
In G power 3, ANOVA repeated measures within-between interaction: Only the total sample size is reported assuming equal sample size for the two groups. My questions are: How would it work if the sample sizes are slightly different, for example: N1/ N2 = 1.16. I have to input correlation between repeated measures. Is...
I'm working with dataset of individual households that I aggregate into 'areas' using several different spatial configurations, from smaller to bigger. These areas are then characterized by four variables (two categorical, two continuous). I'd like to see what effects these different aggregations have on the dataset. P...
names(mydat)[c(name)]<-c("newname") From this, I know that the column/variable name "name" of the data frame mydat is replaced with "newname". My question is if, I want to do this by a loop so that I will have some thing like: newname1 newname2 newname3 newname4 and so on, how do I do it? This is what did and it did...
I have a large distance matrix $3400\times 3400$. I need to cluster them hierarchically and then cut the tree into clusters (like a partitional approach). Which algorithm is most sensitive to finding natural clusters in the data based on the distance matrix? How can I evaluate the result? I am planning on using averag...
I ran a multivariate logistic regression with glm in R with some continuous and some categorical variables. Only continuous variable $A$ showed a p-value of < 0.05 and a confidence interval which did not stradle 1. Running a Wilcoxon test (actually a Mann-Whitney test because the samples are not paired) with $A$ divi...
I am currently looking at a cheminformatics problem where I am looking at the relationship between chemical structure and reactivity, e.g. how the angle at which two molecules approach each other affects the rate of the subsequent reaction. Obviously, the angle can only vary between 0° and 360°. This is "quick check" q...
I have two independent poisson random variables, $X_1$ and $X_2$, with $X_1 \sim \text{Pois}(\lambda_1)$ and $X_2 \sim \text{Pois}(\lambda_2)$. I want to test $H_0:\, \lambda_1 = \lambda_2$ versus the alternative $H_1:\, \lambda_1 \neq \lambda_2$. I already derived maximum likelihood estimates under null and alternate ...
I am not comfortable with Fisher information, what it measures and how is it helpful. Also it's relationship with the Cramer-Rao bound is not apparent to me. Can someone please give an intuitive explanation of these concepts?
I have 4 groups each consisting of 1000 recent college graduates, and I am studying employment immediately after graduation. 2 groups took a business class in college, and 2 groups took a math course in college. Group 1 is a control that has taken neither a business class nor a math course in college. I want to conduct...
I lack knowledge of statistical terminology, so I'll try to thoroughly explain my predicament and hope that it is understandable: I am programming a software for technical analysis of financial markets. This software will receive a variable who's value represents current market conditions. In this particular case the v...
The Anscombe transform is $a(x) = 2\sqrt{x+3/8}$. Can anyone show me how to prove that an Anscombe-transformed version $Y = a(X)$ of a Poisson distributed random variable $X$ is approximately normal distributed (when $\lambda>4$)?
Given a data matrix $X$ of say 1000000 observations $\times$ 100 features, is there a fast way to build a tridiagonal approximation $A \approx cov(X)$ ? Then one could factor $A = L L^T$, $L$ all 0 except $L_{i\ i-1}$ and $L_{i i}$, and do fast decorrelation (whitening) by solving $L x = x_{white}$. (By "fast" I mean ...
I have 500,000 values for a variable derived from financial markets. This variable has a arbitrary distribution. I need a formula that will allow me to select a range around any value of this variable such that an equal (or close to it) amount of values fall within that range. From what I understand, this means that I ...
Is there a reasonable way to quantify the amount of local correlations in an image? For example, I want to justify the correlations between a neighbourhood of pixels is much higher than the correlations between pixels in entirely different regions of the image. Would showing the xcorr2(A,A) as the 2-d autocorrelation ...
Various forms of the correlation, e.g., $r = \frac{\Sigma_i x_i * y_i}{\sigma_x \sigma_y}$ or $r = \frac{\Sigma_i (x_i-\bar{x}) * (y_i-\bar{y})}{\sigma_x \sigma_y}$ are popular similarity measures in many applications. Is there a probabilistic interpretation for this such that either $r$ or $r^2$ is an approximate l...
I have a design where birds of 1, 3, 5 week of age are placed in 2 chambers(independent) with 4 treatments( light technology) for 4 days. for example, x no of birds of 1 weeks of age are kept for 4 days and then new birds of 3 week age are placed in both chambers and so on...readings are taken for their position, feed ...
I have a very basic question on when a discrete distribution might be called a symmetric distribution. Let say I have a r.v. $X$ that can take two possible values $(x1, x2)$ with $x1 \neq x2$ and corresponding probabilities $(0.4, 0.6)$. Then can I say that $X$ is symmetric? Thanks,
I'm trying to forecast using ARIMAX with two exogenous (input) variables. I'm using PROC ARIMA, but I can't figure out from the SAS documentation whether my code is producing the parameterization I want. I want to extend an ARI(12,1) model so that it also includes the last 12 terms of each of the two exogenous variable...
I am running a logistic model. In SAS Entreprise Miner, I noticed there's a link function that has three possible options: logit, probit and cll (complementary log-log). Can you please shed light on the following questions: Can we use any of these link function to carry out a logistic regression? Are there situations ...
I have a question concerning feature selection and classification. I will be working with R. I should start by saying that I am not very familiar with data mining techniques, aside from a brief glimpse provided by an undergraduate course on multivariate analysis, so forgive me if I am lacking in details regarding my qu...
Recently, I have found in a paper by Klammer, et al. a statement that p-values should be uniformly distributed. I believe the authors, but cannot understand why it is so. Klammer, A. A., Park, C. Y., and Stafford Noble, W. (2009) Statistical Calibration of the SEQUEST XCorr Function. Journal of Proteome Research. 8(4)...
I'd be too happy, if someone could post a code snippet, which explains how to compute mean and variance of a set of records, which contain frequencies? Suppose we have records like (FORMAT F) - GroupA, 6 x Grade 1, 5 x Grade 2, 10 x Grade 3 - GroupB, 2 x Grade 1, 7 x Grade 2, 18 x Grade 3 - GroupA, 23 x Grade 1, 5 x Gr...
I am using Matlab to try and find a good fit for this curve: None of the built-in formulas seem to work well. Any suggestions?
I'm interested in fitting a conditional Poisson regression model using PROC GENMOD in SAS to analyze a matched cohort study. However, it's not quite clear to me how I should exactly go about it. My impression is that a REPEATED statement should be used along with the events/trials syntax, but if so then how does one a...
If I have a sample of k successes and n-k failures, there are standard techniques (Agresti-Coull, Clopper, etc.) for finding a confidence interval of the probability of an individual success. What if I want to find a confidence interval for the probability of getting at least k' out of n' instead? Obviously it can be...
I have a data set with a distribution of one variable against the other resembling a cubic one (rises to some point and then falls to a steady level without a consequent rise). I know in which cases to use log-linear, log-lin, lin-log, and reciprocal or log reciprocal linear models, but I am not sure what to do here (I...
According to Wikipedia, Wilks' Lambda distribution generalizes Hotelling's distribution. I am having some problems seeing how this works. I can see how Hotelling's distribution generalizes Student's t-distribution (a RV distributed as Hotelling's law with $p=1$ is just the square of a RV distribution as Student's t), b...
I'm trying to design an experiment where I measure a variable as a function of 5 two-level factors, labelled A, B, C, D and E. I'm trying to understand how to best design this experiment so I can conduct it in 8 runs. I've tried to follow the guidance given in Box, Hunter & Hunter, and found two experimental $2^{5-2}$ ...
I'm measuring distances of various samples from a reference point. The distance is defined as a non-negative number, where $d=0$ means that the test case is identical to the reference. My general question is: Given a set of "typical" distances, what is the proper way to tell whether a given $d_1$ "too large", compare...
In PCA eigenvalues determine the order of components. In ICA I am using kurtosis to obtain the ordering. What are some accepted methods to assess the number, (given I have the order) of components that are singificant apart from prior knowledge about the signal?
How can one obtain confidence limits of predicted values in ARIMA?
I have a scatter plot of (for example) height against age. How does one calculate for an individual point the percentile of the height for a given age? Suggestions in R would be most appreciated. Thanks!
i just wanted to know if i could use factor scores and crosstab it with demographics (i.e. gender, age, etc.)? I have 69 likert-scale variables and run factor analysis on SPSS. It gave me 10 new variables (types of personality. i just wanted to see the demographics of each new variables. Thanks!!!
In relation to web usage mining from a log file, can you cluster data without performing User and/or Session identification? I mean,let's say I have these entries: 123.234.324.122 [timestamp] "GET /cars/sport/porsche.jpg" 200 23432 "http://topgear.com/cars" "Mozilladsfsd" 120.23.324.122 [timestamp] "GET /bikes/sport/r...
I'm working with a lot of data that was collected by obstetricians regarding the health of infants (birth weight, gestational age at delivery, mother's BMI), and I am trying to connect this data with geometric measurements performed on microscopic slide scans for each associated placenta (area, perimeter, number of blo...
I am trying to analyse a group of 4 questions that are on a 5 point scale. I need to group the answers for each question based on age. There are three different ages. How would I go about doing this?
I have to assess for each product p, the odds ratio associated (success/failure). The data are in this table: N_success N_trials p1 p2 p3 p4 p5 5 310 n n n n n 17 700 n y n n y 12 650 y y y n n 27 214 ...
I am running a model for which I am getting a very bad percentage detection of events in the confusion matrix (basically my true positives). Obviously that implies my false negatives are too hight. When I gave these dataset to a neural network node or a decision tree node, I see that the percentage detection by these...
I've read about a number of algorithms for solving n-armed bandit problems like $\epsilon$-greedy, softmax, and UCB1, but I'm having some trouble sorting through what approach is best for minimizing regret. Is there a known optimal algorithm for solving the n-armed bandit problem? Is there a choice of algorithm that se...
I have a two-dimensional data set that looks like $(t, x)$ where $t$ is a time in seconds when event $X$ happened. $X$ ranges from $[0, 200]$. I want to visualize the frequency of each $x$ at time $t$ over some time period. I guess this would be a bar graph with $x$-axis being event #, $y$-axis being frequency, and $z...
Lets say I have a highly dimensional classification problem with a lot of noise, and I want to improve my results by removing some of the noisy variables. I've read several papers on using SVMs for feature selection, but I'm at a loss as to how to implement this in R. Are there pre-existing packages that do this, or ...
This is sort of an open ended question but I wanna be clear. Given a sufficient population you might be able to learn something (this is the open part) but whatever you learn about your population, when is it ever applicable to a member of the population? From what I understand of statistics it's never applicable to a ...
I know correlation does not imply causation but instead the strength and direction of the relationship. Does simple linear regression imply causation? Or is an inferential (t-test, etc.) statistical test required for that?
Scenario: An industrial/organizational psychologist is interested in determining whether adding 15-minute breaks increases worker productivity. She selects a sample $n$ and measures productivity (on a continuous scale) before and after introducing the intervention. The researcher runs a repeated measures t-test. Questi...
I'm studying R package dlm. So far it seems very powerful and flexible package, with nice programming interfaces and good documentation. I've been able to successfully use dlmMLE and dlmModARMA to estimate the parameters of AR(1) process: u <- arima.sim(list(ar = 0.3), 100) fit <- dlmMLE(u, parm = c(0.5, sd(u)), ...
Does anyone know of an existing implementation of ordinal logistic regression in Excel?
I have a question regarding the interpretation of resulting p-values of a two sample Kolmogorov Smirnov test. Basis of my analysis is to try to identify groups that show a difference in their distribution difference compared to totality. I used a two sample Kologorov Smirnov Test in R to do so. Sample sizes: Full = 24...
I've implemented QR factorization based on Householder reflections (for the purposes of computing the OLS fit). Mathematically, the $R$ matrix is upper triangular. However, due to floating-point issues I typically end up with small non-zero entries below the diagonal. What should I do with them - leave alone or set to ...
Stack Exchange, as we all know it, is a collection of Q&A sites with diversified topics. Assuming that each site is independent from each other, given the stats a user has, how to compute his "well-roundedness" as compared to the next guy? What is the statistical tool I should employ? To be honest, I don't quite know h...
I'm just reading the book "R in a Nutshell". And it seems as if I skipped the part where the "." as in "sample.formula" was explained. > sample.formula <- as.formula(y~x1+x2) Is sample an object with a field formula as in other languages? And if so, how can I find out, what other fields/functions this object has? (Ty...
Where can I find details of Steel's method for nonparametric multiple comparison with control on line?
Is there a standard name for a multinomial choice model where the observations are in the form of binary questions such as "do you prefer A to B" and "do you prefer B to D"? This seems like a common occurrence, and the likelihood is easy enough to write out by hand, but I'm having trouble searching for references.
I am running a dlog-dlog (difference of logarithm*) regression and I want to convert the coefficients into marginal effects. I know that it's different from a log-log regression, in which the coefficients directly give us the elasticities. How can we interpret the coefficients from a dlog-dlog regression? * For examp...
I thought heavy tail = fat tail, but some articles I read gave me a sense that they aren't. One of them says: heavy tail means the distribution have infinite jth moment for some integer j. Additionally all the dfs in the pot-domain of attraction of a Pareto df are heavy-tailed. If the density has a high central peak a...
I want to get a confidence interval of a function of some parameters. for example, from the data I estimate parameters of Pareto. Now I want to get 95% CI for 90th quantile (it's a function of parameters of Pareto), so I would need standard error. I know delta method is one option. For simulation method, I am wonderin...
Given N sampled values, what does the "p-th quantile of the sampled values" mean?
I am not so experienced to design a customized covariance matrix / kernel functions. I would like to get such a understanding that after looking at data, I can figure out the covariance matrix. For example, in my case, I have a data set, $X$ that contains many zeros and couple of points far from them, close to hundred....
In gene expression studies using microarrays, intensity data has to be normalized so that intensities can be compared between individuals, between genes. Conceptually, and algorithmically, how does "quantile normalization" work, and how would you explain this to a non-statistician?
All, I'm working on a project looking at cross-national public opinion across two different observational "waves". Many countries were surveyed in both waves, though some were surveyed in the first wave and not the other (and vice-versa). With predictors at both the level of the individual and the level of the countr...
I have a time series. I want to model it using ARMA, which will be used for forcasting. In R I am using arima() function to get the coefficients. But arima() requires order(p,d,q) as input. What is the simplest way in R to arrive at a good value for p and q (with d = 0) so that I don't overfit?
I have two cases: Two random poisson variables $X_1 \sim \text{Pois}(\lambda_1)$, $X_2 \sim \text{Pois}(\lambda_2)$, and testing: Null Hypothesis: $\lambda_1 = \lambda_2$ Alternate hyp: $\lambda_1 \neq \lambda_2$ Two random binomial variables $X_1 \sim \text{Binom}(n_1, p_1)$, $X_2 \sim \text{Binom}(n_2, p_2)$, whe...
I am overthinking this for sure, but I am stumped. I have a historical data set of projects with hours of contribution by various positions. There are six types of projects. How can I model the average contribution of each position for future forecasting purposes? Linear regression doesn't work because that models the ...
If $F_Z$ is a CDF, it looks like $F_Z(z)^\alpha$ ($\alpha \gt 0$) is a CDF as well. Q: Is this a standard result? Q: Is there a good way to find a function $g$ with $X \equiv g(Z)$ s.t. $F_X(x) = F_Z(z)^\alpha$, where $ x \equiv g(z)$ Basically, I have another CDF in hand, $F_Z(z)^\alpha$. In some reduced form sense I...
Although reading quite a bunch of books, I'm still not sure, which method to use and how to implement it, therefore I appreciate any help! I have 4 different groups (treatments) with 50 participants each. Each participant's action is observed 5 times under the same condition. The 5 different values are collected withi...
Background I have data from a field study in which there are four treatment levels and six replicates in each of two blocks. (4x6x2=48 observations) The blocks are about 1 mile apart, and within the blocks, there is a grid of 42, 2m x 4m plots and a 1m wide walkway; my study only used 24 plots in each block. I would li...
I have a general understanding of the difference between a population (set of entities under study) and a sample (a subsection selected from the population). However, I've been doing some work in PPC (Pay-Per-Click) and AdWords recently, and can't seem to grasp the population/sample difference in regards to that. For e...
Suppose I am given $n$ samples of sizes $N_1, \dots, N_n$ from a Dirichlet–multinomial distribution: Fixed and given is a $k$-vector $\mathbf{\alpha}$ of positive real numbers. For each $i, \, 1 \le i \le n$, a random probability vector $\mathbf{p}_i$ is drawn from a Dirichlet distribution $\mathrm{Dir}(\mathbf{\alpha}...
I am analyzing data from an experiment in which treatment levels increase quadratically, e.g. the treatment levels are $0, 1, 4, 9$. When analyzing the response using regression, would it make sense to use the square root of the treatment level as a predictor? If so, how would this affect interpretation?
(Apologies if the notations are "unusual", I'm not sure what the correct notations should be. I'm putting an example at the end of the question.) Let's assume there was an initial dataset of an n by m matrix $M=(x_{ij})$ with $1<=i<=n$ and $1<=j<=m$, from which the following two vectors have been calculated: the vecto...
I am exploring different classification methods for a project I am working on, and am interested in trying Random Forests. I am trying to educate myself as I go along, and would appreciate any help provided by the CV community. I have split my data into training/test sets. From experimentation with random forests in R ...
I was wondering if you can share your experiences on what you feel is the best method to test lead / lag relationships between I(1) time series variables (i.e stock prices) and advantages and disadvantages of your proposed method(s). Also if you have links to academic papers that further describe these methods I would ...
I'm having problems understanding the concept of a random variable as a function. I understand the mechanics (I think) but I do not understand the motivation... Say $(\Omega, B, P) $ is a probability triple, where $\Omega = [0,1]$, $B$ is the Borel-$\sigma$-algebra on that interval and $P$ is the regular Lebesgue meas...
I was wondering whether anyone could point me to some references that discuss the interpretation of the elements of the inverse covariance matrix, also known as the concentration matrix or the precision matrix. I have access to Cox and Wermuth's Multivariate Dependencies, but what I'm looking for is an interpretation o...
Direct Question: Are there any measures of auto-correlation for a sequence of observations of an (unordered) categorical variable? Background: I'm using MCMC to sample from a categorical variable and I'd like a measure of how well the sampling method I've developed is mixing across the posterior distribution. I'm fam...
I'm just having a look through Hadley's very excellent book about his ggplot2 R package. He has some code to remove a linear trend in the diamonds dataset, like so: d <- subset(diamonds, carat < 2.5 & rbinom(nrow(diamonds), 1, 0.2) == 1) d$lcarat <- log10(d$carat) d$lprice <- log10(d$price) detrend <- lm(lprice ~ lca...
What is an appropriate econometric model to describe count data with an upper bound?
In practical application, I have witnessed often the following practice. One observes a pair $(x_t, y_t)$ over time. Under the assumption that they are linearly related, we regress one against the other using geometric weights rather than uniform ones, i.e., the OLS minimizes $$\sum_{t=0}^\infty k^{t} (y_{T-t}- a x_{...
In R, what is the difference between: if(x>2 & x<3) ... and if(x>2 && x<3) ... Similarly: if(x<2 | x>3) ... and if(x<2 || x>3) ...
Who created sampling distributions? I have looked everywhere and I'm writing a paper, but, so far, all I've been able to come up with is the theory and the definition. Please help me find the who, what, when,and where.
On page 9 in http://jenni.uchicago.edu/Oxford2005/four_param_all_2005-08-07_csh.pdf ATE - the average treatment effect is the expected gain from participation in a program for a random individual. For example, evaluate the impact of going to college on wages. Due to selection bias estimation steps are: Probit, to mode...
Have anyone tried modeling number of phone calls using OLS? The dataset is number of calls per months for each customer's account. The dependent variable is number of calls or average number of calls, and the explanatory variables are customer specific variables including number of purchases, total spend and so on.... ...
I am not able to find an existing name for the comparison function I wrote. I have two lists of values which I want to compare. At first I used jaccard, but then I recognized I need to eliminate the length of the second list as it does not seem to have anything to say in my use-case. So I changed jaccard to: $$ sim(L1...
I'm investigating interplay between two variables ($x_1$ and $x_2$). There is a great deal of linear correlation between these variables with $r>0.9$. From the nature of the problem I cannot say anything about the causation (whether $x_1$ causes $x_2$ or the other way around). I would like to study deviations from the ...
I've written a small hierarchical clustering algorithm (for better or for worse). I'd like a quick way of visualizing it, any tooling ideas?
I wonder if there is a simple way to produce a list of variables using a for loop, and give its value. for(i in 1:3) { noquote(paste("a",i,sep=""))=i } In the above code, I try to create a1, a2, a3, which assign to the values of 1, 2, 3. However, R gives an error message. Thanks for your help.
If you're modelling a proportion response against numerous predictors that are also proportions, is it necessary to transform the response if the standard OLS model is seemingly well behaved? By well behaved I mean: None of the fitted values are outside the range [0,1] (In fact they are fairly accurate) Residuals loo...
A simple question. If $Y=\frac{1}{X}$ and I know $f_X(x)$, is it true that $E(Y) = E(1/X) = \int_{-\infty}^\infty \frac{1}{x}f_X(x) dx$?
What kind of function is: $f_X(x) = 2 \lambda \pi x e^{-\lambda \pi x ^2}$ Is this a common distribution? I am trying to find a confidence interval of $\lambda$ using the estimator $\hat{\lambda}=\frac{n}{\pi \sum^n_{i=1} X^2_i}$ and I am struggling to prove if this estimator has Asymptotic Normality. Thanks
My current dataset has three conditions, and we've measured the activity levels of 10,000 genes in each condition. Replicated 8 times. Using 10,000 linear models, we determine for each pair of conditions (ie for each of three contrasts) the number of genes with significantly different activity levels. This is standard ...
I am trying to devise a simple algorithm to create a Bayesian prior from measurements obtained from time series data. Firstly, I presuppose that the data can take on one of five possible "shapes" or "patterns" and then measure the Euclidean distance of each time series data point from its equivalent point in time in e...
I have annual returns and standard deviations for two funds, $r_{a}$, $r_{b}$, $\mathrm{SD}_{a}$ and $\mathrm{SD}_{b}$ but I do not have individual data, just the annual data. The annual correlation between the prices of the funds is 0.7. If I had the individual data I could use $\mathrm{Cov}(A,B) =\sum_i (\bar{r}_{a} ...
I have this long running experiment. Each time I run it I get a new goodness value, since the algorithm has random variables in it. So I need to report the mean and the std of some n runs. What should n be? I need to be able to defend n based on some statistical ideas. Some kind of scientific reference (a book, a paper...
... and why ? Assuming $X_1$,$X_2$ are independent random-variables with mean $\mu_1,\mu_2$ and variance $\sigma^2_1,\sigma^2_2$ respectively. My basic statistics book tells me that the distribution of the $X_1-X_2$ has the following properties: $E(X_1-X_2)=\mu_1-\mu_2$ $Var(X_1-X_2)=\sigma^2_1 +\sigma^2_2$ Now let'...
This is more of a general statistics question, though if it matters I'm writing PHP code. Let's say I'm trying to compute the average value of a toy that is commonly bought and sold on the secondary market, and I have a set of price values culled both from auctions and from user-entered "price paid" data. The data poin...
I have 3 experiments, where some quantity was measured 3 times. Thus, 3 biological replicas, 3 technical replicas in each biological replica, 9 measurements in total. I need to answer the following questions: For each biological replica: are my 3 measurements consistent? To do this, I'm using Dixon's Q test. For avera...
I am interested to know what level of statistics kids are learning in different countries around the world. Could you please suggest data/links that shed light on what is happening in this regards? I'll start. Israel: The students who are taking advanced math study more or less - mean, sd, histogram, normal distributio...