instruction
stringlengths
9
38.7k
Does anyone know how to select bandwidth with GCV for Epanechnikov kernel in R or Matlab? Thanks a lot!
I can't seem to understand how PCA works. My (lack of) math knowledge don't help me either. I have read that the new set of variables has to be a linear combination of the old set. What does that mean exactly? That there should be a way to multiply numbers a, b, c, ... with dimensions/variables x, y, z... and get the o...
I have a dataset with monthly temperatures for 4 different years and I would like to test if they are significantly different between the years. As I collected the data for different sites I wondered if there were some possibility to perform the calculation at once or if I have to repeat it for each site. I am using th...
Possible Duplicate: Relatively normalizing values for collaborative filtering I am trying to derive a formula for my collaborative algorithm problem to calculate popularity rating of an item. I am considering three factors to calculate rating for an item based on three different ratings a, b and c, each with weight ...
Data can have trends, cycles, seasonal pattern repeats and irregular components. How do these components impact on the ordinary multiple regression with dummy variables?
I would like to compute belief intervals (confidence intervals; CI) for the parameters of an environmental dynamic model within the Bayes' theorem. The measurement model of the data is $$ d(t)=y(\theta,t)+\epsilon, $$ where $\epsilon$~Norm(0, $\sigma$) is the assumed measurement error, $y$ is the dynamic system outpu...
I am trying to derive a formula for my collaborative algorithm problem to calculate popularity rating of an item. I am considering three factors to calculate rating for an item based on three different ratings $a$, $b$ and $c$, each with weight $w_1$, $w_2$ and $w_3$. The cumulative rating is: $$w_1 a + w_2 b + w_3 ...
Is this all I have to do to implement 2 fold stratified cross validation: Assign random number from uniform distribution [0...1] to each row. Assign row to fold 1 if random number <= 0.5 otherwise assign to fold 2 Does this ensure that the class priors are roughly the same in each fold?
I am doing an unsupervised clustering analysis for a genomics project. This means that I do not know when a particular clustering analysis is good or not. I am running different clustering algorithms and different 'sets of features'. What I mean with different 'sets of features' is that given a data frame, I choose dif...
If I have the model: m = glm(x~y,family=poisson) What is the scale on which the predictions are obtained (from, e.g. predict(m))? For example, I know that if family=binomial, the prediction scale is log-odds.
Is it okay to perform a Kruskal-Wallis on four unequal samples? Further to this, is there a subsequent pair-wise post-hoc suitable for two unequal sample sizes?
I've created my own slightly enhanced version of the termplot that I use in this example, you can find it here. I've previously posted on SO but the more I think about it I believe that this probably is more related to the interpretation of the Cox Proportional hazards model than with the actual coding. The problem Whe...
I need to have one understanding on statistical hypothesis testing. In a typical hypothesis test, we have 2 opposite hypotheses; namely Null and Alternative. Here my textbook says that "those 2 hypotheses are not symmetrical in the sense that if we swap the hypotheses then the result will alter". Here I am unable to gr...
1) Is it okay to run a Mann-Whitney U test on unequal sample sizes i.e. two groups (N=11, N=12)or is there an alternative test? 2) What does it mean when one obtains a zero value for a Mann-Whitney U test (bearing in mind I obtained zero values before with equal sample sizes) Ranks **Site N Mean Ran...
I've calculated income inequality metrics (Gini/Hoover/Theil coefficients) for several populations. I know I can make claims like "this population has a higher Gini coefficient, so its distribution in this variable is more unequal than this other population." But is it possible to make more quantifiable claims? For exa...
I am exposing several experimental organisms to a toxin in the food. If the dosage is high enough, they will die. I am examining the number that are dead after a day. For practical reasons, the dosage they get is not directly under my control. I have decided to model the number that are dead after one day as a binom...
Kolmogorov-Smirnov statistic... I read in wiki that it is used to compare a sample distribution with reference. However, I've interned in a company which was supposed to do predictive modeling and they keep talking about KS for a model. What were they talking about?
I am trying to show for $X_n$ iid st. $E|X|^q < \infty$ that $$ \frac{1}{n} \sum^n (X_i - \bar{X})^q \to E((X-EX)^q) $$ in probability. I used the following approach: We note $ \frac{1}{n} \sum_{i=1}^n X_i \to EX$ in prob. by the WLLN, i.e., $\bar{X}_n \to EX$ in probability $ Y_i := (X_i - EX)^q $ are iid i.e. ...
I would like to show that a new biomarker (let's say percent tumor volume reduction at 3 weeks of treatment estimated with automatic methods) performs better than an old one (same measure, but based on manual volume measurements) to distinguish groups or predict outcome. I have these different settings: outcome: progr...
In Larry Wasserman's lecture notes on $o_{P}$ and $O_{P}$, I am not able to follow the derivation of the following example in page 9. Consider $m$ coins with probabilities $p_{1}, \ldots ,p_{m}$. Then \begin{align*} \mathbb{P}(\max_{j} | \hat p_j - p_{j}| > \epsilon) & \le \sum_{j=1}^{m} \mathbb{P}(\hat p_{j} - p_{j})...
I have a question How would you interpret the odds ratios for a continuous variable?
I have two values of SD calculated from paired samples of size $n=10$. Results are: Pre test - mean=29.1 and SD=19.05 Post test - mean=34.9 and SD=16.74 How do I calculate the SD?
I'm having trouble following the derivation of the ridge solutions as a sum of vectors in formula 3.47 of The Elements of Statistical Learning on pg. 66. It shows the following: $\mathbf{X}\hat{\beta}^{ridge} = \mathbf{X}(\mathbf{X}^T\mathbf{X} + \lambda\mathbf{I})^{-1}\mathbf{X}^T\mathbf{y}$ $\mathbf{X}\hat{\beta}^{...
"How large must a class be to make the probability of finding two people with the same birthday at least 50%?" I have 360 friends on facebook, and, as expected, the distribution of their birthdays is not uniform at all. I have one day with that has 9 friends with the same birthday. (9 months after big holidays and val...
I am trying to compare entries in a 10x10 Spearman correlation matrix to determine whether one entry is closer to another entry than it is to a third entry. The caveat is that I actually have 1000 of these correlation matrices, not one, and the matrices are not statistically independent. To give some background: I have...
I have a question I would like to pose to the community. I have recently been asked to provide statistical analysis for a tumor marker prognostic study. I have primarily used these two references to guide my analysis: McShane LM, et al. Reporting recommendations for tumor marker prognostic studies (REMARK). J Natl Can...
I would like to do Multidimensional Scaling (MDS) using cmdscale() in R. I have read that it is useful to try out how many dimensions are suitable for the data by trying different values of k, and then seeing what proportion of variance is accounted for in the MDS result by looking at the R-square value. R-square value...
Can somebody tell me the difference between margins of error and confidence intervals? On the Internet I see these two meanings getting used interchangeably. Is it right to say, "Confidence intervals are shown as 1.96 and displayed on the graphs as error margins"?
I have a data set of J raters who each give ratings to I objects (on say a scale of 1 to 5). My goal would be to construct some kind of overall rating for each i based on all of the raters' scores. My first approach, which I have seen used before, is to construct a standardized score specific to each rater-object pair ...
I was wondering if there exist efficient online or dynamic algorithm for fitting a normal distribution to data as it comes in. I am interested in two variants: The algorithm is fed data points one at a time, and has to update its previous best-fit to account for the new point at each step. The algorithm is fed $n$ dat...
I'm used to doing descriptive modeling where I'm very concerned with parsimony and interpretability, but now I have a project that calls for the opposite and I'd like advice on techniques I should look into. I have a tool (an R function) that essentially creates random graphs based on 11 parameters. There are 4 statist...
I have several datasets on the order of thousands of points. The values in each dataset are X,Y,Z referring to a coordinate in space. The Z-value represents a difference in elevation at coordinate pair (x,y). Typically in my field of GIS, elevation error is referenced in RMSE by subtracting the ground-truth point to ...
I would like to use the following type of model and am wondering if someone could let me know if this technique has been studied before (I assume it has) and where to learn more about it? The idea is simple. I have a Markov process with a possibly infinite state space S. I have a partition P of S into a finite number o...
It's been a while since I looked at partitioning trees. Last time I did this sort of thing, I like party in R (created by Hothorn). The idea of conditional inference via sampling makes sense to me. But rpart also had appeal. In the current application (I can't give details, but it involves trying to determine who will...
How do you interpret an odds ratio of an interaction between two continuous variables $x_1, x_2$? Would you fix $x_2$ and let $x_1 = x$ and $x_1 = x+1$?
We want to add a forecasting tool to our website -- it would draw off a historical database and users can choose the model (Box Jenkins, Simple Linear Regression, etc.), confidence interval and play what-if. Is anyone aware of such package we can plug into our website?
What software (or method) can I use to determine correlations between any sets of variables and results? Background: I would like to analyze sets of our archived data over several years. Knowledge of the product tested often leads to some obvious correlations (ie: fuel efficiency peaks at a particular speed). Many tr...
I have one variable that attains a certain value (between 0 and 1), about 1000 observations and each belongs to one (and only one) of fifteen groups. Now I would like to reduce the number of groups to two or three by combining them. It is important that all the data within a given group in the former division will stay...
There have been several good questions and sets of answers on introductory books or approaches to learning R eg here and here. But I have a slightly different problem - the best way to run an hour long session (or several such sessions) in a computer lab that will get people started in R, familiar with its basic appro...
I'm using J. Nolan's free stable.exe program to fit the pareto-levy stable model to some income data. This is option 3 "fit a bivariate sample" in the program. In the instruction text file it is said that after selecting option 3 and uploading the data (data = a text file containing a single column of numbers--the inc...
I am trying to understand the difference between logistic regression probabilities and linear regression prediction intervals. For example, let's say we have a database of student test scores in the range of 1 to 100 and some predictors. The goal of this study is to build a model to predict if other students will reach...
I have problem on generating correlation matrices using Wishart distribution. I read some articles about Wishart distribution, and it turns out that Wishart distribution is commonly used to generate covariance matrices. Is it possible to generate correlation matrices using Wishart distribution? Any information about us...
What are the best methods for building document exemplar training sets for classification of unstructured data (documents and emails) using SVM? How do I optimize F-scores for these models when using Cross-Fold validation?
In a project that I am doing to evaluate customer behaviour, I have asked a set of questions such as whether they read the unit pricing before they decide to purchase a particular product or do they only buy a particular product if it is on 'special'. In a population of 60 stores (with unequal customer base but the tot...
Suppose $$E[y|\textbf{x}] = \beta_0+\beta_{1}x_{1}+\beta_{2}x_{1}^{2}+\beta_{3}x_{3}$$ Is there an easy interpretation of the coefficients? If there was no $\beta_{3}x_{3}$ term then we would have a quadratic and take the derivative to get an interpretation. So maybe we want take the partial derivative with respect to ...
I need to confirm a stats question and I was wondering if you could let me know whether you would agree with my thought process: would need this good enough for publication purposes in a Psychology journal, for what reason I am a little unsure: Essentially: How do I get a variation measure of z-scores with different un...
I wish to know what statistical literature is relevant for the following problem, and maybe even an idea on how to solve it. Imagine the following problem: We have 4 possible treatments for some disease. In order to check which treatment is better, we perform a special trial. In the trial, we start by having no subje...
Do high VIF values for a a particular variable $x$ just indicate that it is highly correlated with at least one of the other variables in the model? Does it specify which variables and how many variables that $x$ is correlated with?
I'm having some problems in writing down in R the out-of-sample forecasting with a Random Walk. I have a multivariate time series (y) and I want to estimate the out of sample forecasting (y(t+k)-y^(t+k/t) result with a RW, for k =1,6,12. I write down this code, it works, but it seems to give me too much low errors. res...
My research question is from education: To test whether groups (university, department, gender) differ based on their scores in a test, and whether there are any interaction effects, I'll do 3-way ANOVA? Data is unbalances (unequal cells). My professor says I have to do SOS Type 1 (report parameter estimates) because o...
Here are three regression equations: $$ \begin{align} Y &= \beta_1Z_{\text{math}}\qquad (1)\\ Y &= \beta_2Z_{\text{math}} + \beta_3Z_{\text{science}}\qquad (2)\\ Y &= \beta_4Z_{\text{department}} + \beta_5Z_{\text{math}} + \beta_6Z_{\text{science}} + \beta_7Z_{\text{university}} + \beta_8Z_{\text{gender}}\...
This is a brief question because my lecturer mentioned it today in class but I don't quite understand. Why is omitted variable bias not a major problem in time series analysis?
I am looking for a simple code example of how to run a Particle Filter in R. The pomp package appears to support the state space math bit, but the examples are a little tricky to follow programmatically for a simple OO developer such as myself, particularly how to load the observed data into a pomp object. Examples he...
I would like to find a hierarchical-clustering method useful to assign a group membership into k groups for all individuals in my dataset. I have considered several classic ordination methods, PCA, NMDS, "mclust", etc., but three of my variables are categorical (see data description below). Further, I was wondering if ...
I am constructing Markov chains (with 100 to 200 states) and inferring transition probabilities empirically by simply counting how many times I saw each transition in my raw data (about 20k to 60k transitions per data set). Note that the modest number of transitions and the decent number of state results in average num...
Edited Question: As I promised I've edited this question. The previous version was written with the intention of simplifying the real question, but it ended in losing the real significance. Now I'm posting the "whole story". ;) My purpose is to calculate $n$ players' equity in a poker tournament (their probability of ...
I have a data set with about 70 variables that I'd like to cut down. What I'm looking to do is use CV to find most useful variables in the following fashion. 1) Randomly select say 20 variables. 2) Use stepwise/LASSO/lars/etc to choose most important variables. 3) Repeat ~50x and see which variables are selected (...
There is an Markov chain $M$ defined on states $1, ..., N$ with the special property that it only has transitions $p_i$ from $i$ to $i + 1$ , $q_{i + 1}$ from $i + 1$ to $i$, and $r_i = 1 - p_i - q_i$ from $i$ to $i$ (for $i \in [N - 1]$; $p_N = 0$ and $q_1 = 0$ since there is no successor/predecessor state). We know o...
I have Score data: integer ranging 0-100 which behaves normally on a QQ plot. The score is assigned to a subject which is either Normal or Diseased and it differs between two. I tried 2 models: - prediction of Normal or Diseased status based on Score - t-test of means between 2 groups Both gave me low p-value for the S...
I'm looking for a good source of information about Analysis of Molecular Variance (AMOVA), a kind of statistical analysis used in population genetics. Especially how are the $\phi$-statistics calculated and what is the difference compare to F-statistics (fixation index) in measuring the level of differentiation among d...
I applied SVM to perform the classification against several data sets. It turns out that the performance metric of recall is pretty bad for one data set. It has recall around 50% while other data sets have recall around 80%. For this kind of scenario, what are the possible approaches that are available to improve the r...
I have two independent random normal variables $Y_1$ and $Y_2$. The sum is also normally distributed: $Y_1 + Y_2 \sim N(\mu_1+\mu_2,V_1+V_2)$ The normally-scaled inverse gamma (NSIG) distribution is a conjugate prior. I'd like to compute the posterior distribution for the sums $(\mu_1+\mu_2,V_1+V_2)$ which govern...
I have unstandadized B coeff.s in my parameter estimates for ANOVA. How can I use Beta=B(SDx/SDy) to convert them into standardized B's (Beta's). Why doesn't SPSS do this for me, like it does in regression? THanks.
Quick question. I want to perform a linear regression that looks like this: lm(y ~ x1 + x2 + x3 + x4 +x5, mydata) This works fine if I manually write out this code. However, the independent variables that I want to use are stored as a character, like this: > vars [1] "x1 + x2 + x3 + x4 +x5" I tried typing this: lm(y ...
I'm trying to replicate Silver & Dunlap (1987). I'm just comparing averaging correlations or averaging z transform correlations and back transforming. I seem to not be replicating the asymmetry in the bias they find (back transformed zs are not closer to the population value for me than rs). Any thoughts? Is it pos...
I am a R beginner. Is there a way to specify custom error function with Random Forests in R? For example, say my training data is ,,, so on and my error for any given set needs to normalize the weights and then calculate the mean of absolute error. So my error for each data point is (predicted-actual)*normalized_weight...
I have a data set for thousands of genes. Each gene has two attributes represented as a percentage range(0-100). One attribute (V3) has a normal distribution but the other (V2) is highly negatively skewed (e.g 99% of the values are greater than 99%). I want to know if the out liars of V2 have any relationship with the ...
I have a data set from a survey of health problems and annoyance by traffic noise in people living in residential buildings, with "5-point scale answer" questions. I want to perform a multilevel model for an ordinal response (health problem or noise annoyance), and I tried with the gllamm command in Stata but it's not ...
It seems to me that ratio, interval, ordinal and nominal variables nested in the following sense: A ratio variable is also interval, ordinal and nominal. An interval variable is also ordinal and nominal. An ordinal variable is also nominal Are the above statements accurate? If not, are there any counter-examples wher...
Can someone tell me which algorithm would be best to solve this problem? I am thinking this belongs in the category of 'Market Basket Analysis' aka ('Affinity Analysis'), but I am not sure. Here's the problem: A user belongs to certain types of groups. When our client gives us a set of users that belong to a particula...
So I want to find the long run probability of getting two heads in a row when flipping a fair coin many times. I know this answer should be 1/6 (expected number of flips to get 2H in a row is 6) but I'm trying to figure out how to use a Markov chain to solve this. I think my transition matrix should be (3x3): 0H 1H...
I work for a commercial printing company, and am collecting data regarding the quality of our printing over time (density and dot gains). Essentially, for every job I have a date, a density, and a dot gain. I would like to be able to analyze a date range and check to see if our quality seems to be getting consistentl...
In one of my computations (result of GLM with some model values replaced with observations) I resulted with a distribution that is a lognormal distribution plus some constant. Can I still speak of lognormal distribution? Again, this question is more about the statistical language and convention than about the statistic...
I was using the predxcon command to graph the predicted probabilities for logistic regression. Basically I want to see the pattern for predicted probabilities of the outcome by each age group. Using predxcon command, it provided the graph, as well as corresponding values. However, I realized that the sample is weighte...
I’ve already written this question, but probably I didn’t specified it well, for this reason I write it again. I need to use a random walk model (no-change) yt = yt(1+t) to compute the ratio of RMSFE. What I would like to do is: Fit the model to the data yt,...,yt+k−1 and let yˆt+k be the forecast for the next observ...
Does anyone know how to work out whether points 7, 16 and 29 are influential points or not? I read somewhere that because Cook's distance is lower than 1, they are not. Am, I right?
I am busy validating a model for "run-off" using river flow information. I have approximately 5 years of daily data and have been looking at G-causes as an additional statistic to help explain the difference between observed and simulated run-off within a catchment. Using R and running the granger.test() from Library(M...
Suppose I have constructed a prediction model for the occurrence of a particular disease in one dataset (the model building dataset) and now want to check how well the model works in a new dataset (the validation dataset). For a model built with logistic regression, I would calculate the predicted probability for each ...
If $N_1$ and $N_2$ are independent Poisson processes then the superposition is a Poisson process. Is it possible to construct two dependent Poisson processes such that the superposition is a Poisson process again? How can I do that? Can I use some copula directly? An article that suggests this is possible is Pfeifer an...
Someone has surveyed a number of people and put the results in a database (Survey 1). Each observation has additional information that, for any subpopulation (men only, young only, etc.), gives a national-level estimate of the number of people in that subpopulation, as well as a confidence interval for that estimate. A...
Gelman & Hill (2006) say: In Bugs, missing outcomes in a regression can be handled easily by simply including the data vector, NA’s and all. Bugs explicitly models the outcome variable, and so it is trivial to use this model to, in effect, impute missing values at each iteration. This sounds like an easy way to ...
I have run an experiment with 5 categorical factors. The factors have anywhere between 2 and 8 levels each. I have one response variable, which is continuous in the range of 0 to 100. All-in-all, I have run a fully factorial experiment with 800-something combinations. Each combination has 10 samples. In total, in R-spe...
I use a MLP with one hidden layer (15 nodes) and one output node. I use a sigmoid activation function, atan as error function, the error itself is calculated with MSE, 5-fold crossvalidation, resilient backpropagation for a batched binary classification task where within each batch approx. 1000 samples are available. M...
I am working for two signals. One is a dataset with 10 equally spaced impulses. Another is a dataset with randomly spaced impulses of identical length. The higher order moments, such as kurtosis, skewness or standard deviation are not sensitive to the two signals. Who can help look for an indicator to identify it?
I've written a user defined splitting function to use with rpart, its returning a 'vector of goodness', but the tree that is returned never has any splits, just one node. using the anova method on the same data provides a tree with many nodes. I've been interrogating the code, but rpart feels like a black box so far, ...
First a little background: I'm a college paintball coach and I have two populations of players: I. Players that have a lot of experience/skill prior to joining the team e.g. playing for amateur non college teams but who don't often play together for various reasons. II. Players that are not very experienced/skilled but...
Isn't the test statistic for both tests identical? The only difference I see is that the alternative hypothesis is different. Since you don't need to know the function h in the Breusch-Pagan test, what exactly is the difference between the two tests? When would you use the White test, and when would you use the Breus...
Is it valid (reliable etc.) to compare a small sample with a large sample (which is made up of several small samples) when both samples are from the same population? There are 3 firms. Each firm specialises in the manufacture of a particular product, hence it is classified in that way. Firm A manufactures common cold ...
I've created a model with lme4's lmer and wanted to create a prediction interval around my model fit. I figured I could do it Bayesian-style and simulate from the model to do this. My model looks like: b3 <- lmer (dollars ~ 1 + I(refund/days) + (1 | month) + (1 | regime), data=elect5) and my first attempt to graph thi...
When creating a Monte Carlo simulation model for a variable, a critical step is to choose the distribution that best fits the variable's probability density. I generally do this by looking at the density plot and determining what distribution best fits the density shape. For (a very lame) example, this… x <- rnorm(100...
I am trying to grasp the dynamic time warping measure for comparing time series together. I have three time series datasets like this: T1 <- structure(c(0.000213652387565, 0.000535045478866, 0, 0, 0.000219346347883, 0.000359669104424, 0.000269469145783, 0.00016051364366, 0.000181950509461, 0.000385579332948, 0.000781...
I would like to use a clustering method, e.g. 'mclust', in R to classify each individual in my dataset to k groups. I have 7 continuous and 3 categorical variables. These and other hierarchical clustering methods do not allow for use of categorical variables. Searching Google and this site it appears that converting th...
I have some multivariate data and want to investigate the effect of some environmental gradient. I want to use capscale but I don´t know how to deal with the permutation scheme. I have made up some artificial data, with 20 sites along a gradient ("env"): ######### create some species data along a gradient df <- structu...
I would like to ask a question about Gower similarity/dissimilarity index. Is it ok to use the Gower dissimilarity measure with Ward linkage clustering? I was reading that the Gower similarity index should not be used with Ward linkage because the index is not metric. I was wondering if this is only the case for the s...
Possible Duplicate: In linear regression, when is it appropriate to use the log of an independent variable instead of the actual values? I'm currently conducting a spatial regression analysis. I'm trying to decide whether my response variable needs to be log transformed. I understand that regression analyses assume ...
I am looking at attachment and cyber addiction. I'm carrying out an four-way Anova, attachment patterns being my ivs (secure, preoccupied, fearful and dismissing) with cyber addiction as my dependent variable. I am intending to use 100 participants in my study, I wanted to know if that is an appropraite amount to run a...
My dataset consists of 4-million records, each a combination of age, race, and a discrete observed value. The goal is to find a correlation between the combination of age/race and the observation, so that given a distribution of ages and races, a distribution of expected observations can be calculated. I am looking int...
I'm trying to improve accuracy in a Naive Bayes classifier that uses a bunch of features. I have a hunch that removing some features may actually improve performance. My reasoning is for a particular feature the estimated PDFs across the classes may be different slightly because of the limited amount of learning data...
I have data for an application's installs per day and their ranking in the store for the following day. Each user/installation can be further broken down into two categories - those that installed it because of an ad, and those that installed it on their own (e.g., by word of mouth). From this data, I want to know if i...
I need to know the formula for the pdf of $S^2$. I know this: $$ \frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1} \>, $$ but I want to state the correct formula for the pdf of $S^2$, not $(n-1)S^2/\sigma^2$. Any thoughts?