Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

learn more… | top users | synonyms

1
vote
0answers
206 views

Fitting data/determining parameter values for custom (biPareto) distribution

I have a dataset containing information about a bunch of wireless devices. Specifically, the number of other wireless devices each device encounters. Based on other researcher's prior work in the ...
2
votes
2answers
292 views

Results Difference: Frequentist vs. Bayesian

I fit a lognormal model on some data points using both frequentist and Bayesian (using a non-informative prior) approaches. However, I got different results. Here are my codes and outputs: ...
2
votes
2answers
105 views

Can you use proportions as a covariate in a Cox proportional hazards model?

In R's survival::coxph function, can I mix a covariate representing proportions (in the range 0.0-0.5) with an integer covariate (in the range 1-15), or should I ...
5
votes
1answer
538 views

K-L divergence is 0 for clearly different distributions. Why?

I have two datasets whose densities look clearly different. However, when I use the KLdiv function, it gives me a value of 0 and I don't understand why. Any suggestions on where I am going wrong? ...
4
votes
1answer
299 views

Exponent for non-linear regression (in R)?

I have a non-linear reglationship and I want to find the best way to determine the value for the exponent $\gamma$ in the following regression: $y = \beta x ^ \gamma$ I would preferably like to do ...
0
votes
0answers
285 views

Lognormal curve fitting

Ok I am guessing this is a trivial question however having pondered it for a few days the only thing I have become clear on is my lack of statistical prowess. Yesterday I asked a question on fitting ...
1
vote
1answer
445 views

Inter quartile range and outliers in boxplot with logarithmic y-axis

Let's say I have a set of data which are lognormal-distributed and I want to create boxplots. The part of the values which is symbolized by the box may lie somewhere around 1. In that case, the inter ...
0
votes
0answers
99 views

Assigning weights

A Company has 4000 employees. Employee1 works 3 hours on monday, 1 hour on tuesday, 0 hours on wednesday and thursday, 5 hours on friday and 6 hours on saturday. It seems he worked more hours on ...
4
votes
1answer
308 views

Markov Chain process - Missing values

I have a vector of sequences with presence (1) and absence (0), from were I have calculated the first order Markov Process. ...
3
votes
1answer
656 views

Comparing means of two simple time series

I'm trying to look for difference in timing (ie. earlier/later) in a variable measured at regular intervals between two groups. This seems like a simple experimental design, and working in R, I'm ...
13
votes
2answers
8k views

What's the most pain-free way to fit logistic growth curves in R?

This isn't as easy to Google as some other things as, to be clear, I'm not talking about logistic regression in the sense of using regression to predict categorical variables. I'm talking about ...
1
vote
1answer
244 views

Logistic regression in R with large amounts of data

I am currently carrying out an investigation to find if certain factors such as playing home or away or position of a footballer affects overall pass completion using logistic regression. I am using R ...
1
vote
0answers
85 views

Computing precision of continuous classifier with ordinal outcome

I have data where a rater predicts quality on a continuous scale, and quality is then validated in buckets. For example, one rater might give scores of 0.2, 0.4, 0.7, and 0.6 for cases with outcomes ...
0
votes
1answer
178 views

How can one convert multiple DVs from long to wide? [closed]

Consider the following example long data.frame with two dependent measures, "Score" and "NewVariable", 1 between subjects variable "Prep" (3 levels), 2 within subjects variables "Day" (3 levels) and ...
3
votes
1answer
564 views

R: Defining a new continuous distribution function to use with Kolmogorov-Smirnov Test

I wish to run the Kolmogorov-Smirnov test on my data to determine how well it conforms to a specific continuous distribution function I have in mind. If my understanding is correct, the ...
7
votes
2answers
4k views

Two seasonal periods in ARIMA using R

I'm currently using R to predict a time series with these instructions: ...
3
votes
2answers
1k views

Kriging on log transformed rainfall data

I am beginner in R. I had found in the literature that prior to performing kriging on the data, the distribution has to be investigated to check if it is Gaussian. So, in order to check if the data ...
3
votes
1answer
682 views

Analyse unbalanced repeated measures 2x2x2x2 type II anova interactions

I have a run an unbalanced 2x2x2x2 Type II ANOVA in R and am having trouble following up on the results. Here is the output: ...
2
votes
1answer
480 views

How to simulate sum of two normal distributed variables when linearly transformed?

I m trying to replicate a paper's simulation results, but am not having much success. The equation is: $$ P_t = \beta_{PD}*X_t + \varepsilon_{PD,t} $$ $P_t$ (by assumption) is described as ...
0
votes
1answer
312 views

lm regression in R - inconsistent R² for intercept-free model?

I am carrying a linear regression on some data. One of my variables is a factor (categorical). Using regression with an intercept leads to difficult interpretation, since one of the factor levels is ...
2
votes
1answer
585 views

EM algorithm for fitting GMM in multivariate case in R

I am currently playing around with Gaussian Mixture Models in order to model stock returns. Part of all this is using the EM algorithm to obtain MLE of parameters. I have found a package in R ...
2
votes
0answers
51 views

References about profiled deviance components

I have read the excellent slides "Assessing the precision of estimates of variance components" from Douglas Bates. I'm looking for some references about these profiled deviance components (for ...
2
votes
1answer
259 views

Individual differences scaling, additional investigations

I am learning individual differences scaling (AKA three-way multidimensional scaling) and I want to know what different ways there are to state that my results are reliable. I had to perform ...
-1
votes
1answer
294 views

Extracting values from R output of bugs command [closed]

I asked this question on http://stackoverflow.com/, but I couldn't get what I want. So, I am asking it here. I am running winbugs from R and I need to use some variables in R output. When I type ...
0
votes
0answers
110 views

Type of ANCOVA design in R

