instruction
stringlengths
9
38.7k
Does anyone know how to interpret a coefficient when the variable in the model is the reciprocal of the original variable? I have an inverse equation, where $\text{time} = \beta_0 + \beta_1(1/\text{horsepower})$, where $\text{time}$ is how long it takes to accelerate a car. I need to hypothesize the sign of the variabl...
I am trying to calculate the effect size for a trait adjusted for my set of nuisance variables. My models looks like this: Trait ~ Dx + Age + Sex Where "Trait" is a continuous variable and "Dx" is a binary group membership variable. I'm using this basic formula to get an effect size estimate: (mean(Trait[which(Dx==0)...
I have observed the historical PE (price / profit) value of a stock and realized that it roughly follows a log normal distribution. However, even when the next earning data point is easily predictable, this distribution cannot be used to predict the distribution of next stock price data point, because, the next PE valu...
Suppose that we choose the size of the test to be $\alpha = 0.05$, and based on our sample size $n$ and magnitude of the absolute value of the estimate, we determine that the test's power (i.e., 1 - Prob(Type 2 Error)) is $99.9\%$. If I then fail to reject $H_0=0$ against $H_a \not= 0$, what consequences does this hav...
How to find the median (or approximate median) of n chunks of values. The values in each chunk can be assumed to have been sorted if it helps. In addition, the existence of a histogram for each chunk is allowed.
Regarding the standard DID model: $$ y=\alpha+\beta_1\text{treat}+\beta_2\text{post}+\beta_3\text{treat⋅post}+u $$ What exactly does it mean if say $\beta_3$ is not statistically significant, but $\beta_1$ is? Does the significance of $\beta_1$ just mean that my control group and my experimental group differed in the v...
I have a model for predicting multiple count variables (multivariate count regression) given some covariates. Are there any publicly available datasets I could experiment with?
In the simple linear regression case $y=\beta_0+\beta_1x$, you can derive the least square estimator $\hat\beta_1=\frac{\sum(x_i-\bar x)(y_i-\bar y)}{\sum(x_i-\bar x)^2}$ such that you don't have to know $\hat\beta_0$ to estimate $\hat\beta_1$ Suppose I have $y=\beta_1x_1+\beta_2x_2$, how do I derive $\hat\beta_1$ with...
I want to evaluate the skills of a trainer who has taught 4 different computer languages to a batch of 150 students. I have prepared a questionnaire, which I will give to each of the students. But I am yet to decide the scale on which the students will be evaluating the skill of the trainer for those 4 languages. I f...
I was reading this paper related to bayesian spatial scan statistics. http://books.nips.cc/papers/files/nips18/NIPS2005_0513.pdf. It's said that when we use bayesian spatial scan statistics, we don't need to use the randomization testing or significance testing of the found potential cluster. Why is it so? I didn't get...
In your opinion, what is the best way of handling Bayesian networks using continuous data, in this particular case, p-values? I have read about several discretization techniques, Gaussian approaches, etc., but I'm quite lost due the controversies each approach has. Also, while I found a lot of literature regarding how...
For mixed models with random intercepts only, the statistic for R square is $$R^2 = (V_{int\ only} - V_{full\ model}) / V_{int\ only}$$ My question is: How to estimate R square in mixed models with random effects? And estimate R square for each level? Let's say it's a 3-level model with random effects of time at level ...
I'm interested to know if it is recommended to scale a matrix from some integer range (e.g 0-255) to [0.0-1.0] before running a PCA. Does it affect the floating point error?
I am trying to understand “higher order asymptotics”. I find several texts on Likelihood asymptotics, nothing’s easy to read... if you have any nice pointers on this direction, I’ll be interested; however my main question follows. The following ”roadmap“ to higher order asymptotics seems natural to me, and seems someth...
I have two linear models: $$ y_1 = \mu_1 + \beta_1x + \epsilon_1 $$ $$ y_2 = \mu_2 + \beta_2x + \epsilon_2 $$ where $\epsilon_1, \epsilon_2 \sim \text{MVN}(0, \Sigma(x))$, where $\Sigma(x)$ in NOT diagonal. At the moment I'm regressing $y_1$ and $y_2$ on $x$, then I'm calculating the squared residuals $\epsilon_1^2$, $...
I observed 21 times a response that could be one out of 8 categories (multinomial response). I computed the proportions for each category. I did it independently 12 times. Hence I have 12 replicates for each proportion. Is bootstrapping the mean proportion over the 12 replicates for getting the confidence interval a go...
I have two variable in my research. the first is managers commitment & the second is personnel satisfaction. so we have two population & two questionnaire, one for managers & the other with "different" questions for personnel. moreover the number of managers is different from the number of personnel. how can I calculat...
What is autocorrelation and how it can effect the results of multiple regression in SPSS. Durbin-Watson value of 1.04 is acceptable or not? If this value effects the results, then how to correct it in SPSS.
I am using binary logistic regression; the dependent variable is 1 or 0; the independent variables are two groups: the first group includes continuous variables (LNTA: logarthim of total assets, ROA: return on assets, and Leverage; the second group includes categorical variables (Type of auditor: 1 or 0, Industry secto...
This is a very basic question on using R for classification. I'm trying to use rpart for classification task and would like to have a class label as a result, i.e. I use type="class" in predict method predict(tree, data, type = "class") The class labels are "0" and "1". When I try to classify a single observation I ge...
I came across variance stabilizing transformation while reading Kaggle Essay Eval method. They use a variance stabilization transformation to transform kappa values before taking their mean and then transform them back. Even after reading the wiki on variance stabilizing transforms I can't understand, why do we actuall...
I have 5 different posterior distributions (mcmc samples) which all estimate the same parameter beta. The 5 models are all obtained from 5 independent standardized datasets but estimate the same parameter. What I want to obtain is a single posterior distribution, combining information of my five original distribution. ...
Not sure if normalize is the correct word to use here, but I will try my best to illustrate what I am trying to ask. The estimator used here is least squares. Suppose you have $y=\beta_0+\beta_1x_1$, you can center it around the mean by $y=\beta_0'+\beta_1x_1'$ where $\beta_0'=\beta_0+\beta_1\bar x_1$ and $x_1'=x-\bar ...
For the repeated measures design D.C.Montgomery in his "Design and Analysis of Experiments" book provides the mathematical / statistical (linear) model (with changes): $y_{ij} = \mu + \beta_i + \tau_j + \epsilon_{ij}$, where $\beta$ is a parameter associated with the $i$th subject, $\tau$ is the effect of the $j$th tre...
Let the first document involve the words $\{x_1,x_2,\ldots,x_n\}$ and the second one be composed of $\{y_1,y_2,\ldots,y_m\}$ where $n$ is not necessarily equal to $m$. I have a similarity measure that works for elements of the sets; $s(x_i,y_j)$ for all $i$ and $j$. This similarity may not be symmetric, that is, $s(x_i...
I'm trying to derive a kernel-ized $l_1$ penalty for logistic regression. I have been looking at the slides Learning with Sparsity Inducing Norms along with the slides on Regularization and Variable Selection via the Elastic Net. On page 20 of reference 2 they add a $l_1$ penalty of the form $\lambda_1\sum_{i=1}^n|\alp...
I have a project to improve user experience in our software by gathering data on their actions while using the software and comparing that to preferences they made when initializing the software. The idea is that if they say they like Coke but they keep drinking Pepsi, we would (1) ask "Are you sure you like Coke, not ...
I am looking for deep learning libraries that have very good tutorials or examples, since I would like to learn by examples or doing tutorials even if these are not the best deep learning libraries. If they also run on GPUs much better.
On this page, I read about multiple ways to deal with multicollinearity. I determined that the last method suggested may be best for my purposes. I copied it below: Treat the common variance as a separate variable and decontaminate each covariate by regressing them on the others and using the residuals. That is, a...
I have 149 locations that are lined up from east to west. I have the geographical distances between each location and the adjacent location going west. I want to test whether the locations are randomly distributed or not. Therefore, I take the furthest west location and the furthest east location, and generate 145 rand...
I have a large amount of vegetation data that has been broken down into 13 habitat classes. I am trying to determine which vegetation tends to fall into or is absent from which habitat with any sort of significance. I have been put onto running a multinomial logistic regression, specifically using glmnet (as I have app...
I've been using the KernSmoothIRT module in R to do non-parametric analysis of some items. I'm trying to find a way to quantify the difficulty and discrimination of a particular set of items. What is the best way to do this with this module? Geometrically, I think I'm looking for the value of OCC at theta=0 and the...
Any idea why we don't use significant digits in statistics? Something along the line of we are using estimates so rules about precision don't apply ;) ?
First question: Is the following example of computing the Hausman-test for endogeneity with two endogenous regressors adequate? Second question: Is it true that in case of heteroscedasticity, i.e. I'll get a significant result for the Breusch-Pragan-Test, I need to run a Durbin-Watson-Wu-Test for endogeneity with hete...
I just re-watched a lecture from the Machine Learning course on Coursera. In the section where the professor discusses PCA for pre-processing data in supervised learning applications, he says PCA should only be performed on the training data and then the mapping is used to transform the cross validation and test sets....
Suppose that X = N(0,1) and Y = N(1,1), and assume that X and Y are independent. Determine the distribution of W = X - 2Y .
Let's say I'm trying to find out the probability that someone's favorite ice cream flavor is vanilla. I know that the person also enjoys horror movies. I want to find out the probability that the person's favorite ice cream is vanilla given that they enjoy horror movies. I know the following things: $5\%$ of people c...
Given an collection of mass values (in $g$) which are samples collected over a minute in a moving-window fashion (thus their sum represents the mass per minute observed in the system), and a formula which derives an area (in $cm^2$) for each value (based on certain assumptions about the mass distribution -- e.g., by us...
I've been trying to familiarize myself with some of the statistics behind conducting A/B testing on a website and trying to pick a relevant sample size. I've come across several articles that talk about power analysis (this is the best one that I have come across), and I'm trying to dive a little more into the theory. ...
What does it means if no CI was given for binary logistic regression analysis in SPSS output?
I've got a dataset on agricultural trials. My response variable is a response ratio: log(treatment/control). I'm interested in what mediates the difference, so I'm running RE meta-regressions (unweighted, because is seems pretty clear that effect size is uncorrelated with variance of estimates). Each study reports ...
I am in desperate need for help. I am trying to calculate the likehood ratio test in R, but I don't have allot of experience using R. For example, to calculate the following Suppose $X_1, X_2,\ldots, X_n$ is a random sample from a normal population with mean $\mu$ and variance $16$. Find the test with the best critical...
I am dealing with linear data with outliers, some of which are at more the 5 standard deviations away from the estimated regression line. I'm looking for a linear regression technique that reduces the influence of these points. So far what I did is to estimate the regression line with all the data, then discard the da...
I have a conditional Laplace prior: $$ \pi(\boldsymbol{\beta}|\sigma^2) = \prod\limits_{j=1}^{p}\frac{\lambda}{2\sqrt{\sigma^2}}e^{-\lambda|\beta_j|/\sqrt{\sigma^2}} $$ and a marginal prior on $\sigma^2$, $\pi(\sigma^2)$. I want to decompose this Laplace prior for a hierarchical representation of a model. I know that t...
I don't know how many steps are necessary for lars() to select the variables till the algorithm proceeds to the saturated fit (especially using the lars package in R)? Can anyone give me a hint?
"Customers arrive at a bank according to a Poisson process with rate 6 per hour. State (together with a proof) clearly the (conditional) probability mass function of the numbers of customers arrived during the first 20 minutes, given that 10 customers have arrived during the first hour." I did this: $$ P(X_{\frac{1}{3}...
I wish to "predict" the number of bugs my company will cause using a linear regression. For any given piece of development, the prediction is not great ($r^2 = .2$). However, my real task is to predict, company-wide, how many bugs we'll produce in a week. My errors are roughly zero-mean, so in this aggregated data set ...
I would like to use tslm with data that has intraday seasonality and a different pattern on business days and on non-business days. If data.ts is my time series then I would like to use something like tslm(data.ts~season|businesss.dummy) Thus I want to model season given that the dummy for this hour is True or False. ...
I am studying Machine Learning and implementing ML algorithms with Matlab. I follow Ethem Alpaydin, Duda and Hart, Bishop and Mitchell's books. However none of them exactly give the pseudo codes and algorithm based examples and code snippets as usual. Are there any books which follow topics with code examples with Mat...
My data set has the following variables: Treatment (4 types- fixed) Location (8 locations- fixed) Position in Location (3 positions per location- fixed) Samples are taken in each position (3 samples per position-random) Time (two sampling times - fixed) Mineralisation rate (as result of analysis of samples taken) ...
I'm caring monte-carlo simulations and I am checking my code for some faults. I have just realized (the hard way) that to generate a unit vector pointing in a random direction I cannot simply pick 3 (or any other number) random number and normalize them. I didn't understand why I can't do this apart from the claim that...
Is there any easy-to-use software for Tukey median-polishing rows and columns with lots of missing values?
I have data that appears very well-suited to discrete-time survival analysis, in that each subject has a consecutive sequence of observations from its entry into the system until its exit, and I'm interested in determining the likelihood that a subject will leave the system in the next time period. The catch is that t...
I am looking at the variable vs response plot, and it seems categorical for most observations, but some are not. Here is a picture of the plot. Is there a threshold on the amount of "outliers" to determine whether a variable can be categorical? edit: In the plot, x is the tax rate ($\times 100$) of various regions, an...
Suppose I have fitted an standard linear regression mode $Y=\beta_0+\beta_1X_1+\beta_2X_2+\beta_3X_3+\epsilon$. Based on the ACF plot or PACF plot of the residuals for this regression model, I found that the $\epsilon$'s are serially auto-correlated that can be modeled as an AR(1) i.e. $\epsilon=\phi\epsilon_{t-1}+\nu_...
I want to conduct an experiment to find out whether the CO2-production of soil changes with high amounts of rainfall. Therefore, I want to group 8 soil samples into two different groups. One group is control, one group is treatment. Due to time, space and money restrictions, I can only have four replicates for each gro...
I'm using Genetic Algorithms to do inputs selection in a time series problem. The issue is that the number of possible inputs is very large (100 possible inputs + inputs' lags) and I don't know a procedure to determine the minimum number of lags to consider. My procedure was to run a correlation analysis ex ante and l...
I’m reading R. Kreps' paper Parameter uncertainty in (log)normal distributions and trying to figure out how the simulations were done. In order to generate Figure 1, Eqn (2.41) was used. So this is what I did in R: This is the equation they used: $Z_{eff} = v + z\sqrt{\frac{n(1+v^2)}{w}}$ where Note: This code is for t...
Let say I have a 'kidney catheter' data set. Data are about the recurrence times to infection, at the point of insertion of the catheter, for kidney patients using portable dialysis equipment. Catheters may be removed for reasons other than infection, in which case the observation is censored. Each patient has exactly ...
I am confused and just need some confirmation about calculating the relative variable importance value for the co-variates I used in AIC model selection procedures. I know that there is this one discussion but it doesn't quite confirm explicitly enough what I should do. Burnham and Anderson (2002) describe a simple wa...
I have in my model some features, which seem to have some super power to explain the training data. To be more specific, the model is to predict clicks and the features are the click-through-rate(CTR) of some granularity. The CTRs of certain granularity are the same in both training and testing set. Althought we gain...
Imagine this experiment: assume that I have two sets of twins. For the first pair of twins, I keep one as a control, and the second twin I give drug A. For the second pair of twins, I keep one as a control and I give the second twin drug B. Now, I want to show that the effectiveness of drug A over control is bigger ...
EDIT: added more details following @kjetil comments I have the following problem: I monitor one stream of events of type A - those events can be considered instantaneous. I also monitor additional streams of events of types B1, B2,... Bn - those have a time interval associated with them. I want to determine if the fre...
For the classical simple linear regression model I have derived an hypothesis test for $H_0\colon \left\{\frac{y^*(x^*)-x^*}{\sigma}>1 \right\}$ where $x^*$ is a given value of the covariate $x$ and $y^*(x^*)=a + b x^*$ is the theoretical mean of the response $y$. I use the test statistic $t=\frac{\hat{y}(x^*)-x^*}{\h...
In the case of the kappa-value there are some attempts to qualify how good or bad the agreements are. For example Landis & Koch in the article The Measurement of Observer Agreement for Categorical Data talks about "strength of agreement" based on kappa values: Kappa Strength of agreement ===== ============...
I am ultimately trying to perform a regression task - for this example, let's say I'm trying to determine the height (in pixels) of a person in an image. However, rather than doing regression, I am solving this problem by hypothesising a few different possible heights (e.g. by detecting parts of the image that look lik...
Possible Duplicate: Difference between standard error and standard deviation I cannot come to terms with the fact that the standard error is used to describe the accuracy of a point estimate. For example, when making inferences from a sampling distribution about the accuracy with which the sample mean estimates the ...
I am doing final revisions to my dissertation, which includes a large number of regressions. I have six outcome variables (DVs) and I am testing the effect of four primary (correlated) IVs, but I am testing them separately to determine the unique contribution to the model of each IV. Therefore, I have 24 regressions. ...
I am using gbm package for classification. As expected, the results is good. But I am trying to understand the output of the classifier. There are five terms in output. `Iter TrainDeviance ValidDeviance StepSize Improve` Could anyone explain the meaning of each term, especially the meaning of Improve.
How to add noise to an object, regardless of the amount of dimensions? I would expect to try to use some sort of apply to add noise of the type: runif(1, -0.00001, 0.0001) for each cell. What I tried before was to have a matrix of r * c, and then creating a matrix with noise, and add them together. It works, but I beli...
I'm looking for research papers on estimating demographic information (age, wealth, location, gender etc.) out of internet activities (preferably social network activity or browser history). Where would be a good place to look for?
library(MASS) bc <- boxcox(Volume ~ log(Height) + log(Girth), data = trees) To find the $\lambda$ value with the highest log-likelihood, this command could be used: bc$x[which.max(bc$y)] Is x=log(Height) in this example?
I'm working in R, using glm.nb (of the MASS package) to model count data with a negative binomial regression model. I'd like to get the standardized (beta) coefficients from the model, but am given the unstandardized (b "Estimate") coefficients. The R documentation does not seem to show of a way to retrieve the standa...
Background I am currently testing conversions on a web page and would like to test if the changes I made yesterday produced a significant change in conversions. The Data Set For each day I test, I have the total number of visitors to the site and the number of visitors who click through a certain link. Then I divide th...
I'm using Google Docs for a statistics class and my instructor suggested we use the "tdist()" function in Excel. http://office.microsoft.com/en-us/excel-help/tdist-HP005209312.aspx I can't find anything similar in Google Spreadsheets. https://support.google.com/drive/bin/static.py?hl=en&topic=25273&page=table.cs&tab=12...
I am in Psychology and trying to explore the utility of mixed modeling for analyzing my repeated-measures data in a factorial experiment. The primary reason for using mixed models is that I would like to avoid the common practice of averaging data collected in the same experimental condition. My understanding is that i...
Possible Duplicate: How to compute significant interaction estimates when main effect is not significant? I am an applied linguist and I am modelling responses to a vocabulary test taken by second language learners of English; the aim is to test theoretical hypotheses regarding the relationship between the nature of...
I have a time series of proportions, $x_t = \frac{a_t}{b_t}$ i.e. $x_1 = 2 / 30, x_2 = 1/10$, ... I want to smooth $x_t$. Should I apply a smoothing function directly to $x_t$, or should I smooth $a_t$ and $b_t$ individually, then recompute the proportions? My gut tells me you should smooth the individual time serie...
I am estimating a hurdle model, which consists of two data-generating processes: one for the zero/positive relationship, and a different one for the positive numbers above zero. A binary logit model is often used for the first part, and a zero-truncated poisson or negative binomial model for the second. In R, the hurdl...
Are there any good reasons to prefer a sliding model training window to a growing window in online time series forecasting (or vice versa)? I'm particularly referring to financial time series. I would intuitively think a sliding window should perform worse -- out of sample-- as it is has more potential for over-fittin...
I am trying to understand the poem Hiawatha Designs an Experiment because it looks like the kind of in-joke that it would be nice to get, as a statistician. Here is what I would like to know: Unhelpful answer: "The poem is about the bias-variance tradeoff." Helpful answer: The poem is critical of the following kind of ...
I've been researching the mice package, and I haven't yet discovered a way to use the multiple imputations to make a Cox model, then validate that model with the rms package's validate() function. Here is some sample code of what I have so far, using the data set veteran: library(rms) library(survival) library(mice) ...
I'm trying to graph the number of actions by users (in this case, "likes") over time. So I have "Number of actions" as my y-axis, my x-axis is time (weeks), and each line represents one user. My problem is that I want to look at this data for a set of about 100 users. A line graph quickly becomes a jumbled mess with 10...
I have a series of samples of varying length, and the number of bugs created in those time samples. Reading the literature, this is often modeled as a Poisson process. If you write it like: $$P(k,t)=\frac{e^{-\lambda t}(\lambda t)^k}{k!}$$ I know $k$ and $t$ and would like to regress to find $\lambda$. Is there an R pa...
I have the following result from running glm function. How can I interpret the following values: Null deviance Residual deviance AIC Do they have something to do with the goodness of fit? Can I calculate some goodness of fit measure from these result such as R-square or any other measure? Call: glm(formula = tmpData...
Biological Background Over time, some plant species tend to duplicate their entire genomes, gaining an additional copy of each gene. Due to the instability of this setup, many of these genes are then deleted, and the genome rearranges itself and stabilises, ready to duplicate again. These duplication events are associa...
If we know, for independent random variables $X$ and $Y$, $P(X>x)\leq0.05$, and $P(Y>y)\leq0.05$, can we say anything about $P(X+Y>x+y)$? Can we be certain that it is less than $0.05$? Under what conditions could we say that?
I want to integrate $\int_{\mathbb{R}_+}\mathbb{1}_A(x) d\mathbb{P}(x)$, in other words I am interested in $\mathbb{P}(A)$. I did this numerically with two Monte Carlo steps. First, I drew, say a sample of $10^3$ ($\mathbb{P}$-distributed). From this sample I calculated the mean. Repeating this $N$ times, i got a new ...
I recently read a paper in which the authors claim that in order to compare the forecasting performance of two non-nested models, models A and B, a valid procedure is to fit models A and B on the same data set, and compare the average likelihood of the fitted models computed on the hold-out data set. All that is requir...
Which 2-tailed test is best to use to compare means/medians when one variable has a normal distribution and the other does not?
Can anyone tell me what exactly a cross-validation analysis gives as result? Is it just the average accuracy or does it give any model with parameters tuned? Because, I heard somewhere that cross-validation is used for parameter tuning.
I’m reading Wacek’s paper Parameter Uncertainty in Loss Ratio Distributions and its Implications and trying to figure out how to replicate some of the results. Table 6, on page 190 of the paper, contains some results. Under Model B1, the density, $f_x(x|\theta)$, is assumed to be Normal with known $\mu = 0.7067$ and $...
I want to know why we can include dummy interaction terms into time series models if they're always non-stationary? For example let $X_t$ be $I(0)$, $X_t \sim N(\mu,\sigma^2)$ and $D_t \in \{0,1\}$. Suppose the estimation window is $200$ and $D_t =0$ for $t=1,...,100$ and $D_t =1$ for $t=101,...,200$. The interaction ...
I have a data set consisting of about a quarter-million objects, each of which may have any of 30 particular features. So I might have Object 1: feature 3, feature 7 Object 2: feature 3, feature 29, feature 30 Object 3: feature 3, feature 7 Object 4: feature 1, feature 18, feature 20, feature 28 ... At this point I'm j...
There is a debate in selecting the smoothign constant in Single Exponentioan Smoothing method by practitioner or considering it as a process parameter? Could you please provide your opinion regarding this issue?
"An insurance company receives claims at a rate of two per week, the size of a claim in pounds having mean 100 and standard deviation 50. Assuming the compound Poisson process as a model, and using normal approximations, find the probabilities that, in a period of 50 weeks the average size of claim will exceed £110". A...
I have a table with each row representing single printer model, its features, and price. I want to know how price is formed based on these features. What should I start with? Multiple regression, so I could cut off insignificant features? Cluster analysis to define small clusters with equal price? What are the ways to ...
I have dataset with large number of labelled data (say that there are k classes). I have also another, much smaller dataset with unlabelled data that I want also to be labelled. The problem is that in the second dataset, number of classes need not to be the same as number of classes in first dataset (more precisely, th...
I have a data set with my target gene and more than thousand transcriptional factors somehow correlated with this gene. There is data of these factors in more than 70 variable conditions. What I'm looking to do is use CV to find most useful variables which correlate with my target gene. How could I do that in R pleas...
In the GBM package one is supposed to be able to provide interaction.depth>2, which means higher-order interactions between features. However, the resulting trees (as seen by pretty.gbm.tree) never show such interactions (and indeed - each row corresponds to just a single feature). I'm not even sure anymore that the p...