Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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`.

0
votes
0answers
10 views

clustered scatterplot in R

I'm new to R, I searched but I find outdate infos only. I've done a simple single linkage clustering process. ...
0
votes
0answers
10 views

Simulate bivariate Autoregressive AR process with a specified correlation in R

I would like to simulate two AR(1) process with a specified correlation and with a condition such that one process is greater than the other. Specifically, I would like to Simulate two processes $X_t=\...
0
votes
0answers
22 views

Need help coding an answer in R [migrated]

I do not know how the X or Y vector relate to each other in this question. The fact that the answer is a single vector is what is confusing me the most.
0
votes
0answers
9 views

Simulating data with nested random effects

I would like to simulate nested data, where my mixed effects model fitted to real data has the form: y ~ time + (1 | site/subject) I then take the hyper-...
0
votes
1answer
7 views

Obtaining point forecasts from a DCC-GARCH model in rmgarch in R

I am becoming more acquainted with GARCH models in R, but I am not sure my code is right for what I am trying to do, so I would appreciate any help. Based on an xts I create using data from a csv ...
0
votes
0answers
9 views

observed heterogeneity in mixed logit model with R

Is anyone aware of a R package which accounts for observed and unobserved heterogeneity across individuals in the random coefficients of a mixed logit model simultaneously, except the ...
-1
votes
0answers
9 views

Error in Panel Data Regression in R [on hold]

I have an unbalanced panel data. Attempting a panel data regression with this dataset in R. (It is worth mentioning here that my experience with working in R is just a week!). However the following ...
0
votes
0answers
4 views

Proper statistical method for comparing two annual time series of different measurements on same area

Lets say I have two annual time series - one is in-situ measured Sulphur input to given watershed and the second one is some index (number) acquired via remote sensing (satellite images) over the same ...
0
votes
0answers
6 views

Overlap in multiple dates or intervals in R with lubridate [migrated]

I have multiple time intervals (int1,2,3,4) and I would like to calculate the total duration of the overall overlap between all intervals (duration of int5). int 1:....|-----| int 2:.......|-----| int ...
0
votes
0answers
12 views

Reshaping data frame to long list of key:values [migrated]

I have a dataset row data in the following format: ...
0
votes
0answers
16 views

Joint pdf from joint cdf in R

I have a big matrix of data where for each element (column) I have a certain number of values. Using this data I computed, using the Emcdf library the Empirical Joint CDF for every couple of elements. ...
-2
votes
0answers
14 views

Hi, my ShinyApp code ran in R studio looks at the files and should provide a summary but it is not, [on hold]

library(shiny) library(shinydashboard) ui <-dashboardPage( dashboardHeader(title = "My App",dropdownMenuOutput("Drop Down Menu") ), ...
0
votes
0answers
23 views

How should one compute the p-values of a two sided F test?

I have been studying this link. However, i can't really figure out how to calculate the p value for a 2 sided F test where the degrees of freedom are different and the F distribution is asymmetric. I ...
2
votes
1answer
36 views

Does taxi demand follow a poisson distribution?

The important assumptions underlying a Poisson process are: What happens in one subinterval of time is independent of what happens in any other subinterval The probability of an event is the same in ...
1
vote
1answer
18 views

Estimate confidence intervals for the P value of the Pearson's Chi-squared test [duplicate]

I have a contingency table where I estimate the p value Pearson's Chi-squared test, I want to take a confidence interval to validate this value P some code to do this by simulation monte carlo? ...
0
votes
0answers
14 views

Construct Confidence Curve in R in Change Point analysis

I am trying to reproduce the journal article "Confidence distributions for change-points and regime shifts" (on page 16 top left hand corner) Firstly, I generated random sample using i) N(1,1) and ii)...
0
votes
1answer
10 views

Log-transformed DV and coefficient of interaction term

I am having difficulty interpreting the significance of positive tone (measured as percentage of words in a sentence that are positive in tone) for females and males. The following is the regression ...
1
vote
1answer
28 views

GLM - interacting predictors for which the mediator only applies to one type of outcome

I am running a simple GLM with an interaction of the two main predictors. The outcome (dependent) variable is binary and takes the value of 1 when the product is ...
1
vote
0answers
22 views

How to model and estimate interference and subsequent shocks on panel data?

I have the following setting: In my factory, we have mutliple assembly lines(>10). Each line produces an amout of itmes every day, with some weekly and mothly production peeks. Thus its basically a ...
0
votes
0answers
14 views

ANCOVA multiple confounding continuous variables

I want to perform an ANCOVA analysis to test whether mpg shows differences between a categorical variable am; together I want ...
1
vote
1answer
25 views

Questions about ARIMA

I am estimating this model: But I want to do some analysis of the variables before. In particular, I am interested in fitting some ARIMA models. First, I am doing it for the inflation rate in Mexico. ...
0
votes
1answer
22 views

How to calculate estimated log-sum coefficient in the context of nested logit model in R?

On page 13 of this document, it indicated the estimated log-sum coefficient. How can I obtain the result with R? The R output I think is relevant for this answer: ...
0
votes
1answer
12 views

How to get optimal model predictions for random forest in caret [on hold]

I have learnt a RF model and want to assess the performance (more specifically the accuracy, kappa and HMeasure) between the training set observation and the prediction only for the optimal model. <...
0
votes
1answer
29 views

Which R package or function to use for meta-analysis [on hold]

I am interested in combining point-wise survival estimates from Kaplan-Meier curves, e.g. I want to combine the survival estimates at age 70. Which R package/functions should I look into? I see that ...
1
vote
1answer
27 views

ADF test showing stationary for a non stationary series

I am running an ADF test in R on the following series: This to me is clearly stationary, but when I run the ADF test: ...
1
vote
1answer
57 views

R glm() with a categorical response variable [duplicate]

I want to know wheter I can use glm() with a categorical response variable, and if yes how exactly. I have a response variable with three unordered levels, and both categorical and continuous ...
0
votes
0answers
22 views

How can I find correlation between unequal sample sizes?

I have data from UK and USA about daily calorie intake. From UK, sample size is of 94 and from USA sample size is of 121. How can I find correlation between calorie intakes of UK and USA? Is there ...
0
votes
0answers
12 views

problem in shaping unbalance panel data to run mixed multinomial regression?

I have followed 'mlogit' paper to prepare my unbalance panel data for multinomial (panel) regresssion, but I failed to run the panel regression. After reading some posts, I believe I have found a good ...
0
votes
0answers
21 views

Imputating data without changing the Mahalanobis distance

I have a multi-variable dataset (rows/observations are independent). I want to remove outliers in the data based on Mahalanobis distance (MD). In base R there is already a function which calculates it ...
1
vote
1answer
14 views

Fitting response surface using rsm package in R - Lack of fit test is missing

I am trying to fit an rsm model to a data set with three factors, to try to find optimum parameters of a simple empirical environmental model for disease risk prediction, or influence of a change in ...
0
votes
0answers
8 views

Large relationship dataset and network analysis summary

I have an extremely large dataset in SAS of relationships circa 11million. While attempting to put all relationships on a graph would create a great deal of noise, what I would like to do is develop ...
-1
votes
0answers
21 views

Can somebody explain how can I graph PACF and ACF for AR(1) and MA(1) in R? [on hold]

I don't know what library or code to use? I'd appreciate if somebody can give an example code.
0
votes
0answers
17 views

Gamma distributed outcome variable with lower limit of 10: how to fit distribution and perform regression

We have an observational dataset with a gamma distributed outcome variable y with a minimum value of 10 and a categorical variable x. As it is real data, we don't know the true shape and rate ...
0
votes
0answers
17 views

How to calculate prediction intervals for p values using just the obtained p value (Cumming, 2008)

I've been reading over Cumming (2008) on replication and p intervals. I don't appear to be able to replicate calculation of his p interval for p obtained = .05 following formula B3. I'd very much ...
0
votes
0answers
10 views

Does an R package exist that can model mixtures of multivariate regressions?

The mixtools package in R can fit both mixtures of multivariate normal distributions, and also mixtures of univariate regressions. But it cannot fit mixtures of ...
0
votes
0answers
25 views

Split the data into intervals based on start and end date [on hold]

I have two variable which contain "start date" and "end date" as Start Date End Date 01/05/2017 06/07/2017 I want to split these dates in the interval of ...
1
vote
0answers
14 views

How does the solve() function produce factor correlation scores in the factanal() function?

Using the factanal() function in R produces factor correlations: ...
0
votes
0answers
4 views

Reverse CARET proProcess()

I did the following steps in my modeling using R: 1)applied proProcess() function in CARET package and then encoded the data. 2)Used SMOTE to balance the data 3)Applied Mutlti linear regression for ...
1
vote
0answers
23 views

Simulate/Generate Data for Multinomial Logistic regression

How to simulate data for Multinomial Logistic regression? For Example i want to generate a high dimensional data set with 90 subjects and 500 independent predictors. The ratio of Classes should given ...
5
votes
2answers
87 views

How to determine the number of possible combinations of letters that contain a degenerate substring

I've been racking my brain for a couple of days to work out a series or closed-form equation to the following problem: Specifically: given all strings of length $N$ that draws from an alphabet of $L$ ...
6
votes
2answers
323 views

Evaluating the hazard function when the CDF is close to 1?

I need to evaluate a hazard function $h(t;\theta) = \dfrac{f(t;\theta)}{1-F(t;\theta)}$, where $f$ and $F$ are a pdf and a cdf, respectively, at many values of $t$ (and for several values of the ...
0
votes
1answer
21 views

How to obtain the results of the Nemenyi post-hoc test in a table showing grouped pairs?

I performed a Friedman's test, which showed that there are differences among my treatments. Thus, I choose to perform the Nemenyi's post-hoc test in order to infer which treatments statistically ...
0
votes
1answer
22 views

R: GMM Estimators in a dynamic panel

I put up a fixed effects regression using panel data with a time lag of the dependant variable, so somthing like this: ...
0
votes
2answers
44 views

Logistic Regression: multicollinearity and Kappa statistics

I may be wrong but from my understanding logistic regression requires there to be little or no multicollinearity among the independent variables, and yet Kappa statistics as part of postResample() ...
0
votes
0answers
48 views

Kalman Filter Parameter Estimation of Yield Curve Model

I'm trying to reproduce in R with DLM or KFAS package the results from Diebold, Rudebusch, Aruoba paper The macroeconomy and the yield curve: a dynamic latent factor approach with some help from ...
0
votes
0answers
10 views

R Season in VARS function [on hold]

I am using the VARS function in R and one of my timeseries is seasonal (quarterly data). I found out that there is a seasonal argument that accounts for the seasonality. Does anyone know what it ...
8
votes
1answer
143 views
+50

Is meta-analysis of odds ratios essentially hopeless?

In a recent paper Norton et al. (2018)$^{[1]}$ state that Different odds ratios from the same study cannot be compared when the statistical models that result in odds ratio estimates have ...
0
votes
0answers
22 views

replicating SPSS confidence intervals with R [on hold]

Consider this SPSS command ...
0
votes
0answers
14 views

GLMM poisson: non-negative integer response [on hold]

i want to do GLMM with poisson family with R. my data has non negative integer in response column. my response contain integer number from 0 to 52 (i set my response as categorical data), but when i ...