R is an open source programming language and software environment for statistical computing and graphics.

learn more… | top users | synonyms

0
votes
0answers
34 views

extended cox model with continuous time dependent covariate - how to structure data?

I need to run an extended cox model with a time-varying covariate in R: let’s call it the number of doses (X). I am interested in the hazard ratio associated with each level of X, ie. how an ...
1
vote
2answers
51 views

Persistent cluster IDs over similar inputs with k-means

I have multiple kmeans plots that I have generated in R. Specifically I have $5$ weeks and I generate $1$ kmeans plot per week. ...
2
votes
1answer
67 views

What does R mean by “unbalanced design”?

I think this means an unequal sample in different conditions. But it seems to mean something else. . . I have a data set like below ...
0
votes
0answers
23 views

How to calculate the weighted sum of absolute deviations to determine AIC for quantile regression

I would like to know if there is a way to calculate the sum of the weighted absolute deviations for quantile regressions with package quantreg? I'm following the ...
0
votes
1answer
52 views

How to simulate a hidden Markov chain?

I want to simulate data from a 3-state hidden Markov chain with a known matrix of transition probabilities. Each state corresponds to a bivariate data with known marginals that the dependence between ...
3
votes
0answers
101 views

Multilevel modeling of experimental data with repeated measures in the same condition of factorial experiment

I'm struggling with modeling some experimental data using the lme4 package in R, and would appreciate input. My experimental design is as follows: subjects ...
0
votes
0answers
16 views

(Population) pharmacokinetic M&S: AUC from sparse sampling in R

I’m relatively new to (population) pharmacokinetic analyses and have a principal question with corresponding programming. I have both an already established pharmacokinetic model and a new data set ...
1
vote
0answers
30 views

Estimate multinomial probit model with mlogit (R package)

From the document and help, probit model is supported by mlogit. But when I tried it with these R scripts, the estimation takes much longer time to run (than the logit verion) and the result is quite ...
-1
votes
0answers
33 views

Compute column standard deviation

I generated data from weibull; and named it as data1 x=rweibull(n=50,shape=3.scale=2) Then,i made the data missing for 10%.(missing data named as 'data') After ...
1
vote
1answer
40 views

How to explain how I divided a bimodal distribution based on kernel density estimation

I have a dataset of bimodal population. It contains a smaller peak, which is considered to be "bad", and a bigger peak. I try to separate the bad part of data from the rest of data. What I did was: ...
1
vote
1answer
57 views

Comparing GLS models with different fixed variables using AIC: REML or ML?

I am using gls in nlme. My response variable is spatial so I am using gls with correlation structure. I am determining which structure to use based on Zuur 2009, comparing AIC scores of models with ...
-1
votes
1answer
61 views

Calculate column standard deviation in r

I want to calculate Prediction accuracy value for comparison between 2 variables, data1 and data2. data1 is a single variable with n=50 (same with data2) I put sd(), first, but I got a warning. my ...
1
vote
1answer
62 views

Fast way to calculate difference in normal CDFs

I'm running a computationally intensive method where I have to calculate the difference in Normal CDF's millions of times, such as pnorm(y)-pnorm(x) I have not ...
0
votes
0answers
20 views

Obtaining threshold values from a ROC curve (R, ROCR) [migrated]

I have some models, using ROCR on a vector of the predicted class percentages, I have a performance object. Plotting the performance object with the specifications "tpr","fpr" gives me a ROC curve. ...
0
votes
0answers
27 views

incorporating averaging models from AIC and still using k-fold cross validation?

Ive a county/district that Ive divided into ~300 grids that are 15km^2 in size attributed with various habitat and economic variables that have been summarized and standardized. I then have 2 types ...
1
vote
0answers
25 views

Examining the relative efficiency of the trimmed mean

Using the following reference A survey of sampling from contaminated distributions, I am trying to investigate the relative efficiency (RE) for the mean vs the trimmed mean, given the following ...
0
votes
0answers
12 views

Is there a analog of complete.cases for variables in R? [migrated]

Here is an example for illustration: ...
1
vote
1answer
66 views

“ random effects must be less than the number of observations” error in lmer package

I'm trying to implement a regression model with both fixed and random effects. The package I use is the lme4. I want to find the relationship between the ...
0
votes
0answers
26 views

Gillespie Stochastic Simulation in Discrete Time using R [migrated]

I'm simulating a Stochastic Simulation for Epidemiology. How do I simulate it in a discrete time? I managed to obtain for continuous time using the coding below. ...
3
votes
0answers
60 views

Bayesian analysis with histogram prior. Why draw simulations from the posterior?

This is a beginner’s question on an exercise in Jim Albert’s “Bayesian Computation with R”. Note that while this might be homework, in my case it is not, as I am learning Bayesian methods in R because ...
0
votes
2answers
72 views

Why do we refer to our estimates in terms of precision?

Open any statistics textbook and it will urge the need to check the 'precision of our estimates'. Take the following random variable: ...
1
vote
1answer
81 views

Lmer model design

My data is a series of repeated measures in time (14 measures). I am trying to model the variable HbA1c which is a blood test performed at each visit to measure the ...
0
votes
0answers
15 views

difference between package ‘waveslim’ and 'wavethres' in R

Both are still active projects for wavelet decomposition. Based on your experience, is there a difference in approach? Things that one can do but not the other one? Thanks
-1
votes
0answers
34 views

r code for error measurement [closed]

I want to calculate error or performance between single imputation method applied on real data and simulated data.i know RMSE -- root mean square error. ...
0
votes
0answers
21 views

