instruction
stringlengths
9
38.7k
I am looking for packages (either in python, R, or a standalone package) to perform online learning to predict stock data. I have found and read about Vowpal Wabbit (https://github.com/JohnLangford/vowpal_wabbit/wiki), which seems to be quite promising but I am wondering if there are any other packages out there. Than...
I'm getting this error when conducting fisher.test() in R: freqTable = 1 2 3 4 5 6 7 1 14 0 2 0 0 0 0 2 0 0 0 9 0 0 0 3 0 6 0 0 0 0 0 4 0 0 0 0 6 0 0 5 0 0 0 0 0 10 0 6 0 0 10 0 0 0 0 7 2 4 9 1 0 0 30 > fisher.test(freqTable, workspace=2e+07,hybrid=TRUE)$p...
Are there any packages that implement the Autoclass/ Naive Bayes Clustering algorithm in R or Python? Alternatively, what are some other clustering algorithms that can handle both categorical and numeric variables that are implemented in either R or Python?
I have two data sets to compare. Each is a list of billed amounts by diagnosis codes. The data differs in that the diagnosis codes may be different for some of the billed amounts. There are approximately 32 different diagnosis codes that were used. What type of statistical analysis is most appropriate in comparing ...
What is the difference between the classic meta-analysis (that aggregates effect sizes from a sample of studies to a summary effect size), meta-regression analysis and moderator analysis? As I understood moderator analysis is used to explain heterogeneity in a meta-analysis by regressing a vector containing the effect ...
Is there a package in R for the Kolmogorov distribution which allows me to plot density, distribution, calculates quantiles, etc.? The Kolmogorov distribution arises from $K=\sup|B|$, where $B$ is a Brownian bridge. Its values are usually tabulated, so I thought it would have its own function in R, like the normal dis...
I am having trouble deciding what type of analysis to use for the following data: I have two groups (one control, one treatment) and took a pre-measure of my dependent variable, and then 3 post-measures. I am interested in understanding if the treatment affected the dependent variable over the course of the study. I...
I would like to compare 4 radon flux maps (Bq m-2 s-1) generated using different methods. All of the maps use same projection and have same resolution. I am having trouble finding statistical method(s) which i could use for comparing the maps and analyse regions where they agree well and regions where the difference is...
I was trying to do a permutation test on a large amount of temperature observations in R. Approximately 1700 temperature observations (g1) from one place and 2 times 1700 observations from two other places (g2). I would like to test the hull hypothesis $\mu_1-\mu_2 = 0$ against the alternative hypothesis $\mu_1-\mu_2 <...
In Hoeffding tree (that handles continuous attributes), Hoeffding inequity suggests the minimum amount of instance to be looked at before the best split attribute can be determined with confidence. What I don't get is when the best split attribute is decided, how is it guaranteed that the split threhsold (or split poin...
In glmnet in R, what is the difference between dfmax and pmax when creating a model with both ridge and lasso penalties? Is the following interpretation correct? Let's say we have we run a glmnet elastic net with 500 predictors and we only want to include in 3 predictors in the final model; i.e. we want the lasso elimi...
I'm trying to find the name of this method (and ultimately a reference). The approach is as follows: 1) Fit a mixed-effect model with a random intercept $$ E(Y_{ij})= \beta_0+\beta_1x_1+\gamma_{0j} $$ 2) Use the estimated random intercepts as the response variables in a new linear regression $$ E(\gamma_{0j})= \beta...
I am beginner of R software. I am looking for two variables and result cross tabulated but not in the form of frequencies. Could I get help on how to get result as average and standard deviation instead of frequencies while cross tabulating in R. my data looks like this Treatment Stage Chlorophyll Salt Green...
I have seen this statement in a lecture note : $$E[(Y-f(X))^2\,|\,X]=Var[Y|X]+E^2[(Y-f(X)\,|\,X]]$$ If $Z,X$ are random variables, then shouldn't be $Var[Z|X]=E[Z^2|X]-E^2[Z|X]$?In which case shouldn't the term $Var[Y|X]$ be $Var[Y-f(X)\,|\,X]$?
Let's say that I have a method of sampling from $P(X, \theta \mid Y)$. It seems intuitive that if I drew samples of $(X, \theta)$ and then simply dropped the $\theta$s, this is equivalent to drawing from $P(X \mid Y)$ directly. What is the theorem that says that I can do this?
Suppose that we take a sample ($X_1, X_2, ... X_n$) from a distribution where we assume that $X_i $~$ Bin(n_i, p_i)$ and $n_i$ is known for every $i$. We also assume that $p_i$'s are independent and identically distributed, $p_i$ ~ $D$, where $D$ is some unknown distribution. $n_i$ cannot be assumed to be large. My g...
I don't quite understand what is going on in the correlation coefficient formula. In the numerator we have the covariance, and in the denominator we have the standard deviation of variable x multiplied by the standard deviation of variable y. So ultimately it is a ratio of covariance to the product of the two standard ...
I have an ecological data set, whereby sediment mud content (%) (i.e. the continuous explanatory variable) is thought to be explaining the spatial distribution (i.e. presence/absence) of various estuarine benthic macroinvertebrate taxa (i.e. the binary response variable). Below is a subset of the data (actual data cons...
The problem gives 50 observations and then asks to check whether the data comes from a normal distribution. For instance if these are your observations then how would you go about testing to see if they come from a normal distribution. −1.28 −1.22 −0.45 −0.35 0.72 −0.32 −0.80 −1.66 1.39 0.38 −1.38 −1.26 0.49 −0.14 −0....
Assume a data set with multiple columns, where the categorical data are coded. What is the best rule(s) or rule of thumb to determine whether each column contains qualitative data or quantitative data? One possible way is to count the number of unique values and if the unique value count is less than some threshold val...
I am analysing a set of data where I try to predict an outcome (Level of women’s nutrition knowledge; whether it is High or Low) by using certain covariates (demographic characteristics of the sample). I have already done Chi-square analysis and now I am progressing to binary logistic regression. To avoid an overly com...
In this current article in SCIENCE the following is being proposed: Suppose you randomly divide 500 million in income among 10,000 people. There's only one way to give everyone an equal, 50,000 share. So if you're doling out earnings randomly, equality is extremely unlikely. But there are countless ways to give...
Say I have a data matrix of size $N \times P$ where $N$ is the number of samples and $P$ is the number of features. Now, if I do principal component analysis, I get another data matrix of size $N \times K$ where $K$ was chosen according to some criteria. My question: if I pick a row (sample) from the $\text{PCA}$ matri...
I am struggling with nls model given below. I have a blur idea how to set up the initial values in it. Shall I use "try and error" method or is there any other way to make it more systematic. > model3<-nls(H2~H1*(A2^b1*(A1^b1*(b3+H1+sqrt((b3+H1)^2+2*H1*exp(b2)/A1^b1))+exp(b2))/ + A1^b1*(A2^b1*(b3+H1+sqrt((b3+H1)^2+2*H...
I was comparing the performance of pROC and AUC libraries when performing auc() calculations on random data: library("pROC"); library("AUC") predictor <- rnorm(10000, 5); outcome <- rnorm(10000) > 0; print ("pROC:::auc() time & output") system.time(x <- pROC:::auc(outcome, predictor)) print(x); print ("AUC:::auc() t...
I am using Caret and have divided my data into training(75%) and test (25%) sets. Now I am running 10-Fold CV on training data. I fit the following model: train_control <- trainControl(method="cv", number=10) output <- train(Species~., data=iris, trControl=train_control, method="rpart2") Question 1: Is the accuracy sh...
I created a criterion for my financial data-set for classify data to two classes for other processing (like neural network binary classificatio). After calculating this criterion (between 0 and 1) the distribution of output is like exponential (but between 0 and 1 - something like beta distribution). Now i want set a t...
How could I decompose a two-peaked (empirical) pdf into 2 say lognormals or other appropriate pdf in a straightforward way? I'd prefer in Matlab. to something like this: Thanks!
Suppose $X_1, X_2, \ldots, X_n$ is a sequence of independent Bernoulli random variables with (say) $$X_i \sim \begin{cases} \mathrm{Ber}(0.1) & 1 \leq i \leq an \\ \mathrm{Ber}(0.2) & an+1 \leq i \leq n\end{cases}$$ for some $a$ that is unknown to us satisfying, say $0.1 \leq a \leq 0.9.$ How accurately can we detect ...
By null hypothesis is true I mean that the means of each group is the same at population level. I am wondering whether the expected value would depart from 1 in the case that the variances of the groups are different from one another at population level, or if the groups are non-normally distributed at population level...
I am a clinician who is more adept than average at interpreting clinical trials in a frequentist manner. At this point, interpreting a trial as a frequentist has kind of become a procedure: check internal validity, check null and alternative hypotheses, check power assumptions, look at effect size and confidence inter...
I have this idea in my head that is either bunk or has a name I don't know. (I'm not naive enough to think I'm breaking new ground here!) Here's my scenario: I would like to know the proportion of a population that has disease x. Instead of taking a random sample of the population, I'm taking what I'm calling a priorit...
Hey I have to regress abnormal returns for 202 companies over a period of 10 years (between 2004-2013) against their respective PE ratios and a Profitability measure for the same time period. Thus I have to run a pooled regression. I have read online on how to do it...but still am not sure of the process and also did n...
Specifically, are there any binomial regression models that use a kernel with heavier tails and higher kurtosis than the standard kernels (logistic/probit/cloglog)? As a function of the linear predictor $\textbf{x}'\mathbf{\hat{\beta}}$, the logistic distribution Underestimates the probability of my data being in the ...
I have monthly usage data (spanning 3 years) for a customer base of around 200K, and I need to generate 1-month ahead forecasts for each of them. There are a couple of exogenous variables that would need to be included too. One way to go about is to build an "Arima with exogenous variables" model for each customer. In ...
I recently read a paper in which the authors used Cronbach's $\alpha$ and $\omega$ as measures for unidimensionality and homogeneity. In case of $\alpha$ I know that it is wrong, but I am not so familiar with $\omega$. The literatur I read said it is the proportion of test variance due to a general factor. Does that me...
I need to know about the power of a simple effect that follows from a 2x2 ANOVA interaction. Let's call the factors in this design GROUP(Patient, Control) and MANIPULATION(Expectation, Random), giving me 4 cells. Our very specific hypothesis is the following: controls will adapt their behavior according to the experime...
I have a data set of 350 points, I want to estimate the lag 1 auto correlation for different sub-sets of the data. More precisely I want to take non overlapping windows of length 1,2,3....n and calculate the auto correlations of these sub-sets. So for n equal to 2 I take every second observation similarly for n=3 I tak...
I was writing with a question regarding a time-varying state space model of the form: \begin{align} y(t) &= \mu_1(t) + A(t)x(t) + v(t); &v(t) &\sim (0, R(t)) \\ x(t) &= \mu_2(t) + \Phi(t)\!\times\!x(t-1) + s(t); &s(t) &\sim (0, Q(t)) \end{align} $x(t)$ is of the form: $x(t) = \log[1-X(t)]$ obviously, $$ |X...
I'm running Gauss Seidel value iteration on a weapon-target assignment problem (I can explain this more later if necessary, but i don't think it is). My VI is converging exactly in 2 iterations. I'm not sure if it is because my problem has ~1/2 absorbing states (i.e. if you expend all the weapons or if you destroy th...
I have a dataset with a lot of missing values and mix of continuous and categorical variables. I want to use something like group lasso to do features selection. Probably the output is binary 0,1 and so grouped lasso logistic regression seems to be the more sensible choice. My problem is the very large number of miss...
Let's say I have a wave, with frequency $\omega$ and phase $\phi$, of the form: $$y(t)=1+A\sin(\omega t+\phi)$$ where $A<1$. I have $N$ measures of $(\hat{y}_i, \hat{t}_i)$, that are assumed to be evenly spaced over one period. For practical purposes, $\hat{t}_i=t_i$ is assumed to be accurate, while $\hat{y}_i$ is mea...
I'm using LIBSVM to do some training as it was recommended by Andrew Ng and is used under the hood in SciKit Learn. LIBSVM is doing something different than what I expect though: My beliefs are as follows: LIBSVM when set to use a linear kernel is a reasonable implementation of a linear SVM A linear SVM model shou...
I had a related question answered here: Rule of Thumb for minimum length of time series for AR(1) estimation However the answer gives rise to a new question. I want to be able to estimate the Auto correlation at lag 1 for different step sizes. While I agree that in theory if the lag 1 auto correlation for step size on...
Out of curiosity, I want to understand how to model this problem. I've been hearing people suggest the use of linear regression but I am not sure how to encode this problem (included my attempt below) in R as I am a complete beginner in this area. I have a task that can be done any number of times (each individual ins...
Histogram showing the frequency for test scores (range 15-75) for a total of 91 students.
library(lme4) out <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial, contrasts = list(period = "contr.sum")) summary(out) Fixed effects: Estimate Std. Error z value Pr(>|...
I have a set of data points that are supposed to sit on a locus and follow a pattern, but there are some scatter points from the main locus that cause uncertainty in my final analysis. I would like to obtain a neat locus to apply it later for my analysis. The blue points are more or less the scatter points that I want ...
I have 4 servers, n customers and m reports. At any time, a customer may request one of m reports. There are only 4 servers which are capable of generating reports. Each server can only process one report at a time. Over time I can record the average generation time for each customer which is independent of the server....
After running a gradient boosted model with n data points using multinomial regression where the response variable (a factor, as required by the gbm function) has k levels with R package gbm, I see that the predictions are output as as a vector of length n*k. Predicted responses are from: probs.var.multinom <- predict....
We are working with panel data. But we want to study only the cross-section part of the panel data. So can anybody please tell me how to do any kind of data transformation, so that I can remove the time-series variance from the panel data? Thank you.
I plotted normal probability plot in R using qqnorm and qqline. I want some help on: How to estimate "probability" that a data has normal distribution? (I read in a paper that a probability of 0.10 is required to assume that a data is normally distributed). Also, how to calculate correlation coefficient for a normal ...
Dear statistics experts, I have trouble to find a sensible statistical approach to back up some very obvious (at least to my eyes) interpretation of a dataset (see descriptive plot below). I measure a response to two different stimulus (Stimulus 1 and 2) at 3 different intensities (weak medium high), in 2 different pop...
I would like to know what the following example is called in mathematics: In a gymnastics competition the judges scored a competitor as 10, 8, 3, 7, 7, 9, and 8. I recall that the ending score was always calculated after they discarded the highest and lowest numbers in the group and used what was remaining to get the ...
In normal multivariate regression you can leave out covariates (assuming they aren't correlated with any covariates you leave in) and the variance of covariates left out gets subsumed into the error term. In survival analysis poisson models are used. In these models the variance is a function of the mean. What then ha...
I have 11 subjects with pre and post outcome (two repeated measures). I'd like to test the difference between both conditions. The problem is that each subject react very differently. Here's an example : Subjects Pre-score Post-score S646 1.52 8.18 S657 -1.43 -3.69 S680 1.57 1.33...
If I have a rate variable, for example unemployment rate, that has been transformed such that $\text{unemployment new} = \ln(\frac{\text{unemployment}}{1-\text{unemployment}})$, how do I interpret this variable? I know the log distributes, so this is actually the $\ln(\text{unemployment}) - \ln(1-\text{unemployment})$ ...
I've seen the terms matching/match and fitting/fit used almost interchangeably when discussing models goodness of fit, observed vs simulated data matching, etc. Is there a difference in interpretation between these terms that should be taken into account or are they more or less synonyms (in the strict statistical sens...
I have two data sets (2048 dimensions) collected under slightly different circumstances. I am using PCA to reduce the dimension of the data before passing it further for classification. Both data sets are spectra of the same alloy samples collected with slightly different lasers. My problem is that of the two sets of v...
The definition of complete statistics is from http://en.wikipedia.org/wiki/Completeness_(statistics)#Definition The statistic $s$ is said to be complete for the distribution of $X$ if for every measurable function $g$ (which must be independent of $θ$) the following implication holds: $E(g(s(X))) = 0$ for all $θ...
I'm trying to model time series data that is bimodal and non-Gaussian. The 2 modes are due to weekday points versus weekend points. I keep thinking that I just need to split the data up to model weekdays separately from weekends but then there are breaks in the time series (i.e. I loose very obvious inter-day trends). ...
This is a bit longish (I want to be thorough), but my actual question is a short one (in bold below). BACKGROUND: Suppose I have a conditional logistic discrete time event history model (aka logistic discrete time survival models aka logit hazard model) across $p$ possibly time-varying predictors $\mathbf{X} = \{X_{1t}...
I'm having trouble understanding the formal definition of a confidence set. This is the definition that I am working under. Definition (Confidence Set): Let the data be distributed according to the random variable $X$, which depends on a parameter $\theta$ taken from a parameter space $\Theta$. A $(1-\alpha)$ confidenc...
Let us consider a ordinal variable with four values say A,B,C,D (A greater than B greater than C greater than D) and a person can have any of these values at a given point in time. I have data which has a timestamp and the state in which the person was present. I would like to quantify the shift between these categorie...
I'm trying to compare a number of large data sets (over 3000 samples per set), when I plot histograms of these distributions I can see two which are clearly different and a z-test confirms this, which is great. However, there are two distributions which look so alike I couldn't tell them apart without knowing which was...
I need to sample a variable from a distribution that's like a binomial distribution except with a "bias", I'm not sure what it may be called: $p(X=k)$ is proportional to $k.B(n,p)(k)$ where $B(n,p)$ is the binomial distribution. Any ideas on how this can be done? I'm working in python so if there's any "direct" way in ...
I recently made a plot for work that used a signed square-root scale on the $y$ axis, for visual clarity. The $y$ observations are impulse response functions (IRF) of vector autoregressions computed on separate data sets. Since one of the goals of the project was to come up for group means, I ended up drawing horizonta...
I'm trying to find the expected value of a random variable $t_i$ which is the solution of $$\epsilon_i=\mu(t_i-t_{i-1})-\sum^{i-1}_{k=1}\frac{\alpha}{\beta}\left(1-e^{-\beta(t_i-t_k)}\right)$$ where $t_1,..., t_{i-1} , \alpha, \beta, \mu$ are all known constants and where $\epsilon_i$ is a random variable with expone...
I'm having some trouble with this equation from the least squares model. $$E[\parallel \mathcal {\hat {B}} \parallel ^2] = [E\parallel \mathcal {\hat {B}} \parallel] ^2 + trace ( \text {cov} [\mathcal {\hat {B}}])$$ $$ =\parallel \mathcal {\hat {B}} \parallel ^2 + \sigma_{e}^2 trace((X^{T}X)^{-1})$$ We have $\...
I am trying to fit a curve to a histogram that looks roughly like exponential decay. Since this is roughly similar to exponential decay, I figured a good model was counts ~ counts[1] * exp(-a * mids) Which is calculated as h1 <- hist(data[1,]) #find position that is closest to 10, our cutoff, and save only mids befor...
I was looking at the Poisson regression. Here I find that the canonical parameter is taken to be the logarithm of the rate of the Poisson. I was wondering if there is any reason for considering this as the canonical parameter, rather than the rate of the poisson itself (with the restriction that the parameter is positi...
Are there any analytic approaches to using mixture distribution fitting for latent variable analysis? I'm specifically interested in existing approaches to determining whether mixture components indicate a presence of sub-populations OR effect(s) from underlying factor(s). References to relevant key papers, tutorials, ...
The weight of a Portuguese man is normally distributed with mean 160 pounds and standard deviation 30 pounds. The weight of a Portuguese woman is normally distributed with mean 120 pounds and standard deviation 25 pounds. If a Portuguese man and a Portuguese woman are each randomly chosen. What is the probability th...
The Wikipedia article on Post hoc analysis says "Bonferroni correction (This is properly used with planned, not post hoc, contrasts.)" but does not explain why the Bonferroni correction is properly used with planned contrasts and not post hoc ones. The Wikipedia article on the Bonferroni correction does not seem to exp...
I am running generalised linear mixed effects models in R using the lme4 package. I am wondering if there are any post-hoc tests available for models built using the glmer function? I know the package lmerTest has a function for post hoc testing lmer models (class merMod), but it won't work for objects of class glmerMo...
I would like to be certain of how to calculate the $\chi^2$ value for this scenario: We desire a measure of the goodness of fit of a nonlinear model to a data set. The data consists of many data points $x_i$, where $i$ is an index, and $x_i$ is specific to the experiment (e.g., measured in seconds, meters, etc). A...
I am studying now t-scores. As far as I understand, t-scores are used when we don't know true population parameters (such as: standard deviation and population mean) and cant use z-scores. Here is formula that is in books and in Internet for calculating t-score: $$t= \frac{\bar{X}-\mu }{\frac{S}{\sqrt{n}}}$$ As far as ...
I'm trying to test whether in a particular location the density of invertebrates measured now is significantly different from the one measured a decade ago. I sampled the same two plots (A and B) that where sampled in the past, at the same times in the season as in the past (Early, Mid and Late season), with n=3 replic...
I need to use the survdiff function to statistically compare (using log-rank test) the following survival functions: (1) Male (Sex=1) and Female (Sex=2) (2) Patients <= 65 years-old and Patients > 65 years-old I used the following command Male <- survdiff(Surv(time,Status)~sex==1,data=myeloma) Female <- survdiff(Sur...
Before posting this question, I had a browse through other questions on this Stack, and this is probably going to be a walk in the park for anyone who reads it! But the description of this Stack includes data analysis and visualisation, so I hope this is in the right place! </preapology> I'm using a Raspberry Pi with a...
Given that statistics can often be abused to deliberately present 'facts' to support a pre-existing viewpoint. (Lies, damned lies and statistics). And given confirmation bias. Is there an established method of choosing which statistics to use, which ensures (or at least endeavours) to be as fair as possible? And does t...
I have a data asset where one "unique"ID corresponds to multiple cases, shown below. I am looking for a way to create a column ranking each ID by another column but keeping the rank unique for each ID. ID number Rank(column I'm trying to add) 1 55 3 1 40 2 1 35 1 ...
I need some hint over what is the general prediction solution to modelling products prices in such a case: I have several models (types) of the product I want to predict prices for each of these models separatedly, for a few weeks long time window I have great historical data for each of the model from last 1-2y ...
So, imagine having access to sufficient data (millions of datapoints for training and testing) of sufficient quality. Please ignore concept drift for now and assume the data static and does not change over time. Does it even make sense to use all of that data in terms of the quality of the model? Brain and Webb (http:/...
I'm trying to replicate the analysis presented on the bottenada.se and described in the ADA repository. Although the demo file is quite detailed, I didn't grasp where those values for the "C0" component come from. I would like to try other m0 combinations, but I couldn't understand how can I generate C0 values to fill ...
I did a spectrometry measurement with the evaluation of the concentration of an element. For the element of interest I've two peaks (with normal distribution). $ C_1 ± \sigma_1 $ where $ \sigma_1 = \sqrt{C_1} $ and number of counts n $ C_2 ± \sigma_2 $ where $ \sigma_2 = \sqrt{C_2} $ and number of counts m The con...
I have a problem regarding estimating a $M\times 1$ vector from a given $M\times M$ symmetric matrix. The known matrix is a scaled identity matrix with a rank-one update. I have some idea how to start, but I don't know if this is the best way to go. My model of the $M\times 1$ received vector is $\boldsymbol{y} = \bold...
My question is simple: Is there any results regarding the distribution of log-likelihood function gradient? It may be asymptotic results as well.
I need to place a Laplace prior on a random variable, however, I want to use a Gaussian distribution whose variance is Gamma(1,1) distributed, i.e., \begin{align} x &\sim N(\mu,\sigma^2)\\ \sigma^2&\sim\text{Gamma}(1,1) \end{align} My question is: Given this above setup, what is the corresponding form of my Laplace di...
I have some university rankings data where I am asked to analyze whether a higher %of one variable leads to a higher ranking in a particular area. What kind of statistical analysis should I use in excel and how should I report the findings?
I've two samples with mean value $\mu $ and standard deviation $\sigma$ (normal distribution). Can I use a Z-test to compare them ? Also if I don't know the sample size ? If I've five samples to compare ..what do I do ? A z-test for each comparison :\ or an ANOVA test (as for t-test) ?
If I have the autocorrelation function of an observed system output, how does this relate to the impulse-response function of that system, if I don't have information about the input?
I'm having some trouble understanding Leo Breiman's proof that the generalization error of a random forest converges as the number of trees increases (here's a link to the paper). At Appendix I he states that: Proof of theorem 1.2: It suffices to show that there is a set of probability zero C on the sequence space $...
Thanks to Rijmen et al.(2003), we can fit GRM to the data with lme4::glmer. I think Rasch model is straightforward, with data.frame with columns like this response person item 0 1 1 0 1 2 1 1 3 ... 1 2 1 0 2 2 we can fit Rasch model like this g...
I have multiple sets of data which conform to overdispersed Poisson distributions which I can model with the alternative parameterization of a negative binomial distribution ($\mu$ and $D$ instead of $p$ and $r$). I am interested in being able to generate pseudo-random numbers from these distributions but cannot find t...
I am designing a randomised pretest-posttest trial for which I'm trying to do a sample size calculation. My brain is about to explode from confusion, so I hope someone can help me. Just a little summary of what the trial will look like. We have 2 interventions which will be delivered in 3 arms: intervention 1 only, int...
When using multiple dummies for a categorical variable: what happens if a few of your observations can check off "1" in more than one of the dummies? Does it matter? Does it only matter dependent on what proportion of observations fit that category (i.e., 5% vs. 50%)? How might it affect results? Example: comparing med...
Let $X_t$ be a weakly stationary process with mean $\mu$ and autocovariance function $\gamma$. How do I show that $$n^{-2}\sum_{i=1}^n \sum_{j=1}^n cov(X_i, X_j)$$ equals $$ n^{-2} \sum_{i-j=-n}^n (n- |i-j|)\gamma(i-j)$$ Thanks
I have a model to achieve Bayesian estimates the population size $N$ and probability of detection $\theta$ in a binomial distribution solely based on the observed number of observed objects $y$: $$ p(N,\theta|y)\propto \frac{ \text{Bin}(y|N,\theta)}{N} $$ for $ \left\{N|N\in\mathbb{Z}\land N\ge \max(y)\right\}\times...
Multilevel factor analysis seems to be the technical term for factor analysis with repeated measures, judging from this abstract. To be precise, following Wikipedia's factor analysis notation, the model I want to build is $$x_i =l_{i1} F_1 + \cdots + l_{ik} F_k + z_i + \varepsilon_i$$ where $x_i$ is the $i$th observed...