instruction
stringlengths
9
38.7k
I'm creating a program where my goal is to analyse lists of ticket prices and locate tickets that are priced abnormally low in relation to the spread of prices. My preliminary model does the following to the price list in this order..(examples are at the end of my writeup - they include the modifications made after run...
I'm seeking your help in understanding the difference between two different contrasts for dichotomous variables. On this page: http://www.psychstat.missouristate.edu/multibook/mlt08.htm under "Dichotomous Predictor Variables", there are two ways to code dichotomous predictors: using the contrast 0,1 or the contrast 1,-...
Explain why log(dose) and log(time) are used to measure the association between dose and time instead of the actual values of dose and time.
I would like to simulate a multiple linear regression model using R. If I have the skewness and kurtosis for the residuals, how can I do that?
I understand that the basic definition of endogeneity is that $$ X'\epsilon=0 $$ is not satisfied, but what does this mean in a real world sense? I read the Wikipedia article, with the supply and demand example, trying to make sense of it, but it didn't really help. I've heard the other description of endogenous and ...
I am trying to define a simple measure for mean reversion in a stochastic sequence of ones and zeros, which I denote by $x_t$. Yes, a unit root test on the cumulative sum could be a viable choice, but I started off by correlating the current value of the stochastic process with the deviation of the cumulative sum from ...
As far as I understand, the training phase usually uses the dual optimization formulation where we can implicitly calculate the weight vector which defines the discriminant function. How about the prediction phase, how do we use these weights and the kernel function when a new test sample arrives? edit: I should clarif...
I have recently as part of my bachelor project at my university conducted a two-alternative forced choice test. I have looked at ways to say something with significance about which images (the test participants were given a set of 4 pairs of images, for each pair they had to choose one). While testing is emphasized in ...
Found this question here, and I couldn't answser it and thought it would be a wonderful question for this site. Here's a little thought experiment for your weekend pleasure. Consider the following: Joe Scientist decides to conduct a study (call it Study A) to test the hypothesis that a parameter D > 0 vs. the null hyp...
I developed a conditional logit model in Stata. The model is good and the variables are highly significant. Then I do mfx predicted (PU0) to determine the marginal effects of variables $\frac{dy}{dx}$. The problem is when I get the table of the marginal effects of variables in Stata: the significance of the variables ...
What is the probability that a random number [0,1) will lie in [0.5,0.6]? As far as I know, there are 3 probability distributions in physics we usually use, but I am not sure when we can use Gaussian, Exponential and uniform distribution. Any examples?
In Cohrans C-test you take the ratio between the largest variance in a set of populations divided by the sum of all variances. This ratio is the test statistic for which you can look up tabulated p-values, and reject or accept $H_0$. This comes straight from examples from a book (A.J. Underwood, Experiments in ecology)...
I'm working on my BSc dissertation currently. One of my variables is created using the ratio of one continuous (mostly) normally distributed variable to another. The distribution of ratio is very highly leptokurtic with outliers (kurtosis/s.e. = 183) and I was wondering if there was any transformation that I could use ...
Hypothetically, say I have I have three manifest variables measuring anxiety and three manifest variables (items) measuring stress. Then I want to use both to predict scores on depression, which I'm also assessing via three manifest variables. I could simply add the scores on each of the manifest variables and create c...
I'd like to run a grid search cross-validation on the probability outputs of the SVC classifier. In particular I'd like to minimize the negative log likelihood. Is this a reasonable thing to do? I'm doing it b/c the dataset is: a) imbalanced 5:1 and b) not at all separable i.e. even the "worst" observations have a > 5...
I used the MATLAB code written below to create the following probability density function. It creates the familiar hill-shaped distribution. I'm interested to see (whether via MATLAB code or just an linked image) a PDF plot of a distribution that is univariate normal but is multivariate platykurtic or multivariate lep...
I have a dataset (vector) to which I would like to fit a gamma distribution (x), which given the shape seems reasonable. The charts below show the histograms of the two dataset: vector and x. The left is my sample set, the right is a random generated set. I did this as following; first: require(MASS) fitdistr(vector...
I have been struggling with this question all day, reading everything I could find, but still do not have a clear answer. A part of my research was that: 30 students tried a new educational instrument (virtual patient). Before the interaction with the patient they filled in 18 Likert items, from 1 to 5 (1=highly disagr...
I'm having some troubles with the implementation in pyMC of my probabilistic model. Note: you can skip directly to the code section, if you're not interested on the use of the model. The model itself is going to be used to extrapolate information about different the style of a 3D model (and the individual styles of eac...
I've a dataset containing at most 150 examples (split into training & test), with many features (higher than 1000). I need to compare classifiers and feature selection methods which perform well on data. So, I'm using three classification methods (J48, NB, SVM) and 2 feature selection methods (CFS, WrapperSubset) with ...
The problem I am having is that I have a distribution that I want to remain the same shape, but the mean and variance altered. When I use scale() in R, it can change to a standard normal, but I am having trouble to get other distributions (as when you change the mean, it also affects the standard deviation and vice ver...
I'm trying to plot a Kaplan-Meier curve of my data with R. Currently, the data is in the following format: patient_id;number_of_days;survival 1 ;100 ;T 1 ;200 ;F 1 ;300 ;F 2 ;50 ;F ... Survival in my context is not to be interpreted literally: it...
Recently I started doing verification on daily temperature forecasts by different providers. I calculated the absolute forecast errors for each of the providers, and I am planning on performing ANOVA to check if the differences in mean absolute error between the providers is significant. So lets say that my sample cons...
Is the purpose of permutation test to test the null that several groups of samples come from the same distribution? I found its steps are The steps in a permutation-based computation of the significance level of a test statistic are as follows: i) Choose a test statistic, eg. a t-score for a comparison of two groups, ...
I have been reading a paper by Cole, Ciesla, and Steiger, which argues in many cases allowing residuals to correlate is justified. However, I am not entirely sure what it means for residuals to correlate. A good definition and example would be much appreciated. Cole, D. A., Ciesla, J. A., & Steiger, J. H. (2007). The ...
In statistical inference, it's common that investigators will report the results from Wald tests for simple univariate inference or likelihood ratio tests for nested models. However, in regression modeling, under standard assumptions about the normality of errors, the F-test is exact and equally powerful in finite samp...
So I have some data of which I'm looking at two different metrics, the first being "how sick a person is (higher = sicker)", and the second being "the presence of adverse events", and I've run 20 experiments: table= Columns 1 through 11 1 0 1 1 0 0 1 1 2 0 2 0 0 ...
I have some values from different repetitions of different experiments and I need to plot cumulative distribution function. You can see a fraction of my file below. can you help me how can i do that. Experiment Replication Obs General0 0 1.294602161803 General0 0 1.094633445207 General0 0 0.844958280328 General0 0 0...
I wonder, what are the available libraries in R or Python to do correlation matrix clustering (sometimes it is referred to clustering). I also, wonder, after clustering/grouping each point. What is the most efficient and fast (not digging out pair of nodes again) way to rebuild and sort the matrix in a way that similar...
I am comparing two distributions using the Kolmogorov-Smirnov test [ks.test()] in R and would like to know what the numerical value is where $D_\text{max}$ occurs. It's not in the output of ks.test() as far as I can see, so I was wondering if anyone had any ideas about how I could find that out. Thanks!
I am using Mallow's Distance (normalized Earth Mover's Distance) to characterize the similarity between two histograms. This is working very well, but I would like to identify a specific cut-off where the distance represents a statistically significant value. Effectively what I would like to do is perform a hypothesis ...
So I have 1000 variables (different lakes), each with 12 observations (each lake was tested once a year for 12 years). Some of the lakes are really small, so we think they have way too much variation. My task is to determine exactly what is too much variation, trying to figure out which lakes we should eliminate. I was...
I have two variables, one continuous and one categorical which I currently both use as predictor variables in a logistic regression model. Their relationship is shown in the following plot with the x axis showing the different categories of the categorical variable and the y axis showing the values of the continuous p...
In "Elements of Bayesian Statistics" (1990), Florens, Mouchart and Rolin describe two basic forms of reduction of a Bayesian experiment: Marginalization and Conditioning (Ch. 1). I don't understand the conditioning reduction. More precisely, i struggle with the definition of a regular conditional experiment. I would ap...
I am trying to generate confidence intervals for estimates of numbers of fish observed with a very small number of surveys. Most of the numbers of fish observed are very small as well. The estimate is based upon the ratio of the number of adult fish and redds (fish nests) observed during the observation season. exampl...
I'm interested in testing a sequence of numbers for randomness. I've done some searching and come across die hard and die harder. However these tests seem to require some expertise to apply, or at least aren't as well documented or easy to use as R, say. Also die harder require a *nix platform. I'm working on windows p...
I am experimenting with neural network package in R nnet and i have some questions. The regulatory environment i am working on requires me to reproduce my results to show them to the auditors. How can i reproduce my model results after few months/years ? Can i use a seed value to control the model output ? How can i v...
Say I fit a multiple regression of p explanatory variables. The t-test will allow me to check if any single one of those is significant ($H_0: \beta_i = 0$). I can do a partial F-test to check if some subset of them is significant ($H_0: \beta_i=\beta_j=...=\beta_k=0$). What I often see though is that someone gets 5 p-...
I have all the data and an ODE system of three equations which has 9 unknown coefficients (a1, a2,..., a9). dS/dt = a1*S+a2*D+a3*F dD/dt = a4*S+a5*D+a6*F dF/dt = a7*S+a8*D+a9*F t = [0 1 2 3 4 5 6 7 8 9 10 11] S = [17110 18045 19898 22069 23621 24414 24294 24433 24302 23107 22074 21162] D = [1157.33 1231.92 1248.94 11...
The feedback I received from my initial post seemed to indicate that my question was ill-posed. Hence, I would like to clarify what I am doing and how I hope to achieve it. I'm running some simulations on models with a material parameter $g(x)$ whose values, according to the literature I've read, are log-normally dist...
I have read that controlling FDR is less stringent than controlling FWER, such as in Wikipedia: FDR controlling procedures exert a less stringent control over false discovery compared to familywise error rate (FWER) procedures (such as the Bonferroni correction). This increases power at the cost of increasing the rate...
I would like to do power analyses for hypothesis tests of (non-)equality of proportions in which the proportions are very small. I would like to do so without using normal (or Poisson) approximations of the binomial distribution. There are several general types of power questions I'd like to be able to address. Post...
Specifically in the case where I don't know anything about the documents I'm working with. I'm looking a specific number or number range.
EDIT STARTS After seeing the comments and answers, I believe I started in a wrong direction. I have a set of rectangles, which I want to cluster as shown below. . The approach I took was to consider central points of each rectangle as a data point in $R^2$ and cluster them using Euclidean distance (K-means, K-mediods a...
I have data about a certain workforce, with different worker types W1, W2, W3, W4, etc. I need a method to visualise the relationship between each worker type. In particular, I'm interested in visualising the proportion of each worker type (e.g., W1, W2, W3, etc.) that works with each other worker type. Essentially, a...
I have a question about the rugarch package. My sample size is 43 and I have a problem to model a garch whose mean equation includes an exogenous model; otherwise my mean equation is linear regression, that is, $y_i=a+bx_i+e_i$ that $i=1, \ldots, 43$ and $e_i$ follow a $\text{garch}(1,1)$. But when I run it simultaneo...
I am learning about ACF and PACF graphs. I am not sure I understand how to interpret the one I got for my data. I have searched google for some ACF and PACF examples, and I found some samples of different processes, however, the one I am getting doesn't look similar to any. Does this means there is no seasonality, tren...
Suppose that there is a data-generating process $$ y = \alpha + g(x) + \epsilon $$ which is to say that an outcome is some function of $x$. Suppose that $x$ is randomly assigned, so $\text{Cov}(x,\epsilon)=0$. But the functional form mappying $x$ to $y$ is unknown. Say that $y$ is continuous and the variance of $\ep...
I wish to analyse the following : Independent Variable (IV): User of online financial reports Perceived usefulness and Perceived Quality (Sub to Relevance, Reliability, Understandability, Comparability and Timeliness) (all using 5-point Likert scale.) towards Internet Financial Reporting in Malaysia. Dependent Variable...
On page 110 of McFadden,1973 - Conditional logit analysis of Qualitative Choice Behavior, Frontiers in Economics, ed Zarembka, New York: Academic Press, pp. 105-142 the following three Axioms are made: Axiom 1: Independence of Irrelevant Alternatives (IIA): For all possible sets $B$, measured attributes $s$, and memb...
Can you suggest me any random effect linear model in R? At the moment I am using lmer, but I would like to know if there is any other similar function. Thank you
I have a distribution of frequencies (1000 data points) expressed as %. The list of data looks like this: 3.10% 1.80% 1.70% 1.70% 1.60% 1.60% 1.50% I would like to check for normality distribution of such data using for example the Shapiro test. I would like to know if I have to rem...
I want to fit a Gaussian Process with about 50,000 training examples and 130 features using Scikit-learn. Right now, I only have 1 theta hyperparameters as I run the process with all defaults. But I get a MemoryError when it tries to compute the covariance matrix. This is where I get the error https://github.com/sciki...
For a publication I'm looking for references for generic requirements of evaluation/fitness functions in evolutionary (more specifically genetic) algorithms. I could come up with some requirements myself (efficient implementation, intuitive results, etc.) but I would like some references to existing work, since it shou...
I've recently extended my genetic algorithm in such a way that it constructs a Pareto front, instead of weighing the different quality dimensions. The quality dimensions are not related to 'spacial' information, so no natural x,y,z candidates. They are real quality dimensions (for instance recall, precision, cost, etc....
I am trying to understand the way MA(q) models work. For this purpose I have created a simple data set with only three values. I then adapted a MA(1) model to it. The results are shown below: x<-c(2,5,3) m<-arima(x,order=c(0,0,1)) Series: x ARIMA(0,0,1) with non-zero mean Coefficients: ma1 intercept ...
I am analysing ordinal, non-normally distributed dependent measures using Spearman's rho. Specifically, we have an independent groups design, and I have found a significant relationship between the variables in one group but not the other (running separate Spearman's analyses for each group). I wish to test the differ...
With respect to hypothesis testing, estimating samples sizes is done through power, and it is intuitive that increasing the same size increases the precision of estimated effects. But what about prediction for both classification and regression? What aspects of the prediction problem are influenced by sample size other...
I'm reading up on Bayesian techniques for Linear models and time series. While the texts are great at teaching the theory I would like to get a better handle on the pro's/con's of Bayesian analysis vs their frequentist equivalents. I can't find an article or even articles that do this. I really want it as a fairly hig...
I am not quite sure what the differences are between the outputs and results of disstreedisplay and seqtreedisplay. Maybe you could explain me the differences? The TraMineR users guide and the otherwise detailed working paper about the WeightedCluster library do not explain so much about that. Here is my example R scr...
I am performing a temperature preference test in mice. Mice are placed into a chamber with one half of a chamber having a cold floor and the other half having a warm floor. Mice spend a specific total time in the chamber (3 min) and can select the cold or warm part of the chamber. I calculate the time (in percent of th...
My experimental setup is the following: compute an optimal solution $S$ to problem $A$ on instance $I$, evaluate test statistic $f(S)$, compute $f(S_i)$ for $S_i$ $(0 \leq i \leq n)$ drawn from a uniform distribution of feasible solutions to $A$, and compute a p-value for S. The null hypothesis is that $f$ is not c...
I need to calculate MR but my data consists of many dummy variables. I had a question in my survey that asked for the budget/month. But instead of giving the option to fill in a value, I offered ranges (steps of 250, so I have like 0-250; 250.01-500 and so on) I created dummy variables for these different steps so now ...
According to http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm Agresti-Coull intervals cannot be negative; however using the formula from Wikipedia as well as the binom.confint function in R with x = 0 and n = 5 produces an interval of (-0.05457239, 0.4890549). Are there conflicting definitions of Agresti...
I am using three categorical predictor variables $X_1$, $X_2$, $X_3$ and one continuous dependent variable $Y$, and I want to treat $X_3$ as a random effect. The simplest model I could come with: M1<-lme(Y~X1*X2, random=~1|X3,method="ML") Here are some more complex models: M2<-lme(Y~X1*X2, random=~1+X1|X3,method="ML")...
I'm trying to determine statistical significance of inputs on the dependent variable using neural networks. I'm trying to test the null hypothesis that the partial derivatives are equal to zero. I found a method called Bootstrapping but it requires to retrain the neural network a 1000 times. Is there any alternative le...
I have a questionnaire with one "open" text box, and 20,000 responses. I'm not planning to read all of them, but I'm thinking of interesting things to do with them. A general tag cloud would not be very interesting (I can predict which words would be the biggest), but it would be fun to split it along another categoric...
say I have a sensor that measures temperature, pressure ++, and want to use this data to predict some quantity "A". If I use multivariate regression, I can simply implement a model of the form A=a0+a1x1+a2x2+..., and whenever I have new measurements I can use the model to make predictions. If I on the other hand make a...
I am trying to fit a model with lagged variables. The problem is: In a big classroom with windows open, the outside temperature, humidity and solar activity will lead to variation in the concentration of pollutants. However, the effects is delayed. What a model should I try to fit if I want to analyze the delayed effe...
Please correct me where I'm wrong: My understanding of bootstrapping is that it is a way to estimate the distribution of some statistic (mean, standard error, Pearson's correlation coeff, etc), given only one sample. So if I want to estimate the mean of a population using bootstrap methods, I generate many bootstrap sa...
Could someone please explain change point to me. I'm using the package in R, and I don't really understand what the different methods mean, the pros and cons of each, and I especially do not understand the penalty value. When you increase the penalty value, what does that mean and what does it do? I have done a good am...
I have calculated a Durbin-Watson test and got as far as $$\eqalign{ d&=2.207551844, \\ dL&= 1.6164, \\ dU&= 1.7896. }$$ I want to test $$H_0 \gt 0,\ H_1 \le 0.$$ However, I do not really know if I can reject $H_0$. What would happen if $H_0 \lt 0, H_1 \ge 0$? Please give me a hint on the interpretation of such a tes...
I would appreciate it if someone could explain the concept of spurious regression intuitively / without it being too technical. So far the student understands that spurious regression is basically when two processes have no relation with each other, but would still conclude that there is one using statistical significa...
I'm about to open the door to a very thorny issue in the social sciences. How does one correctly model and test hypotheses about mediating variables using observational data? I'm familiar with the Baron-Kenny approach to mediation (see previous answer here), and also with structural equation modeling. However, I've h...
Suppose I have $m$ competing models. Suppose also that I could classify these models into $s$ sets. For example, I could classify models of migration behavior conditional on climatic conditions by the geographic scope (global vs. local) of the climate measures. Now suppose I fit all of these models and calculate the in...
If you want to test whether two variables follow the same distribution, would it be a good test to simply sort both variables, and then check their correlation? If it is high (at least 0.9?), then the variables most likely come from the same distribution. With distribution here I mean "normal", "chi-square", "gamma" et...
When performing a multiple regression with dummy variables, is it really necessary to include an intercept term in the design matrix? By dummy variables, I mean indicator variables; a one in the design matrix if some effect is present, and a zero if not. It seems to me that without the intercept it is simpler to int...
Is there any R package that can produce cube plots for 2 factors (in fact it is a square plot)? I want something similar to the first plot at the end of this page on factorial plots. In the package FrF2 there is the command cubeplot but only for 3 factors. Of course, I can use 2 identical factors, but I want images w...
In explaining simple linear regression, isn't it a bit misleading for many examples to illustrate a straight line going through some scatterplot? This seems to suggest that linear regression only works if your independent and dependent variables have some sort of straight-line relationship, whereas the "linear" in line...
I have a dataset which is statistics from a web discussion forum. I'm looking at the distribution of the number of replies a topic is expected to have. In particular, I've created a dataset which has a list of topic reply counts, and then the count of topics which have that number of replies. "num_replies","count" 0,62...
I was reading the multiple regression chapter of Data Analysis and Graphics Using R: An Example-Based Approach and was a bit confused to find out that it recommends checking for linear relationships between explanatory variables (using a scatterplot) and, in case there aren't any, transforming them so they do become mo...
I have following variables in my dataset: Working hours (numerical:ordinal) Effectiveness (categorical:ordinal ; 4 values-> (poor,average,good,best)) Satisfaction (categorical:ordinal ; 4 values-> (poor,average,good,best)) I want to cluster the data on the basis of how good is my worker. I am expecting 4-5 clusters ...
When should I use quadratic weighted kappa or linear weighted kappa? I have two observers evaluating the classes of a number of objects. The classes are fail, pass1, pass2, and excellent (ordinal scale). The errors in classification between "fail" or "excellent" and the different degrees of "pass" are more severe than ...
I am looking at the spatial patterns of turnover in aquatic assemblages using gradient forest and generalized dissimilarity models in R. I have species and environmental data for more than 400 sites sampled from streams across the country. However, I also have many missing values in my predictor (environmental) variabl...
I have a set of observations. When I do an OLS I get a $\beta$. After I remove some values I also get a $\beta$. Now I want to test if the properties of two betas are the same? Please give me a hint how to do that?
I perform prequential evaluation like this: start with a training set, classify a number of examples, then add the correctly classified examples in the training set and continue to classifying the next number of unseen examples. Is this supposed to increase performance as examples are added to the training set or this ...
I have numerous road segments that belong to a city. Each road segment as a weight that is given to it due to its level of 'connectivity' (‘impact’from a small side street to a motorway). So, small neighbourhood road networks won’t have much weight at the regional level. These are calculated at different radii from eac...
I'am getting more and more familiar with this kind of model (and others models too). I'm now used to fit this model with my data (rmgarch package in R). How is it done ? What is the theory behind parameters estimators ? I think about a maximum likelihood process, but I would like a confirmation and precision.
In experiment I have measured the grow of one plant on 40 locations. At one location different number of plants were measured, but always the same species. The distribution of response variable is log-normal. I wanted to show the distribution in the post but it is not possible because I'm new user of stats.stackexchang...
I am using forecast() package in R to predict future values. I have a time series data for approx 6-7 years. First, I split the data into training set and test set. Test set contained values of the last 12 months of original data. Then, applied ets() and auto.arima() on the training set. This can be done by iterating 1...
Hi I have a set of data(message with different size) in excel like (over 5000 entries): message Name MessageSize message1 0.5M message2 10.2M message3 2.1M ... message n-1 40.52M message n 12.12M I have successfully gen...
I've seen some statement where I got the impression that SVM with a quadratic loss is no more than having a kernel matrix where a multiple of the unit matrix is subtracted from the kernel. It was shown that in the dual problem the L2 loss constant can be merged into the kernel. But it wasn't clear to me. So the questio...
How can I generate events using the Poisson distribution in R? The events could be the occurrence of floods in the next 1000 years at a given rate of occurrence per year.
Within my logistic regression models I use cross-national data in order to say something about individual soft drug tolerance. In total I have 29 countries with 37.000 individuals. My supervisor wants me to find some theoretical fundament to the rule of thumb I have used (and she proposed), namely the fact that for ev...
it is straight forward to search for purely additive models using the rfe function in caret. Is it possible to include all interactions as part of the search? In the train method, we can simply say train(Y~.^2, data) to include interactions, but I have not found a way to do this in rfe. I could probably just make a dat...
I have a binary logistic regression model with a DV (disease: yes/no) and 5 predictors (demographics [age, gender, tobacco smoking (yes/no)], a medical index (ordinal) and one random treatment [yes/no]). I have also modeled all the two-sided interaction terms. The main variables are centered and there is no sign of mul...
I’m trying to model a time series (log_consommation) in a ARIMA(p,d,q) using Stata. So I start by determining d by transforming my time series to make it stationary. My question is, when performing an augmented Dickey Fuller test to test stationarity, I have to choose the number of lags. Is this number of lags related ...
Can anyone help me in re-scaling a five point likert scale into three categories using the mean scores. I have used a 5 point likert scale: (1) Not at all, (2) low, (3) moderate, (4) high and (5) very high Now I want to categorize these into Low, Moderate and High, but I am not sure how to use use the result. I p...
Is the following formula right if I want to measure the standard error of the median in case of a small sample with non normal distribution (I'm using python)? sigma=np.std(data) n=len(data) sigma_median=1.253*sigma/np.sqrt(n)
Just started getting into machine-learning, and I'm wondering if there is a relationship between the Perceptron learning algorithm and linear regression?