How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?

I am trying to calculate HPD for the coeficients of regression models fitted with lm or lmrob in R, pretty much in the same way that can be accomplished by the association of mcmcsamp and HPDinterval ...
0
votes
1answer
35 views

Efficient way to run multiple ANOVAs on subsets of data

I have a data set that is repeated-measures ratings of four devices (two two-level variables) for 6 dimensions (ease, confidence, comfort, control, size and fit), with a two-level between-subjects ...
0
votes
0answers
21 views

How does dsgh work in R? [duplicate]

I try to understand how the standardized generahl hyperbolic distribution is implemented in R. The command of the fBasics package is dsgh: ...
1
vote
2answers
44 views

Dealing with grouped / rounded data

I have a dataset that includes variables about customer income levels. The income was collected in binned fashion (...
0
votes
0answers
16 views

Are there alternative estimators for median of survival time in R?

Apparently there is no consensus upon how to estimate it (see here ). I want to report other estimators as well; are these other estimators implemented anywhere among R packages?
0
votes
0answers
12 views

black and white line plot in R [migrated]

I would like to create a black and white plot in R with 4 different variables plotted on the same figure. The plot is very small therefore I would not like to use type="o" or other default types. ...
1
vote
0answers
39 views

Questions regarding predict.glmpath()

I'm trying to do LASSO in R with the package glmpath. However, I'm not sure if I am using the accompanying prediction function predict.glmpath() correctly. Suppose I fit some regularized binomial ...
2
votes
0answers
63 views

Confusion with Augmented Dickey Fuller test

I am working on the data set electricity available in R package tsa. My aim is to find out if an ...
0
votes
0answers
17 views

return back the imputed values [migrated]

is there any function in r that can help return imputed values, for example; ...
1
vote
1answer
45 views

Standardized generalized hyperbolic distribution

I am interested in the standardized version (mean zero, variance one) of the generalized hyperbolic and the hyperbolic distribution. I want to include this in my analysis and therefore I need the ...
0
votes
1answer
30 views

EFA on R: Classifying Observations

I am newbie for R and Stats. I am using EFA in R [psych library] to identify the latent factors underlying my data. I got a reasonable amount of factors matching my purpose. My question is once I ...
0
votes
0answers
30 views

simulate weibull

i have complete ozone data.i want to test 5 single method of imputation on the data.i made the data missing for 10% and 20% and impute it. I was asked to do this: -fit weibull distribution to the ...
3
votes
0answers
37 views

Is there a better reference for r formulae than ?formula? [migrated]

There are many redundant, and sometimes conflicting, ways of specifying formulae in R. Is there a comprehensive yet concise reference for mapping a conceptual models to R syntax than ...
0
votes
0answers
48 views

Rubric for good data analysis

As statistics education moves online, educators are facing new problems related to the administration of their courses. Jeff Leek and Roger Peng, for example, taught approximately 100,000 students ...
0
votes
1answer
39 views

Error in `ezANOVA` with balanced dataset with no missing data

This is cross-posted on StackExchange, but as it has to do with statistics, I thought I'd try here. I'm trying to analyze experimental data with one between-subjects factor (...
0
votes
3answers
105 views

Identify seasonality in time series data [duplicate]

I want to detect presence of seasonality in time series data. I know one can achieve that by plotting the autocorrelation function but I need an automatic process if the series is seasonal or not, ...
2
votes
1answer
39 views

Quantify strength of association of two continuous variables while controlling for random effects

I have a data set from a repeated measures experimental design with different sets of stimuli. I want to know how strong the association between the continuous dependent variable and the continuous ...
0
votes
0answers
54 views

online RStudio service [closed]

I am looking for an online RStudio service, ideally one that supports knitr and git. The idea is to be able to work on my projects from my Chromebook. I am familiar with Statace and setting RStudio ...
1
vote
0answers
9 views

library for SNA network and graph in R with extra dimensionality [migrated]

I have a csv of the following format: person, location, time_of_day, money_spent I've been going through and seeing how to format data to make it work with the more popular libraries (see: ...
0
votes
0answers
37 views

Predict using VAR

If I arrive at an equation from VAR model; I know i can use it to predict at some relative period ahead of time by using predict(p1ct, n.ahead = 5 ci = 0.95); I ...
0
votes
0answers
15 views

R, removing the bagged samples to generate out of bag sample [migrated]

I'm trying to set up voting in a bagged model based on performance on the out of bag sample. ...
2
votes
0answers
31 views

multiple imputation with binary variables

I have 54 missing values in my dataset of 459 cases. Variables are all binary (0-1). I want to try a multiple imputation to avoid a listwise deletion, using the mi ...
0
votes
0answers
32 views

Time series in R (and prediction)

I have this data (vik): ...
0
votes
1answer
40 views

using stl (seasonal decomposition with loess) for weekly data

I am trying to decompose a weekly time series using the R function 'stl'. One of the important argument of this function is the number of data per cycle. Naturally in this case one would choose 52. ...
1
vote
1answer
83 views

Simple cloud computing to run R + JAGS simulations

I want to simulate the frequentist properties of a Bayesian model. So, for example, I might want to fit a Bayesian model 1,000 times to 50 different configurations each of which takes about 10 seconds ...
0
votes
1answer
42 views

Simulating responses from a factorial experiment for power analysis

I am thinking about a factorial experiment with two factors. Both factors are ordered factors. Factor 1 has two levels: small and large. Factor 2 has four levels: never, sometimes, frequently, and ...

1 3 4 5 6 7 79