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

learn more… | top users | synonyms

0
votes
0answers
31 views

Achieve multiple random effects and interactions with lme4 in R

I am trying to replicate a mixed effect analysis where the authors claim that they used the following scheme: Fixed effects treatment, year of observation Random effects block, interaction ...
0
votes
0answers
20 views

How to plot a vglm/propodds regression in R

Hi I'd like some help plotting the following regression in "r": fit1_usesrp <-vglm(rp ~ is.native + is.male + oh + cjs + age2 + tw ,propodds, data = dummydata ...
0
votes
0answers
15 views

How to interpret the results from regularized canonical analysis?

I am analyzing two sets of data (X, Y), which each has 19 samples and 26 variables (columns). Now I am looking for the correlations between the same columns of X and Y, ...
1
vote
1answer
36 views

Results from rfe function (caret) to compute average metrics - R

I am computing a SVM-RFE model with the rfe function of the caret package, but I am a bit confused about the results. My code ...
0
votes
0answers
11 views

Negatively Correlated Predictors in Arima Model

If a predictor is negatively correlated with a variable you are trying to forecast in an Arima model, will Arima pick up the negative correlation when you add the predictor in the xreg argument? Is ...
0
votes
0answers
5 views

Combining Lower Correlation Predictors to Create Higher Correlation Predictors

I'm working on an Arima model to forecast a given variable and so I'm looking in my data for variables with correlation to the variable I'm trying to predict, to add as predictors in the xreg ...
0
votes
0answers
30 views

Sum of two different probability functions [closed]

I'm have some problems estimating the marginal distribution from data. I found three different distributions that explain the data quite well: two log-normal (black) and one normal distribution (red). ...
-1
votes
1answer
23 views

How do I convert the result of individual result vectors to a long vector in R [closed]

say I have the following sapply call which results in the following: > sapply(1:3,function(x) (x+3):(x+x)) [[1]] [1] 4 3 2 [[2]] [1] 5 4 [[3]] [1] 6 What ...
0
votes
0answers
12 views

How do I convert a Matrix in R to a Vector [migrated]

Say I have the following matrix a (dput below): ...
1
vote
0answers
15 views

Sum of two different probability functions [duplicate]

I'm have some problems estimating the marginal distribution from data. I found three different distributions that explain the data quite well: two log-normal (black) and one normal distribution (red). ...
0
votes
0answers
30 views
+50

Difference between SUTSE (Seemingly Unrelated Time Series Equations) and SUR (Seemingly Unrelated Regressions)

