instruction
stringlengths
9
38.7k
I have a problem with a 3 way ANOVA with repeated measures. The design is the following: "localization" is the dependent variable, than I have the following within subjects factors "material" (4 levels), "diffusion technique" (6 levels) and "typology" (2 levels). This is the formula I used: aov_Material = aov(abs(Loca...
I used matlab corr() function to identify correlation of 236 samples. Pearson correlation is selected, and the output return r and p-value. Two sets of samples returned different r & p-value. May I know how to interpret the significance of correlation with the results below? (a) The data has strong negative correlation...
An urn contains N-1 red and 1 green ball. Each ball has an associated weight. If each ball is drawn (without replacement) with a probability proportional to how much its weight contributes to the urn, what is the expected number of attempts required to get the green ball? Example: 2 red balls of weight 0.3 and 0.4, and...
I have some question which occupies myself for a while. The entropy test is often used to identify encrypted data. The entropy reaches its maximum when the bytes of the analyzed data are distributed uniformely. The entropy test identifies encrypted data, because this data has a uniform distribution - like compressed da...
I have never had problems with R crashing before. I am using the mice package (mice 2.13) to perform multiple imputations. The code works fine on some subsets of the data, but when I run it on other subsets, R crashes (not immediately - after some time). From the output in R just before it crashes, I believe it is usin...
I am currently analysing some pretty awful/awkward data on the abundance of fish under three different "Hydro-Regimes" (5 abundance measurements for each regime - Short/Medium/Long). The current analysis plan had been a one way ANOVA. Looking at the residuals vs. fitted and the normal Q-Q after plugging it into a linea...
I have a very beginner's question regarding the Central Limit Theorem (CLT): I am aware that the CLT states that a mean of i.i.d. random variables is approximately normal distributed (for $n \to \infty$, where $n$ is the index of the summands) or the standardized random variable would have a standard normal distributio...
Can I compare outcome data from different literacy measures with different scales (delivered to different subjects) by transforming the data into z scores? Ideally I'd like to use regression and ANOVA techniques to determine if there are significant differences between groups that got different types of literacy inter...
Proposition: If X(t) is a lognormal process then corr(X(t),1/X(t))=-1. What is a lognormal process? What are the differences between a lognormal process and a lognormal distribution? Can anybody prove the above proposition?
I have a large number of predictors that are hypothesized to be important in determining my binary outcome variable (here's a bit more about my goal, the predictors and the outcome). The problem is that considering the number of "positive cases" that I have, I have too many predictors (I have about 450 cases in total,...
Why does MICE fail to impute multilevel data with 2l.norm and 2l.pan in this situation ? Here is a reproducible example: require(foreign) require(mice) require(pan) dt.fail <- read.csv("http://goo.gl/pg8um") dt.fail$X <- NULL dt.fail$out <- as.factor(dt.fail$out ) dt.fail$grp<- as.factor(dt.fail$grp) dt.fail$v1<- as....
This is my test design which is simply a grouping variable: When I choose to regress a gender variable (w/m) onto this grouping variable with a multinomial logisitic regression model I'll observe Why does SPSS list both categories of gender with one being redundant rather then choosing one by default (the last catego...
My predictions coming from a logistic regression model (glm in R) are not bounded between 0 and 1 like I would expected. My understanding of logistic regression is that your input and model parameters are combined linearly and the response is transformed into a probability using the logit link function. Since the logit...
I am having trouble trying to figure out how to report categorical and continuous data in one table. I want to create a descriptive table summarizing some of the categorical and continuous data from the 3 treatment groups I had.
How do I specify for a variable to be uniformly sampled from the discrete values $1,2,\ldots,10$ in JAGS? I guess I want to use the dcat() distribution, but I have yet to find good documentation of the parameters for this.
I am teaching a class on logistic regression with SPSS. The textbook supplies a sample data set with a binary predictor and two numeric covariates. The sample contains 1000 rows and a number of these entries have common values for both predictors. One predictor takes only 5 values, for example, and the other takes arou...
When we are trying to maximum a posterior, we apply Bayesian rule to convert them into posterior probabilities! $P(C=c_i|X=x) = P(X=x|C=c_i)P(C=c_i) / P(X=x)$ proportional to $P(X=x|C=c_i)P(C=c_i)$, but how can i be sure that it is really the case?
I am doing research for my Masters studies and am battling a bit with the statistical side of my study. I used a survey and have captured all the data into SPSS. I have no statistical background, I would thus need a bit of advice on how to interpret / analyse results. I am making use of Chi-Square test to look at rela...
In theory, the importance weight of a particle has to be a probability, i.e., $w_{s_t} = p(z_t|s_t)$. My question is: Since we eventually normalize the weights with their sum and get a probability distribution, do importance weights themselves have to be probabilities in practice? Can't we just use a function of our c...
I am currently working on my thesis and interested in estimating a Weibull conditional Hazard Frailty Model for recurrent event data using WinBUGS. I wrote the model but when am trying to use it with the following script it hangs unexpectedly. It returns a messages titled "undefined real result". What am I doing wrong?...
I'm a beginner when it comes to support vector machines. Are there some guidelines that say which kernel (e.g. linear, polynomial) is best suited for a specific problem? In my case, I have to classify webpages according to whether they contain some specific information or not, i.e. I have a binary classification proble...
What are some of the best books for studying i) variability of univariate and multivariate variables (real, count data) across a spatial domain. ii) sampling a univariate or multivariate variable based on its distribution across spatial locations. (Spatial sampling in short)
Given a uniform random number generator (such as the linear congruent method), how shall I generate a sequence of i.i.d. random samples? Are samples generated in a successive sequence i.i.d., or are they just realization of a single random variable (i.i.d. is for several random variables, and therefore doe...
In decision theory, a loss function signature is supposed to be output space * output space -> error There seems to be many different definition of 'the logistic loss' on the web Some define it as 'the negative of the log likelihood' boyd : this is clearly not a loss function in the decision theory point of view Som...
I have survey data about injuries occurring to athletes over the span of their careers. Many of the athletes suffered multiple injuries (the most any athlete reported was five and this did not occur very often). While I can see that injuries within an athlete may be dependent on a previous injury, in the data, many wit...
In Monte Carlo simulation, we often consider how well a sequence of generated points are. If I am correct, one aspect is statistical randomness: A numeric sequence is said to be statistically random when it contains no recognizable patterns or regularities; sequences such as the results of an ideal dice roll, or the d...
I am estimating a stochastic frontier with a mixed model. So far the half normal distribution worked good but I need a truncated normal distribution. It does not work, and I receive the error „Expected collection operator c“. I am using R2WinBUGS and as you can see in the model I have tried OpenBUGS and WinBUGS. Any su...
In my dataset, there's a binary response, some factors, and some covariates. In particular, there are some covariates that are always present when factor1=="A" and these covariates are always missing (NA) when factor1=="B". This missingness is structural, not random; it doesn't make sense for the covariate to have a va...
How to show what is going on if we drop significant variable in logit model ? Bias and heteroskedasticity should emerge. But what is the framework for showing such behaviours in econometric models ?
I am analyzing a survey data set. One of the items in the survey is: "I plan to work hard in my statistics course" 1=Strongly Disagree 2=Disagree 3=Neither Disagree or Agree 4=Agree 5=Strongly Agree No one selected option 1 of Strongly Disagree. This is to be expected but the function grm() in package ltm gen...
I was given an exercise to do that sounded something like this: The Arizona football team scored $45$ goals in $19$ games in the 2007/08 season. If $y_i$ denotes the number of goals scored in the $i$-th game, consider the following model: $Y_1,\dots,Y_n \sim \operatorname{Poisson}(\lambda)$ independently with $\lambda ...
I have a very large graph and a function of its vertices, and want to estimate mean value of this function. It's not possible to sample vertices uniformly in this problem, so a reasonable choice for estimation would be simple random walk. The problem is that for any vertex I can only pick a random neighbour of it; find...
This is an obfuscated version of a real problem: Each day I speak with some number of (distinct) girls. I compute the Jaccard similarity index between two consecutive days: $$ J(t)=J(t,t-1)=\text{Intersection}(\text{girls}(t),\text{girls}(t-1))/\text{Union}(\text{girls}(t),\text{girls}(t-1)) $$ I would like to ...
I have a system which visits two locations and collects signals every 10 seconds. It is well known that A causes B to occur but not all the time. So, I am trying to find a conditional probability distribution of B given A. The data looks like following: A B ---------- 1 0 1 1 1 0 1 0 ...
I have been given a data set that contains the number of awards earned by students at one high school where predictors of the number of awards earned include the type of program in which the student was enrolled and the score on their final exam in maths. I was wondering if anyone could tell me why a linear regression...
I conducted a Bayesian analysis in winbugs and then checked the convergence from the history plots. The regression coefficients look stabilized, but the variance parameters don't. I got the number of iteration up to 5000, but it still does not look stabilized. I attached the history plots of a regression coefficient an...
I would like to use the predict function (or something similar) in R to generate expected values from a Cox proportional hazards model with time-dependent covariates. The model takes the form model <- coxph(Surv(start,stop,event.time)~covars..., data=data) Normally, it's pretty straightforward to predict expected valu...
Hi I have a quick question about the details of running a model in JAGS and BUGS. Say I run a model with n.burnin=5000, n.iter=5000 and thin=2. Does this mean that the program will run 5,000 iterations, and discard results, and then run another 10,000 iterations, only keeping every second result? If I save these...
My apologies is this is too rudimentary to be asked here. If it does not belong here, could someone recommend a more appropriate place to ask? A little context. I am in a Senior Physics Lab class in college. Our first "experiment" involved rolling dice and calculating the probability of rolling each face. (The purpose ...
Is there a paper or book that talks about the mathematical relation between different machine learning models - how they are different and how they can (sometimes) be equivalent? For instance logistic regression can be viewed as a single-layer perceptron. Other examples are here
Why did the normal distribution become such a popular (important) distribution? I know one reason is because of CLT. Can you please give more reasons?
I am having trouble with a series of system tests in which each test is assumed to be a normal approximations of binomial distribution. Each test sample, n, is a Bernoulli ("success", "failure") trial of the system. Each system test has approximately 550 IID observations. Each has a lifetime that may vary between 2-8...
I am new to Path Analysis and ESM. I have been doing reading on this method, but still feel very much confused. I have a empirically evaluated failure model having 45 variables connected with each other in a cause and effect model. In my models, there are total 40 failure paths. The longest paths have as many as 7 vari...
I got a very small probability in my homework so are there any mistakes? Benford's law says that if we have a collection of numbers, the first digit has the distribution $\mathbb{P}(D=k)=\log_{10}(1+1/k).$ Take a collection of 1200 numbers. Approximate by using normal distribution that the probability that those numbe...
I am using R and i need to do an Anderson-Darling test on my data. I am using the adk package ( http://cran.r-project.org/web/packages/adk/adk.pdf ). How do I calculate the critical value for a given significance level? Let's say I want a significance of 0.01, what should I do? In the package, there is a method called ...
I am struggling with my implementation of the expectation maximization (EM) algorithm for a certain model. The sequence of log likelihood values is not increasing, which is contradicting the theory. The measured outcome variable y is binary and is generated by one of two distributions: p(y=1|z=0) = xi, a fixed probabi...
I would like to know how to interpret a difference of f-measure values. I know that f-measure is a balanced mean between precision and recall, but I am asking about the practical meaning of a difference in F-measures. For example, if a classifier C1 has an accuracy of 0.4 and another classifier C2 an accuracy of 0.8, ...
I am designing an experiment using D-Optimal design. With full factorial design I have to do 200 runs. With D-optimal, I can choose the number of runs I want to do and I evaluate the design using D-efficiency value. My question is the D-efficiency value varies in order of 0.001 when I change the number of runs. Can an...
I am using logistic regression to create a credit scorecard from past loan data. We will not approve loans in the future if the applicant has an insufficient credit score (no credit or insufficient data for a score from credit bureaus). These borrowers were however granted loan approvals in the past; therefore, there ...
I'm fitting a linear model where the response variable is a measure of physical performance-- running speed for example-- and the predictor variables are sex and drug treatment, with an interaction term. $$Y = \beta_{0}+\beta_1X_{sex}+\beta_1X_{drug}+\beta_3X_{sex}X_{drug}$$ We suspect that body weight influences runni...
I have a dataset of patient information and I'm looking to find a way to compare two groups of patients and take into account confounding variables. My dataset has an N of ~1500 and I'm looking for a difference between two populations (treated/untreated) and whether they responded to therapy. I have been using a Fisher...
R's randomForest package can not handle factor with more than 32 levels. When it is given more than 32 levels, it emits an error message: Can not handle categorical predictors with more than 32 categories. But the data I have has several factors. Some of them have 1000+ levels and some of them have 100+. It even has ...
I have a project to model users with characteristic tags (e.g. runner, cyclist, swimmer, vegan, pianist) in order to correlate user behaviour to these labels. Obviously a user can have multiple characteristics (non-exclusive) and so the distance (or similarity) between users is determined by the amount of tag overlap. ...
I have a signal gathering system. Every 10 seconds it goes to locations A, B and C and sees whether there is activity or not. It then populates a table which looks like following: A B C ------------ 1 0 1 1 1 0 1 0 1 1 0 1 ............ There are about 10,000 such rows of data in table. No...
I have three years of infection data from 6 different hospitals. 2010 2011 2012 1 1.3 2.5 1.03 2 3.35 2.5 2.6 3 4.1 1.8 2.5 4 2.0 3.65 .7 5 3.4 3.75 2.4 6 1.2 3.4 1.3 These numbers are rates (infections/10,000ptd). I need...
In [1], Schraudolph presents an algorithm for updating a weight $w$ and some auxiliary variables $p$ and $v$ given a vector gradient $g$ and another vector "$Cv$". The update rules attempt to make it so that v goes to $C^{-1}g$ where $C$ could be, for example, the Hessian. $Cv$ is a vector like $g$ that is passed int...
An author did not report an effect size so I am hoping you might be able to help me calculate it. I know the Means are: Condition 1: 326 Condition 2: 558 Sample size: Cond1: 11 Cond2: 12   T-test p value: .04
In unconstrained optimization, covariance matrix $C$ is parameterized in terms of its Cholesky ($C=LL^\prime)$. In other words, the parameter vector $\theta$ involves elements of the lower triangular matrix $L$. Derivative of $-2LL$ with respect to $\theta$ is computed exactly. Hessian at the final-iteration is comput...
I have been trying to impute future monthly climate data based on sets of downscaled data using the AMELIA package. I have monthly precipitation data from 1960-2099 for different geographic regions and I want to impute precipitation data from 2099-2150 using the past trend of precipitation. I want to use bound feature ...
To preface this, I have a pretty deep mathematical background, but I've never really dealt with time series, or statistical modeling. So you don't have to be very gentle with me :) I'm reading this paper about modeling energy use in commercial buildings, and the author makes this claim: [The presence of autocorrelatio...
Comparing the density function of two specific samples in R, both areas are clearly different and cannot be equal to one (see graph linked below). I would like both areas equal one on the same graph as to determine easily the set of abscissa values for which the pdf of a sample is larger than the pdf of the other. With...
I have two questions on using random forest (specifically randomForest in R) for missing value imputation (in the predictor space). 1) How does the imputation algorithm work - specifically how and why is the class label required for imputation? is the proximity matrix which serves to weight the average value to impute...
My statistics professor claims that the word "correlation" applies strictly to linear relationships between variates, whereas the word "association" applies broadly to any type of relationship. In other words, he claims the term "non-linear correlation" is an oxymoron. From what I can make of this section in the Wikip...
I know that people generally say that procedures which select a model based on information criterion lead to inconsistent model selections. I read a paper by Leeb and Potscher (2005), MODEL SELECTION AND INFERENCE: FACTS AND FICTION which supports this theory. Regardless of the kind of information criterion we use (a c...
Let us say that we have an experiment where people are shown images of tyres from car/bike and have to tell what it really belongs to. The objective of the experiment is to validate the hypothesis that people from age group 25-35 are much better at recognizing that the tyre images are from car or bikes. So the final da...
or: Does selecting a domain when entering a job narrows your future options for domains and hence jobs ? To make this question as broadly applicable as possible ... profession refers to all kinds of data analysts, from statisticians over machine learner programmers to data miners. imagine you were asked to give an ad...
I have a problem with this exercise in probability and statistics: Calculate the probability density function (PDF) of $$Z=X+Y$$ where $Y$ is discrete random variable which is equal to $-1$ and $1$ with equal probability; $X$ is a standard gaussian random variable independent of $Y$. I know that the PDF of the sum of ...
According to this post the best way to do post hoc analysis in ANOVA in R is t-test + ptukey. Because lme + glht "essentially assumes the sphericity assumption holds". How are t-test + ptukey "concerned about the sphericity"? What are the disadvantages of this method?
I want to check various classification model like random forest, tree, knn,etc. I used some bench marking data set but now I need to simulate my own data set with a binary response variable.
I have a microarray data which I ran through a continuous covariate (say "X"). I did this using 4 different methods. For the results obtained from each of the 4 methods, I have the following from each of the 4: p-value, FDR significant value, "Bonferonni significance" (saying "true" or "false") "Holm significance" (...
I would like to apply Kalman smoothing to a series of data sampled at irregular time points. There is a claim on Stack Exchange that "For irregular spaced time series it's easy to construct a Kalman filter", but I haven't been able to find any literature that specifically addresses this. In my situation, I'd like to us...
If I know the mean and variance of a discrete random variable $\in \{0,1,\dots \}$, How can I find the distribution?
I have a k-means clustering result with 35 clusters, there are 5000 documents that each belong to one of the 35 cluster. I would like to visualize the results of the clustering algorithm on a scatter plot (or something similar) where each document is colored based on which cluster they belong to, and their distance on ...
Imagine that I have 40 observations in region A, and 50 observations in region B. The total size of region A in square kilometers is 50km, and the total size of region B is 40km. Within each region, each observation has a count of events that ranges from 0 (fairly frequent) to 20. What is the best way to hypothesis tes...
Last year, we did a survey that asked people a question about their belief in climate change. The respondents could select 1 from a list of 5 categorical responses. In the fall, there was an event that we believe might affect respondents' climate change beliefs, so we're repeating the survey this year. I haven't done m...
Is the sample median an unbiased estimator of the population mean when the distribution is symmetric?
I am working with a dataset which looks essentially like the following: Name Average Score -------- -------------- John 34.9381 Susan 22.2718 Stu 29.1009 ... The assumption is that each average score is composed of integer-value single scores. I would like to know if there are any standard techniques o...
Is there a formula that is able to determine whether the difference between two co-efficients of variation is significant or if not is there a specific heuristic used to determine significance (i.e. cv<0.05)? I am curious of this because: I am trying to compare a data set with widely different means. I want to see if...
I am doing a multiple linear regression of factors related to poverty and would like to include some spatial-statistical data. I have come up with Anselin Local Moran's I values (cluster/outlier) data for census tracts in a metropolitan area, which I would like to include in the regression. However, the Anselin Local ...
I have a dataset and I want to do statistical analysis: session day type entity name RunningTime PLACE ---------------------------------------------------------------------- 1 29/09/10 1 Tera NikolaT 24:33 unknown 2 14/12/10 1 Vera EmmanuelF 22:...
I'm teaching a class on integration of functions of several variables and vector calculus this semester. The class is made up most of economics majors and engineering majors, with a smattering of math and physics folks as well. I taught this class last semester, and I found that a lot of the economics majors were rathe...
I've got a problem where $$y = a + b $$ I observe y, but neither $a$ nor $b$. I want to estimate $$b = f(x) + \epsilon$$ I can estimate $a$, using some sort of regression model. This gives me $\hat b$. I could then estimate $$\hat b = f(x) + \epsilon$$ First problem: a regression model to predict $a$ could lead to...
I have several classification systems which I want to compare. The way I evaluate each one of them is using precision, recall and f-score. I want to compare the performance of every two of them using some significance test to find out if the difference in the performance is due to noise or not. My question is - what wo...
What would be the best way of determining the statistical significance of the differences in concentration between trials of a dataset such as this one: +-------+---------------+ | Trial | Concentration | +-------+---------------+ | 1 | 2.41 | | 2 | 8.43 | | 3 | 3.48 | | 4 | 6...
I'm currently trying to generate a number of (rudimentary) models to perform classifications (or get probability distributions through classifications). Let's say that I have a particular video from YouTube: UMVC3 Grand Final AGE ChrisG vs TA Marvisto - Next Level Battle Circuit #3 Tournament Going through version 3 of...
I'm familiar with using insights from Random Matrix Theory to determine the number of principal components from the PCA of a covariance/correlation matrix to use to form factors. If the eigenvalue associated with the first PC is large, then it means that the remaining eigenvalues must be small (since the sum of the ei...
I have categorical data on Police Stations against Crime categories on a 2-way contingency table. I have an asymmetric row map and column map from correspondence analysis using XLSTAT. Which one of the two maps should be used to interpret the results?
Let's say I am interested in choosing a new country $c_1, \ldots, c_k$ to live in. For some reason I can only apply to one country and only once. I know for each country a set of 2000 observations (persons), each consisting of 20 attributes and for each I know whether they were accepted or rejected. (I also know my va...
I am trying to determine how to obtain within-group variance for a composite measure based on a set of (weighted) proportions. I have 50 groups being compared on 8 proportion measures, with 4 measures weighted as 1/5 and 4 measures weighted at 1/20. There is a composite score for each group that is the 8 rates multipl...
When I run my analysis with items with zero variance, sem in R would throw up a warning saying that items with zero variance exist. I then move on to remove these from the analysis. My question is: Are there any other ways of resolving this problem besides removing the items perhaps like adding a very small amount of ...
I have multiple logistic regression models with all of the same IVs/controls and a variety of DVs (all health outcomes from the same sample). The primary IV is the sum of types of childhood abuse (emotional, physical or sexual). I made dummy variables that represent any one type of experience, any two types of experien...
I'm looking for a dataset (preferably with a story, at any rate a real dataset) where a SVM with a linear kernel performs well...in other words i'm looking for a dataset where the class boundary is likely to be linear. Ideally, there should be between 10-20 continuous variables and not too many discrete ones.... It...
For given cost function $S(\beta) = (Y - X \beta)^T(Y - X \beta) + \lambda \beta^T \beta$, where $\lambda$ is regularization parameter, the $\beta$ that minimizes the given cost function is $\beta = [X^T X + \lambda]^{-1} X^T Y$. is it right?
I've been aching to get my feet wet with a machine learning project, and I've found one that should be relatively simple, and actually has non-negligible business value for my organization. The marketing guys have to remove bot activity from our tracking data by hand for their metrics. I wanted to pull some data from G...
I'm trying to do a simple scatterplot and trend line in R, but it doesn't look right. Have I messed up something blatantly obvious? Any ideas as to why the line doesn't fit the data? Here is the code I used. > plot(x, y, pch=".") > model <- lm(x ~ y) > summary(model) Call: lm(formula = x ~ y) Residuals: Min ...
What is the difference between the functions rnorm and runif in R?
I am starting to use GMM estimation of dynamic panels with fixed-effects in R, but couldn't find proper information on the differences between "two-ways" and "individual" effects. Both can be easily estimated in R, but I couldn't get the right conceptual difference. Any help or indication here will be most welcome.
Problem background: As part of my research, I have written two algorithms that can select a set of features from a data set (gene expression data from cancer patients). These features are then tested to see how well they can classify an unseen sample as either cancer or non-cancer. For each run of the algorithm, a so...
Say I have the following data, % students below average in math: S1 % of students at proficient level in math: S2 % of students at above proficient level: S3 S1 + S2 + S3 = 100% If I have this distribution across multiple classes and multiple years, how can I do a comparitive assesment ? A naive score would be a wei...
There are several tests for randomness, one is runs up and down, another is run against mean or some other values, of cause, Bartel's rank test can also be used. There are studies shows where Bartel's rank test is more powerful than run up&down, and a pure guess could be that the runs up & down is more powerful than ru...