I have the dataset that contains one continuous measure of plant leafs (PC1 scores of individual leafs), that is dependent variable and three others that I need to use as independant, explanatory. One ...
2
votes
0answers
25 views

Kriging on log transformed rainfall data [duplicate]

Possible Duplicate: Kriging on log transformed rainfall data I am beginner in R.I had found in literature that prior to perfoming kriging on the data the distribution has to be investigated ...
10
votes
2answers
2k views

Propensity score weighting in Cox PH analysis and covariate selection

Regarding propensity score weighting (IPTW) when doing Cox proportional hazard modeling of time-to-event survival data: I have prospective registry data where we're interested in looking at treatment ...
0
votes
1answer
733 views

Questions about the glht function for planned comparison

I have a nested model with the following effects fixed: treatments random: experiment_date I used lme() to model the data ...
2
votes
0answers
289 views

Nested repeated measures analysis

I have a nested repeated measures question. I have 20 individuals grouped into 5 families. For each individual I have measurements on subsequent days pre, during, and post-treatment for a total of 6 ...
2
votes
1answer
2k views

Missing values in GLM

I am applying glm on a data in which most of the values are NAs or blank. For example, in the example data produced below (4 predictors and one response variable), the default glm command will remove ...
1
vote
1answer
186 views

Free PDF for Bayes

Is there an good book/pdf similar to Elements of Statistical Learning that's available for free, online that deals with Bayesian statistics, ideally with code for ...
2
votes
3answers
540 views

Two fair coins, why increasing trials in prop.test not reduce false positive?

I am simulating two fair coins and running a prop.test, how come increasing number of trials doesn't decrease false positive? I'm suspecting it's in some underlying ...
5
votes
1answer
1k views

Latent class model with both continuous and categorical indicators in R

I have question regarding which R-package to use to create a latent class/mixture model with both categorical and continuous indicator variables. I have not yet found a good example of this using R, ...
2
votes
1answer
5k views

auto.arima from Forecast package

I am trying to fit a time series using the function auto.arima and I face some strange results. As a first try, I use the command ...
9
votes
1answer
2k views

How does extreme random forest differ from random forest?

Are they more efficient implementation -- is the difference important from practical point of view, there is R package which implements them. Is it new algorithm which overcomes "generic" ...
3
votes
1answer
705 views

Preliminary estimates of ARIMA in R?

We know that dealing with model involving MA factors is not easy to estimate, since there are past values of errors to be computed recursively. And this recursive estimation requires preliminary ...
0
votes
3answers
1k views

Is it possible to extract fixed effects in the fixed effects model in Stata?

Is it possible to extract fixed effects in the fixed effects model in Stata? I know that in R I can do something like this with fixef command: ...
-1
votes
1answer
287 views

Logarithmic regression of form $y=a+b \log(x_1)+c\log(x_2)$ using R [closed]

How can I fit a logarithmic regression equation of form $y=a+b (\log (x_1)) + c(\log(x_2))$ on a data set using R? Here the main concern is that data contain zeros multiple times, so R will give ...
4
votes
1answer
797 views

Best method to validate a multiply imputed Cox model with R?

This question is with regards to using a test data set to validate an imputed Cox model using R. With a non-imputed data set I would use val.surv() from ...
0
votes
0answers
27 views

the approach for checking whether a process is stable?

I have two scenarios for time series data. 1) I have a uni-variate variable spanning across the time axis, are there any approaches or statistic to check whether this process is stable? 2) I have a ...
-1
votes
1answer
760 views

Logistic Regression with holdout sample [closed]

I am trying to run a logistic regression in R on my data where my independent variables are 13 continuous variables and my dependent variable is binary. I want to segment my data so that I train on ...
3
votes
3answers
2k views

Data visualization from hierarchical clustering

I have data from questionnaire from school. 35 questions are various questions (influence of friends etc.) Possible answers for 35 questions are "definitely yes", "mostly yes", "mostly no" and ...
2
votes
1answer
239 views

Statistical properties of parameters estimated by method of Lagrange multipliers in R

I have time series data that can be fitted by a constrained non-linear function (non-linear in the parameters to be estimated). I'd like to use the method of Lagrange Multipliers (link), specifically ...
1
vote
1answer
224 views

Simple way to fit large number of single factor logistic regression models in R - automatically

I have a dataset with one binary target variable called “target” and many many factors “F1”, F2”… “F200”. I’m trying to come up with code to fit 200 single factor logistic regression models and return ...
5
votes
1answer
623 views

Index plot for each cluster sorted by the silhouette

After a cluster analysis I´m trying to plot for each cluster the Index plot of the Silhouette value instead of for the complete dataset (like in the WeightedCluster Library Manual by Matthias ...
5
votes
0answers
795 views

Stationarity tests for time series

I am currently working on time series modeling, especially on stationarity tests. For this purpose, I am extensively using Pfaff's book "Analysis of integrated and cointegrated time series with R" and ...
1
vote
1answer
5k views

Error in boxcox.default(y ~ x) : response variable must be positive

Error in boxcox.default(y ~ x) : response variable must be positive I am getting this error in R when I am performing a ...
-2
votes
1answer
3k views

How to perform boxcox transformation on data in R tool [duplicate]

Possible Duplicate: How should I transform non-negative data including zeros? Error in boxcox.default(y ~ x) : response variable must be positive I want to perform box cox transformation ...
4
votes
3answers
7k views

How to investigate a 3-way interaction?

There is a significant 3-way interaction in a data-set I'm working with. The interaction involves both categorical and quantitative variables. I have been pointed towards simple slopes and this ...
-3
votes
1answer
6k views

How to call glm when response variable is categorical in R?

I have following data stored in a file. I am applying 'glm' in R to find linear regression equation to best predict the 'output'. ...