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
1answer
29 views

Transforming time series to compensate for change in variance

I have a time series (shown below) that comes from a sensor whose calibration was changed in the middle of last year. As part of this change, the sensor's reading of the variance (or volatility) of ...
0
votes
0answers
14 views

log-likelihood and negative binomial zero inflated distribution in glmmADMB

Anyone know how glmmADMB calculates log-likelihood and negative binomial zero inflated distribution? I compared a model using glmmADMB and pscl and the diference in AIC and parameters are huge. I ...
0
votes
0answers
23 views

Model assumptions and diagnostics for proportional hazard regression model with frailty in R

I am wondering are there any assumptions that must be met in the proportional hazard regression model with frailty? I remember that in regular proportional hazard model without frailty all variables ...
0
votes
0answers
43 views

Determining Relative Weights

I am looking for some recommendations and more specifics about how to do the following: Objective: To determine the weights of a number of stock valuation metrics. I am looking at doing this across ...
1
vote
0answers
28 views

Has anyone publicly shared an implementation of RUSBoost in R?

There's no package available on CRAN, so I was hoping someone in the community had written their own function/package. I see it's been done in MATLAB, so I may just have to start with that and write ...
0
votes
0answers
13 views

Create list from for loop if value in sequence is greater than .5 [migrated]

Trying to create a list of significant variables for a regression model. I have 82 variables, so in order to only include the significant ones, I created a list of the correlations and sorted them. I ...
0
votes
0answers
31 views

why Hierarchical Clustering pvclust vs. hclust got different result?

I am performing the hierarchical clustering analysis on a dataset of 25 viral populations using 3 viral components (variables) to construct a dendrogram with average method and correlation distance ...
0
votes
1answer
19 views

lm() producing many NAs for coefficients

I am trying to run a regression using about 80 independent variables. The problem is that the last 20+ coefficients return NA. If I condense the range of data to within 60, I get coefficients for ...
1
vote
0answers
12 views

Nest-Varying Parameters in Nested Logit Model Estimation (mlogit package)

I am trying to replicate a Stata manual example (-mlogit-) of nested logit estimation, ...
0
votes
1answer
14 views

Mantel Test data assumptions

Does the Mantel Test works with non-normal distributed samples? I couldn't find anything clear enough about it.
2
votes
1answer
27 views

wilcox.test usage in R

I would like to know if there is a difference in the values taken from measurements of a given characteristic sampled at primary forest (Point=1) and secondary ...
0
votes
0answers
5 views

wilcox.test usage in R [duplicate]

I would like to know if there is a difference in the values taken from measurements of a given characteristic sampled at primary forest=1 and secondary ...
0
votes
3answers
42 views

Covariate no longer significant after inclusion of interaction term

I'm trying to interpret some results here, and just want to make sure that my logic is sound. I'm predicting a binary outcome with a categorical predictor (gene level coded as 0, 1, or 2 dependant on ...
2
votes
0answers
31 views

Is two years enough for panel data analysis?

I have around 800 companies for only two years period. However, around 200 of them have only one year observation. Is it still possible to conduct panel data analysis with such data Thank you
0
votes
0answers
12 views

Libraries for (label propagation algorithms/frequent subgraph mining) for graphs in R

General description of the problem There is a graph where some of the nodes have a certain type(There are about 3-4 types). For other nodes, type is not known. I want to predict, based on my graph, ...
0
votes
2answers
41 views

Normal Distribution with random mean and standard deviation

When trying to code this in R, I'm getting very confused about what to do. Apologies if my terminology is incorrect but I would be grateful for any advice. The Problem: I have been given two normal ...
1
vote
0answers
24 views

Classifiers that support weighting of the instances

I'm thinking of implementing my own boosting algorithm, so I'm looking for any multiclass classfication algorithms that would support weighting of the examples, i.e. you could specify what examples ...
0
votes
0answers
14 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: ...
1
vote
0answers
8 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
25 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 ...
2
votes
1answer
25 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
0answers
8 views

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

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 ...
0
votes
0answers
28 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, ...
0
votes
1answer
28 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 ...
-5
votes
0answers
32 views

deployment of R codes [closed]

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
0answers
22 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 ...
1
vote
0answers
13 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
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.
0
votes
0answers
14 views

Extended COX model in R [closed]

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 ...
1
vote
3answers
45 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 ...
1
vote
0answers
14 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 ...
0
votes
1answer
31 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
70 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 ...
2
votes
2answers
64 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 ...
6
votes
1answer
219 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 ...
5
votes
3answers
139 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 ...
3
votes
2answers
55 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 ...
1
vote
0answers
13 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. ...
1
vote
0answers
14 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
57 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 ...
0
votes
0answers
13 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 ...
-4
votes
0answers
92 views

Exploratory regression analysis for data with missing values

Recently I have performed an exploratory regression analysis, using lavaan R package and observed the following output with some warning messages in it. I have the ...
1
vote
0answers
22 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
14 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 ...
0
votes
0answers
8 views

R - What does “incomplete block on file” mean? [migrated]

I am using RStudio, and am trying to use packrat with my current project. I click the checkbox "Use packrat with this project" and press OK, where I get the following output from the console: ...
1
vote
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): ...
0
votes
0answers
14 views

Sum to Zero Constraint GAM Factor Interaction

I was under the impression that the smooths fit with mgcv were made identifiable through a sum to zero constraint - i.e. if one was to sum the smooth over the ...
0
votes
0answers
14 views

How are CP (Cost Complexity) values calculated in RPART (or decision trees in general)

From what I understand, the cp argument to the rpart function helps pre-prune the tree in the same way as the minsplit or minbucket arguments. What I don't ...
0
votes
1answer
38 views

Estimating the area between two ecdfs

I wish to calculate the area between two ecdfs in R (see below): ...