# Tagged Questions

26 views

### Latin hypercube sample sampling between [-1, 1] in R

Anyone has idea to sample between [-1,1] by using LHS in R? Thank you in advance. Since there are m observe variables for n simulation experiments. Each variable can take value between [-1,1], I'd ...
44 views

### Is this a valid test?

I have 5000 cases vs 5000 controls with positive/negative outcome. chi.test shows no significance for this data. I get significance when subsetting cases on VarX, ...
48 views

### Estimating the total number of sample subsets of size 10 from a population of size 1000

If we have $n > 1000$ units to sample from, how can we estimate the number of subsets of a certain size, since the number is too much for R to handle? What I ...
27 views

### Gamma bridge sampling

I am looking into gamma-bridge sampling, as described in for example [1]. What are the benefits of sampling in this method? Is it purely a computational aspect? Are there any problems with the way ...
26 views

### Identifying potential for missingness in a seasonal time series to bias period-averages

I have high-frequency time series (observations every few minutes) for which I wish to compute daily averages. The data exhibit a strong diel cycle. Sometimes observations are missing in the time ...
83 views

### Why do two equivalent approaches to selecting numbers that sum to 100 produce different results

This question is inspired by two seemingly equivalent attempts to solve a question asked yesterday: In R, how to sample from the output of combn(a,b) if the "a choose b" is too large? ...
44 views

### How to testing the probability of two factors being found together?

I know how many times a particular factors has been found: values<-cbind(f=c("S1","S10","S3","S4","S5","S6","S7","S8","S9"),count=c(9,8,4,24,20,4,8,21,5)) I ...
243 views

### In R, how to sample from the output of combn(a,b) if the “a choose b” is too large?

I would like to sample 1 million vectors from the set of vectors $$\mathbf{v} = \{v_1,v_2,...,v_n \}$$ subject to $\sum_{i=1}^n v_i = 1$ $\forall i: v_i \ge 0$ each $v_i$ has at most 2 decimal ...
120 views

### Correct variance estimation for random sample post-stratification weights

I'm dealing with a random sample and I have a question about its poststratification weights. Let's assume that: this is a random sample of addresses, but post-stratification weights have been ...
497 views

### Understanding F-test to compare variances (R's var.test)

I gave run the following codes in R console: ...
204 views

### The sample size applied to a non-normal distribution

I have a single variable that represents my population values (sample of data): ...
513 views

### Cluster Big Data in R and Is Sampling Relevant?

I'm new to data science and have a problem finding clusters in a data set with 200,000 rows and 50 columns in R. Since the data have both numeric and nominal variables, methods like K-means which ...
118 views

### What is behind JAGS (Just Another Gibbs Sampler)?

I have been using JAGS but I am not quite sure how it actually simulates it values. I need to know in a general sense what's going on in the background. Thanks for the help
181 views

### R: Density estimation vs Histogram Estimation

To draw random samples from a custom distribution, I recall reading that KDE's are better than histograms. (See hadley's comment here.) When I experimented in R, I am finding that the KDE method ...
51 views

### How to pick a sample from a multiple group, stratified population for repeat surveys

I provide support to about 500 internal customers on a computer system. I want to start measuring my 'customers' satisfaction on some kind of routine schedule. However my customer base can be ...
163 views

### Downsampling excessively sampled curves

I'm looking for a quick (event if not so accurate) way to deal with over-sampled curves using R. Consider the following example in which x contains 1000 values in ...
53 views

### Condition in conditioned latin hypercube sampling

I am trying to use conditioned latin hypercube sampling in R (clhs package, see here). Unfortunately, I don't really understand how the cost parameter can be used. ...
94 views

### Regarding the sampling procedure in Adaboost algorithm

The AdaBoost algorithm states that it is to train a classifier based on the training data according to a weight vector. Assume the size of training data is N, the weight vector is of dimension N as ...
40 views

### Sampling method for constructing multiple groups from a given pool

There is a set A having $N$ elements. Based on set A, I would like to construct $M$ groups, where each group has $P$ elements. Naturally, $M P <N$. All of those elements in the $M$ groups are ...
548 views

### mtry and unbalanced use of predictor variables in Random Forest

I am working on the Random Forest prediction, with the focus on the importance of predictor variables, and have a question regarding understanding of mtry and the actual usage of variables in the ...
78 views

### Statistical test to find variable causing failure

I have a database with tests that are either a pass or fail and around 25 description fields. Each description field is either a boolean or has between 3 and 10 options. I'd like to hook into my ...
268 views

### What are the rules / guidelines for downsampling?

I have a data set with ~ 7 million rows, of which ~ 100k are positives. I'm looking to shrink the data by keeping all the ...
128 views

### Absent categorical data levels in Bootstrap samples

I have a huge dataset ($n$ around five million, $p$ around three thousand) for a classification problem, where my interest is predictive class probabilities for test data, not the target. I shall be ...
199 views

### How to reconstruct database from cross-tabulated data?

I am given a set of almost 100 crosstabulations (most 2D, but some three dimensional) based on a single, yet unavailable dataset. My task is to perform basic statistical tests ($\chi^2$, Mann-Whitney, ...
1k views

### How to resample in R without repeating permutations?

In R, if I set.seed(), and then use the sample function to randomize a list, can I guarantee I won't generate the same permutation? ie... ...
1k views

### How do I sample without replacement using a sampling-with-replacement function?

I vaguely recall from grad school that the following is a valid approach to do a weighted sampling without replacement: Start with an initially empty "sampled set". Draw a (single) weighted sample ...
884 views

### A robust R package to do MCMC and Gibbs sampling

I need to make linear model for which I need to do Gibbs sampling in MCMC simulations. The model needed to be fitted is a linear mixed model. Please suggest me for a robust R package for this task.
817 views

### How to calculate sample size for comparing the area under the curve of two models?

Because I would like to calculate the sample size for comparing the area under the curve (AUC) of 2 models (cross-sectional study, predictor = continuous variable). Can you point me which function in ...
278 views

### Incidence density sampling in R

I was wondering if there is an R package to perform incidence density sampling for a case-control design. That is, for matching in a case-control design; accounting for multiple matching covariates.
2k views

### Generating random samples from a custom distribution

I am trying to generate random samples from a custom pdf using R. My pdf is: $$f_{X}(x) = \frac{3}{2} (1-x^2), 0 \le x \le 1$$ I generated uniform samples and then tried to transform it to my custom ...
460 views

### Multistage sampling in R

I've got a dataset similar to this: ...
199 views

### Sample selection and variation in the variable of interest when using panel data

I wonder how to reason when selecting samples. I am doing a panel data regression analysis about how the euro membership correlates with the budget deficit in the member countriues. Using R that is: ...
1k views

### How to re-sample an XTS time series in R?

I have an irregularly spaced XTS time series (with POSIXct values as index type). How can I build a new time series sampled at ...
415 views

### Should I use an average ECDF?

This relates to a previous question of mine which didn't gain many responses, perhaps because it wasn't very clear nd well written. I hope this time I will be more accurate and get your much ...
472 views

### Estimate the size of a population being sampled by the number of repeat observations

Say I have a population of 50 million unique things, and I take 10 million samples (with replacement)... The first graph is I've attached shows how many times I sample the same "thing", which is ...