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 program in `R`.

learn more… | top users | synonyms

0
votes
0answers
4 views

Result of the summary of the proportional hazard model with frailty in R

I am trying to fit coxph a model with frailty with syntax below: ...
0
votes
0answers
14 views

Confused about the proper way of testing for an improvement or worsening

I want to check if a new equipment improves a score compared with the older equipment. My database contains the score with the old equipment, and the scores with each new equipment. I googled, ...
4
votes
1answer
57 views

How to statistically compare groups for multiple density plots?

Is there a statistical method to compare these density plots other than ANOVA (MANOVA)? I would like to compare the densities among year within each plot and report which of those distributions are ...
2
votes
1answer
10 views

R - ROCR Library - Understanding predict and prediction method

My name is Abhi and I am trying to understand the difference between predict and prediction. I am using the r language and my ide is rstudio. I have created a random forest model (r package ...
0
votes
2answers
44 views

Is it possible to construct a discrete-time multilevel hazard model in R?

I'm trying to run a discrete-time multilevel hazard analysis comparable to the model proposed by Barber et al. I am attempting to model the hazard of migrating internationally using predictors at the ...
0
votes
1answer
66 views

Visualize process data

I have a dataset of order processing with 8 million rows with following columns: HistoryId - Identity column of the records ...
1
vote
0answers
6 views

Is there any bioinformatic databases gallery webpage like that of biocViews of bioconductor?

I think typical bioinformatician will keep a bunch of database files on their computers, so what are they? And how do they normally use (access) them?
0
votes
0answers
16 views

likelihood problem with exponential distribution using R

How can I solve this problem using likelihood in R? The data below are the survival time (in years) for 10 patients over 65 years after the diagnosis of a particular type of cancer: 10.5 0.2 7.4 0.8 ...
0
votes
0answers
6 views

What is the typical miRNA microarray analysis workflow using R? [on hold]

Say just a test group of 5 replicates from bladder cancer tumor and corresponding control group from normal tissue of the same patients,like from the NMIBC part of GSE39093. What could I do to make ...
4
votes
1answer
104 views

Clustering data that has mixture of continuous and categorical variabes

I have data that represent some aspect of human behavior. I want to cluster it (unsupervised) into behavioral profiles of some sort. now, some of my variables are categorical (with 2 or more ...
2
votes
1answer
133 views

Post-hoc tests on linear mixed model give mixed results.‏

I am quite new to R so apologies if I fail to ask properly. I have done a test comparing bat species richness in five habitats as assessed by three methods. I used a linear mixed model in lme4 and got ...
0
votes
1answer
49 views

In the output of lsmeans, is “estimate” is effect size of that contrast?

I am using lsmeans to run post-hoc analysis for contrasts of linear mixed model, and here is the output: ...
0
votes
1answer
25 views

Lsmeans: Is this what I did?

after doing the linear mixed model with lme4, I have used lsmeans for pairwise comparison with this command: lsmeans(lmer52, pairwise~color, adjust="tukey") I am ...
0
votes
1answer
24 views

Compare regression slopes of repeated measures linear regression

In my design, I have two groups of subjects and every subject is tested in four different conditions. So, I have a within-subject factor ('span_num', which ranges from 0 to 3) and a between-subject ...
0
votes
1answer
19 views

Find the amount of variation due to another covariate

I'm trying to explain a binary outcome (cardiovascular disease) with a categorical predictor (gene level, coded as 0, 1, or 2 depending on the number of risk alleles present). I'm trying to determine ...
0
votes
1answer
176 views

Finding the state for Markov chain in R based on a generated sample

I am looking for a R code of discrete Markov chains. I have done the following: ...
0
votes
0answers
19 views

Reproducing ARIMA error terms

When forecasting a moving average (MA) model using R's forecast, why does using residuals(fit) produce different results than ...
-4
votes
0answers
26 views

deployment of R codes [on hold]

This topic has been discussed off and on various times. I have not found a satisfactory answer yet. I have developed a model using R. I would like to deploy it within enterprise. Is there a framework ...
0
votes
1answer
69 views

fit nonlinear regression model to data

I was wondering how can I best fit nonlinear regression model to this data, using R package. How can I check if model is good fitted since Rsquared value is not returned in most functions for ...
1
vote
0answers
12 views

Mixed effect models: Why are variance components incongruent with predictive power in presence of hidden interactions?

I have noticed that if there are interactions between hidden variables not in the model, then the variance estimates are inflated greatly compared to the predictive power of the model itself, and I'm ...
0
votes
0answers
13 views

Extended COX model in R [on hold]

Objective: To predict time to event of a customer using R I developed a Non parametric model but as per my understanding we cannot perform predictions from these models, so I have to build a model ...
2
votes
3answers
53 views

Test model coefficient (regression slope) against some value

In R, when I have a (generalized) linear model (lm, glm, gls, ...
2
votes
1answer
716 views

Non-parametric test for repeated measures and post-hoc single comparisons in R?

Some attribute $x$ of 17 individuals was recorded repeatedly on 6 time points using a Likert scale with 7 distractors. Which statistical test(s) can I apply to check whether the changes along the 6 ...
2
votes
2answers
301 views

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45?

How to transform a normal random variable such that I can simulate normal samples between the range of 1 and 45? Do I need to do a jacobian transformation ?
6
votes
1answer
194 views

Generate random numbers following a distribution within an interval in R

I need to generate random numbers following Normal distribution within the interval $(a,b)$. I know the function rnorm(n,mean,sd) will generate random numbers ...
2
votes
2answers
59 views

How to predict the amount of data needed for modeling?

Is there a way to estimate the amount of data (or the number of records) required to build a statistical model? I read few blogs and I feel that most of the responses concur that there is no way or ...
3
votes
2answers
53 views

Why isn't the lasso selected variable even not significant?

I performed a lasso selection using lars::lars for a well normally distributed outcome using a pool of 86 predictors. Here is the plot of the output: The ...
0
votes
0answers
23 views

Fitting mixed effects logistic regression with random effects

I have a data frame of 134 observations, 9 independent variables, and a binary, categorical response; please see its structure below: ...
0
votes
3answers
2k views

How much RAM is needed for simulation studies using R?

I run several simulation studies with R using a MacBook Pro, which has 8 GB of RAM. Unfortunately, some of the simulations cannot be done due to limited memory. My question is how much RAM is needed ...
1
vote
3answers
35 views

Correlation using Logistic Regression and Pearson

I am so sorry, I am beginner in statistic analysis, I have project using R to analyze the correlation between dependent variables and independents variables. In this case I have two dependent ...
0
votes
0answers
12 views

How to handle large .csv file in R? [migrated]

I have a large(>100,000) single column floating point time-series data. I want to find structural changes within the data with respect to time( in my case index). In-order to do that, I am using R ...
0
votes
0answers
6 views

Extracting metadata (author, creation date …) from word documents with R [migrated]

I would like to extract the metadata (author, creation date ...) from a batch of MS word documents with R. Can anybody tell me if that is possibile, and if so how I can do this? Thanks, Fred.
1
vote
0answers
8 views

Test if a slope falls within a back-transformed (log) prediction interval

I'm trying to test the hypothesis that the relationship (slope) between second molar tooth size and overall molar tooth size is 0.33 (in species of rodents), using generalized least squares regression ...
-4
votes
0answers
70 views

Exploratory regression analysis for data with missing values [on hold]

Recently I have performed an exploratory regression analysis, using lavaan R package and observed the following output. What can be said about the warning messages ...
2
votes
1answer
165 views

PAM with Gower distance matrix

My data is is mostly continuous but has one binary variable. I tried the pam algorithm in R with the Gower index, but the number of clusters that give the best ...
5
votes
2answers
121 views

Simulation involving conditioning on sum of random variables

I was reading this question, and thought about simulating the required quantity. The problem is as follows: If $A$ and $B$ are iid standard normal, what is $E(A^2|A+B)$? So I want to simulate ...
1
vote
1answer
93 views

Random forest cross validation for feature selection, imbalanced datasets

I have an 5297X26 imbalanced dataset, the class1 has 588 samples and class2 has 4709 samples. I used the following code to perform random forest: ...
1
vote
0answers
10 views

Estimated random effects correlation of 1 when fitting a random intercept model using lme

I am trying to fit the linear random effects model: $y_{ijk}=\theta_{ij}+\epsilon_{ijk},$ where $\theta_{ij}$ is a random effect. I assume the random effects and error distributions are normal. ...
0
votes
0answers
19 views
+50

F-adjusted Mean Residual Test in R

I'm running diagnostics on a logit model in R produced with glm(formula = formula, data = data, family = "binomial"). I'm ...
0
votes
1answer
55 views

Calculating $R^2$ two different ways

I am calculating my $R^2$ for a model two different ways. I used pred = predict(model, newdata = mydata, se.fit = T) and then calculated ...
4
votes
3answers
104 views

Estimating the ratio of cell means in ANOVA under lognormal assumption

I am conducting a two-sample test (1-way ANOVA with 2 treatments), and the goal is to estimate the ratio of cell means assuming that the data are lognormal. A simple approach is to log the response ...
0
votes
1answer
53 views

Are my data zero inflated?

I'm building a function/package. If the users' entry data are zero inflated then the code will log-normalise them, process them, and reverse-log-normalise and bias-correct them afterwards. If they're ...
1
vote
0answers
11 views

'systemfit' package and systems of non-linear equations/regression

I am trying to estimate a system of non-linear equations using 'systemfit' package in R. I have had issues with it. The two equations share the same parameters i.e. "sigma", "al" and "ae". I expect ...
0
votes
0answers
234 views

Using R-Studio for data mining to compare different data sets against one another, asynchronously

For a project, I've collected some basic information on weather, and some basic information on births. Both data sets are focused on a single state, Massachusetts. The weather set contains very ...
0
votes
0answers
12 views

using decompose function for high frequency data

I have a table as Date Time Energy 1/1/2008 10:30 0.89 1/1/2008 11:30 0.76 and so on. The data is recorded for every half an hour. I wish to ...
0
votes
1answer
36 views

Estimating the area between two ecdfs

I wish to calculate the area between two ecdfs in R (see below): ...
1
vote
0answers
16 views

Estimating parameters and latent variables in a split Poisson distribution using R and JAGS

I am trying to estimate parameters and latent variables in a split Poisson model that describes observable and unobservable counts in time assuming the split probability is $\pi$. An observable event ...
0
votes
0answers
11 views

Time series Data Analysis and Forecasting by country and time factor

cty year qtr tl Argentina 2009 Q4 3 Argentina 2010 Q1 2 Argentina 2010 Q2 7 Argentina 2010 Q3 7 Argentina 2010 Q4 10 Argentina 2011 Q1 7 Argentina 2011 Q2 7 Argentina 2011 Q3 1 Argentina 2011 ...
3
votes
2answers
1k views

Singularity issues in multinomial model using R

I am trying to develop a mode choice model (4 modes: hov, transit, bike, walk) and below are two approaches I am using. I am having problems in both Approach 1 Mode choice as a function of price ...
0
votes
0answers
13 views

How to compare fit of discrete process with discrete underlying process?

I am basically looking for an equivalent to something like an $\mathbb{R}^2$ for a model on a dataset that is itself simply a collection of points. That is, if my data set is (trivial example): ...