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

1
vote
0answers
4 views

One inflated beta regression with random effects using GAMLSS

I am new to modelling percentage data, and I would be greatfull for some advice. I have proportion data (0,1] on a percentage of money sent by Player B to Player A. Participants received an amount of ...
0
votes
0answers
7 views

Would this be a problem that Survival Analysis can tackle? The problem deals with localized durations and uncensored data

I am trying to fit a model in R that doesn't have censoring. In other words, I know that each event will eventually happen. There are several experimental groups with people in each group receiving ...
0
votes
1answer
14 views

linear mixed model random effect significance LRT

Just performed LRT: (lL1 <- logLik(mixedModel)) 'log Lik.' -65435.99 (df=4) (lL2 <- logLik(linearModel<-lm(y~x))) 'log Lik.' -78234.86 (df=3) ((Delta <- ...
0
votes
0answers
12 views

Does the ghyp R package create different GHD random data than the fBasic version?

I have been comparing two packages that are calculating generalised hyperbolic density (GHD) functions as I intend to become more familiar with these. But the results are different for each package. ...
0
votes
0answers
4 views

How can I plot “intcox” interval cox proportional survival curve?

I'm doing survival analysis. I read intcox package manual but it doesn't provide R code for plotting survival curve. Anyone knows how to plot it? Many thanks ...
2
votes
1answer
42 views
0
votes
0answers
3 views

Create grid and color cells with average values of scatterplot using ggplot2 [migrated]

Given a numeric dataset $\{(x_i, y_i, z_i)\}_{i = 1}^N$, one can create a scatterplot by drawing a point $P_i = (x_i, y_i)$ for each $i = 1, \dots N$ and color each point with an intensity depending ...
5
votes
2answers
50 views

Avoiding numerical error propagation

I simulated a MA(1) process $y_t = \mu + \epsilon_t + \theta \epsilon_{t-1}$ in R and tried to recover the error terms $\epsilon_t$ just by computing them successively (supposing I know the parameters ...
2
votes
1answer
40 views

Design of matrix of contrasts in R

I am doing some post-hoc comparisons (in lme4, but here I'll just present a simple linear model), and I am having a hard time making sure that I am building the right matrix of contrasts to test ...
0
votes
0answers
8 views

In practice, how is the penalisation matrix for splines, created by smoothCon (package mgcv), specified?

Evaluating a smooth object with smoothCon provides, besides several other things, the ordinary "untouched" spline bases ...
0
votes
0answers
9 views

Seasonal vs non-seasonal coefficients in R ARIMA

Let's say I have the two following ARIMA models: ARIMA(7,1,1) (no seasonality) ARIMA(6,1,1)(1,0,0)7 (seasonality of period 7). Are they conceptually the same? If so, why is that when I model ...
2
votes
0answers
18 views

Independence of effects in meta-analysis and meta-regression

In meta-analysis, I know that an important assumption is independence. Clearly, if we want to estimate a pooled effect size, its best if each effect comes from an independent sample of observers. ...
1
vote
1answer
18 views

Is it possible to measure the independent variable with part of the dependent variable

I have Beta as my independent variable and Economic value added (EVA) as my dependent variable. To calculate EVA I need to use Cost of capital and to calculate that I have to use Beta, so is it ...
0
votes
0answers
12 views

JAGS prior-based prediction

I'm trying to use rjags to predict what the curve-maximums will be for different groups of incomplete data (one metric x and one metric y). Here is an example of the indata: ...
0
votes
0answers
15 views

Flexmix to test bimodality [on hold]

How to use flexmix in r to check the modality of dataset, for example I have a vector of some 100 numbers how should I apply flexmix to test whether this data has bimodality or trimodality? Thanks.
0
votes
0answers
14 views

In the survival analysis package of R, `survival`, where do we specify the hazard functional form?

I am trying to fit either the coxph or survreg function with the Survival package. I would ...
0
votes
0answers
31 views

Sales Forecasting using Support Vector Machine

I have sales data for last three years 2011-2013. I want to use Support Vector Machine technique in R to do the predictions. I just wanted to know that the approach that I am using is correct or not? ...
0
votes
0answers
21 views

How to interpret residual plots from time series regression

I am doing a time series regression between 2 variables. I used the dynlm library in R. I'm trying to understand how to interpret the results. Could you please point out where I am getting it wrong: ...
3
votes
1answer
46 views

It it possible in R to specify a regression formula for the hazard rate for a survival analysis model?

I am currently trying to fit a survival analysis model which has the following survival function: $S(t) = \lambda_i e^{-\lambda_i t}$ but with $\lambda_i = e^{\beta_0 +\beta_1 log(1+X_i)}$ where ...
1
vote
0answers
18 views

Inconsistency between 'read.csv' and 'write.csv' in R [migrated]

The R function read.csv works as the following as stated in the manual: "If there is a header and the first row contains one fewer field than the number of columns, ...
0
votes
0answers
14 views

How does one estimate the number of trees and the depth when using random forests?

I am using random forests for a class. I am predicting weight training. In scikit learn I always used a rule of thumb of a depth of 5, the depth x features rounded. I had 53 features, rounded to 50 ...
1
vote
1answer
32 views

why simulated gamma distributed data have negative kernel values?

I know that Gamma distribution does not allow 0 or negative values. I was doing some simulation and when I write this code in R ...
0
votes
0answers
4 views

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 ...
1
vote
0answers
15 views

Am I using Goodman-Kruskal gamma or Somers D or Kendall tau correctly and what do they mean?

I am seemingly blindly following this publication that has done work very similar to what I need to accomplish (page 18-21). My analysis is a multinomial logistic regression where I have 3 possible ...
0
votes
0answers
18 views

Percentile: Finding number of rows that satisfy for each percentile [on hold]

I am trying to find out how many users actually satisfies for each percentile (25, 50, 75, 99). I want to calculate the percentiles based on following 4 columns ...
0
votes
0answers
21 views

APA-style forest plot using metafor [duplicate]

I have produced a forest plot visualizing results of a meta-analysis, trying to meet the requirements according to the APA style, i.e., statistical terms to be italic, e.g., k = 10, or sub-scripted, ...
0
votes
0answers
7 views

Detecting pattern in panel Data R

I am struggling on panel data in R. I detected some serial correlation within my data, and now I would like to detect some pattern within it. There are 166 observations and 34 variables and the data ...
0
votes
1answer
28 views

Interpretation of multinomial logistic regression output from R

I have used mlogit package and I am trying to summarize the results I have from my model. I have a question regarding the reference value and will get to that in a ...
0
votes
0answers
28 views

What types of statistical analysis technique available to compare two different time series [on hold]

I am currently looking for suggestion to compare or study the two different period time series like sales in 2000 and 2001. As it is sales of the same product and i would like to compare those two ...
1
vote
1answer
28 views

multivariate dirichlet for multiple imputation

I dealing with 3 covariates {x1, x2, x3} all three are discrete and contain missing data. ...
0
votes
0answers
9 views

package in R for BMA of a logistic model?

I am trying to perform analysis similar to Gerlach et al. (2002). it involves predicting the posterior probability of a particular binary outcome using the previous 5 observations. I was just ...
1
vote
2answers
13 views

clustering evaluation based on a gold standard

I have a dataset of items and I want to measure how my clustering method works. I'm using R and simple k-means clustering. I have a lets say gold standard of my clusters and I want to see how good is ...
0
votes
0answers
27 views

Random Forest - understanding k fold cross validation

I am trying to improve my data science knowledge by solving problems available on the internet. I am currently using the R package randomForest to classify the ...
1
vote
0answers
13 views

geepack: parameter estimates change sign depending on correlation structure

I'm working on a dataset with the following variables: ...
1
vote
1answer
10 views

Holt-Winters and Abnormal termination in LNSRCH

I try to fit data with Holt-Winters function in R. Nevertheless, i am getting the following message: ...
0
votes
1answer
36 views

tease out significance

Say I have search data like this AvgCost QualityScore SearchShare 3.12 6 0.6364 Where AvgCost is a ...
0
votes
0answers
34 views

Extracting the value of an element from Dataframe in R [migrated]

I am very new to R and trying to extract a specific element from a data frame and compare it with an integer. I had a table saved in text file. I used the following to read the table. ...
1
vote
0answers
22 views

R: Is it possible to estimate the poisson noise?

I have a dataset of many discrete counts (RNAseq read counts per base), which contain both real signals and background noise. The noise is random, and should be poisson distributed. What I would ...
1
vote
1answer
29 views

Treating multiple observations per object

I am working on a project whose aim is to analyze the relationship between machine elements and their price. My data consists of thousands of machine elements, their price, as well as technical and ...
0
votes
0answers
9 views

rebuild model based on what columns a record has

I've built a model in R using glm, and in the new dataset that I need to predict, there exist some new levels for the columns that are non-numeric. I know there are so many approaches to deal with ...
3
votes
1answer
38 views

R find key influencers

In Excel's data mining tools there is a "Key Influencers" tool which will look at a dataset which is perhaps customers and whether or not they converted to a given goal (e.g. a flag that equals 1). It ...
2
votes
1answer
125 views

Determining probability distribution for datasets with missing values

As a part of my exploratory data analysis (EDA) prior to further analysis, I'm trying to determine a probability distribution of my pilot dataset's variables. A particular feature of this dataset is a ...
0
votes
0answers
5 views

R mhurdle with same 2 predictors in 2 separate hurdles

My outcomes are zero-inflated but otherwise normal. I want to propose a model in which the very same predictors determine both whether the value is zero or non-zero, and separately from that, if ...
1
vote
1answer
23 views

2 sampled ks test in r

I need to do a two-sample Kolmogorov-Smirnov (KS) test in R, only I don't understand the formulae and how it works when I look it up. I suspect this is because I ...
0
votes
0answers
20 views

breakpoint analyses on multiple series: how to detect common points

I have 20 time series that span the same period (100 days each), from 4 species sampled at 5 different location. I made a loop to perform a breakpoint analysis on all of them, resulting in 0 to 3 ...
0
votes
1answer
32 views

Interpretation of polynomial regression output in R

I performed a polynomial regression using the following formula: lm(deviance ~ poly(myDF$distance,3,raw=T)) However, the summary output states that only the ...
0
votes
0answers
11 views

node having highest degree in a graph [on hold]

I used the following code and created a graph:- a <- graph.formula(A-D:B:C:E, k-P:J) then i calculated degree of all the nodes using a function of igraph ...
1
vote
1answer
19 views

Logrank test for trend (proportional hazards)

How one can create a logrank test for trend and does it differ from normal logrank test? Any suggestions or literature? Maybe some R examples and functions?
1
vote
0answers
41 views

Why are these MLE estimates biased?

I estimate the parameters of survival data with censoring which is simulated from Weibull distribution. The mean time to event was set to 10 by choosing the combinations of shape and scale ...
0
votes
0answers
15 views

Need help on how to interpret Gamma Probability density function of gamma(2, 1/10) [duplicate]

The below sample graph was created using R, for an example I came across while reading (on Distribution of time until customer x arrives): ...