I am studying time-series econometrics and in particular Dynamic Linear Models for multivariate time-series. Someone can help me in understanding which is the difference between SUTSE (Seemingly ...
1
vote
2answers
47 views

Lag-free filter methods for time series

I'm currently working with accelerometer based raw data (100 hz). Now I want to low pass filter this timeseries of accelerations for further analyses. I tried different filters like the simple moving ...
0
votes
0answers
40 views

Web Scraping of Google News using R [closed]

I am trying to scrap data from Google news for a particular topic using XML and Curl Package of R. I am able to extract the ...
0
votes
0answers
36 views

New data mining models that R can do but SAS cannot? [closed]

I'm going to give a talk on R and SAS to a group of SAS experts from industries, who are interested in frontiers of researches in data mining models and reasons why R is preferred by researchers. I'm ...
1
vote
1answer
46 views

Interpreting PCA results when a lot of PCs are needed to reach 95% of variance

I'm working on a simple classification project to better understand PCA, but I don't understand the results. My dataset has 10 features, and I'm trying to predict the label (SeriousDlqin2yrs). ...
0
votes
0answers
20 views

Nested ANOVA alternative for heteroscedastic data (Nested Welch ANOVA)

Question: Is there an equivalent of Nested -ANOVA for data which fails ANOVA requirement? Is it possible to perform in R? Many thanks, Savani I am doing an analysis of large data set. I have ...
0
votes
0answers
14 views

Logistic regression in R when data when variable is a number of observations in a set of categories, not indicator (dummy variable) [closed]

I have data in the form, let's say, factor1 | factor2 | number of observations in given levels of fctr1, fctr1. How do I perform logistic regression?
0
votes
0answers
11 views

Understanding vglm/propodds regression output in R

I was wondering if I could have some help analyzing the output from a regression. Some background on what I'm trying to find/my data: I am trying to determine if immigration status is a determinant ...
1
vote
1answer
48 views

Can you test for normality for a (0,1) bounded distribution?

I have a vector of observations called MyData which is a percentile score that is >= 0 and <= 1. I would like to test the ...
0
votes
0answers
14 views

Survey scoring: count set of possible results

Suppose I have a survey with eight questions. Each question has four possible responses (i.e. 'a', 'b', 'c', 'd'), but four of the questions map to one set of answer weights, and the other four map to ...
0
votes
1answer
22 views

xgboost parameters - how can we use max.depth parameter with binary:logistic objective

I'm new to xgboost package and here is the doc on the parameters of this library for your reference. My question is, logistic regression doesn't do binary splitting and build a tree unlike decision ...
0
votes
0answers
19 views

How to use a regression lm function used for prediction [migrated]

I apply a linear regression over a data set: ...
-1
votes
0answers
23 views

Numerical integration of a function containing nonparametric pdf and CDF in R [closed]

I'm trying to integrate the following function: $\int_x^{\overline{x}}t ( ( 1 - F(t) )^{( ( 1 - .75* b ) / (.75 * a ) ) )} f(t) dt$ in a finite interval between the realization of the random variable ...
0
votes
1answer
18 views

SOM based on a not euclidean distance

Suppose one has trained a SOM on a certain number of data. Without explaining all the procedure, one can say that the SOM algorithm produces a certain number of prototypes and the new elements coming ...
3
votes
1answer
45 views

Forecasting elections by using survey data (in R)

In advance: my sincere apologies for any incompleteness, lack of knowledge and general stupidity in this post. I am doing my ultimate best to be as complete and thorough as possible - but I ...
0
votes
1answer
38 views

What's the interpretation of ranef, fixef, and coef in mixed effects model using lmer?

I have two observations from a person each, where every observation corresponds to a different treatment. The treatments are fixed effects, the persons are random effects. I use the command: ...
0
votes
1answer
43 views

Model selection: testing the need for random-effects terms in longitudinal data

I have longitudinal data set where each participant was observed for 12 weeks. I followed this paper: Bliese, Paul D., and Robert E. Ployhart. "Growth modeling using random coefficient models: Model ...
0
votes
0answers
38 views

Linear regression from two meta-analysis outcomes in R metafor

First of all, I am sorry if this question sounds very basic, but I am new in meta-analysis and statistics and I don’t know how to execute what I have in mind. I have a dataset of 60 experiments with ...
0
votes
1answer
48 views

What is the minimum sample size for kaplan meier

I used the "survival" package in R to calculate a Kaplan Meier estimate for survival. An example of my output is like this: ...
0
votes
0answers
14 views

Two-way ANOVA on mixed linear model in R, homogeneity of variance assumption

I am a bit confused with a two-way ANOVA that I want to perform in R. I have a mixed linear model that I want to perform an ANOVA for: ...
0
votes
0answers
15 views

Create Number and percentage table for Latex with R [closed]

I want to create a table with R for LAtex. (I know how to do with quantitative variable (mean , sd and NAs).) For qualitative variable (with 2 or more levels), I want to have a table with "count ...
0
votes
0answers
15 views

Interpretation of J-test results in R

I am trying to compare two non-nested models in R (A and B) using a J-test. I already conducted the BIC and AIC and based on that it seems that model A is better than model B. However, when conducting ...
2
votes
1answer
52 views

Can logistic regression be used with “years” as a continuous variable?

We are currently collecting data for a study whose purpose is to show whether scientists are focusing more or less on a specific subject with time. To keep some privacy let's say the subject is jelly ...
0
votes
0answers
10 views

Correlation of Error terms v/s Auto Correlation

Is Correlation of Error terms and Auto Correlation same thing ? On page 93 of Statistical Learning the author describe the correlation of error terms but didn't describe how to check for correaltion ...
0
votes
0answers
9 views

How to sample from Conditional Density Estimation estimated using hdrcde package in R? [closed]

I wanted to use ARMS sampling technique (MCMC method) available in "HI" package in R. I'm not understanding how to give input for ARMS.
0
votes
1answer
46 views

Are numerical variables must for random forest algorithm?

I am trying to find the variable importance on a credit scoring database. I have categorical inputs as well as numerical inputs. My question is does the random forest algorithm works the same way when ...
0
votes
0answers
18 views

What is Maximal Lyapunov exponent and how to calculate and interpret it in R?

I was researching about chaotic time series and came across Maximal Lyapunov exponent. I tried to read many articles regarding it but the only thing I understood about MLE is this is used to check ...
0
votes
1answer
5 views

Subselect Package R - The covariance/total matrix supplied is not symmetric?

I was trying out the Subselect R package to see how it worked and if it would be useful for a logistic regression problem I'm working on. Link to the package. I decided I would follow Example 4 on ...
3
votes
1answer
81 views

Funnel plots and publication bias: Does asymmetry means a bad meta-model?

I have done a multi-level meta analysis with R, using metafor package. My questions relates to funnel plot asymmetry. (1) If a regression test suggested funnel asymmetry (i.e. suggested a ...
0
votes
0answers
23 views

Copy values within column, based on other column value [migrated]

Im trying to fill all NA's with another value that occurs in the same column for rows that are in the same month, is there an easy way of doing this? i've found all sorts of functions that do almost, ...
0
votes
0answers
5 views

Corelations attributes with decision - multi class

I have three integer decision classes: 1,2,3. Tell me please, if it make sense to compute corelations attributes with decision, and given it select ...
0
votes
0answers
3 views

Adding a legend to a ggplot2 geom_tile plot based on size [migrated]

I am creating fluctuation diagrams in ggplot2 using geom_tile, and would like to add a legend for size. I am at a loss as to how to do so. Here is a MWE: ...
0
votes
1answer
32 views

Accessing PCA components from caret object in R

I know how to build a model using PCA components in caret package, however I don't know which variables explain which PCA components. I need some help on it. When I perfom the preProcessing ...
0
votes
0answers
18 views

VGAM - “propodds” in R

I am trying to use "propodds" in the VGAM function in R, but am not sure if I am doing it right and don't really understand how to analyze the output I got so far to check to see if I am using it ...
0
votes
0answers
19 views

vglm using 'propodds' in R

I am trying to use "propodds" in the VGAM function in R, but am not sure if I am using the function correctly. If I am using the function correctly, I could use some help understanding the output. ...
0
votes
1answer
17 views

one sample t test by grouping variable with more than 2 groups

I am having trouble finding any examples of one sample t test comparing the group mean to zero where the grouping is not binary, in R. For example comparing the heights by ethnicity to 5 ft (not ...
0
votes
0answers
17 views

Predicted values in random intercepts model with more than one explanatory variable [closed]

I want to obtain predicted values from random intercepts model by setting some predictors constant. I have a data set of 58 countries. I ran a RI model after controlling for demographics (...
3
votes
1answer
63 views

Why do the loadings returned by psych::principal() in R change with the number of components?

I have been using the principal() function of the psych package in R and setting the number of components after a scree plot analysis (...
0
votes
0answers
23 views

ETS or ARIMA model

I have a time series data set and want to predict my data in the future. I would like to when to use a ETS or an ARIMA model? Is is true that you can only use a ETS model when a data is ...
3
votes
1answer
71 views

Meta-regression with highly-correlated predictors? Should I do 2 analyses? Example in R

I'm trying to do meta-regression with a lot of trials (>40 trials with >100 'arms') investigating the efficacy of a procedure (abl) and any 'addon' procedure. Each trial will have 2 or more arms. In ...