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
19 views

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

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 ...
0
votes
1answer
14 views

Interpreting PCA results when there a lot of PCs 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
8 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
12 views

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

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
6 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
32 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
7 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
12 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
21 views

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

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
14 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 ...
1
vote
0answers
21 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
24 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
34 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
16 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
21 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
10 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
12 views

Create Number and percentage table for Latex with R [on hold]

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
9 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
39 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
7 views

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

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
29 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
13 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
4 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
73 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
4 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
22 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
16 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
7 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
10 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
15 views

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

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 (...
1
vote
0answers
25 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
18 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 ...
2
votes
1answer
35 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 ...
0
votes
0answers
8 views

Refitting model Holt winters with Testing Data in R [on hold]

I feel confused to refitting model Holt Winters with my Testing Data in R. Here's my model from my Training Data Is it okay using this method below to refitting the model with my Testing Data? ...
0
votes
0answers
9 views

BoxTidwell test for logistic regression

I'm curious as to how BoxTidwell works in R. The page for the package itself seems to lack descriptions. I have a logistic regression with many numerical and categorical predictors. Every time I use ...
0
votes
0answers
9 views

Latin Hypercube/Orthogonal sampling

With some many R packages, which ones would you advise for doing LHS or Orthogonal Sampling? Also, could you give some introductory references on sampling design? Any help would be appreciated.
5
votes
1answer
71 views

Using the drop1 command in R and AIC

While using the drop1 command in R for model building, it is said the variable with the lowest AIC value must be dropped. What could be the reason for the same? I know AIC talks about information loss ...
0
votes
1answer
27 views

Using Bayesian statistics to analyze food production [on hold]

I am in the process of learning about Bayesian statistics with the help of R, and I would like to know the kind of analysis questions I should pose. Say for instance, with this dataset of food ...
0
votes
0answers
15 views

Fitting a cross-classified variance components model with three response variables in nlme

I am attempting to fit a multivariate variance components model with repeated measures on three response variables. I am using the lme function in the nlme package in R and have run into some ...
0
votes
1answer
22 views

Any good working method for sampling from estimated distribution in R

Suppose I have a number of points $\{x_i\}_{i=1}^N$ and I want to estimate the smooth distribution and sample from it. I have tried at the moment a lot of things, and all of them show poor ...
1
vote
0answers
19 views

zero inflated negative binomial regression

I'm trying to build ZINB and hurdle NB models for my data. Everything seems reasonable, but I have some problems by understanding some problems. 1.One of regressors,which should be reasonable gives ...
0
votes
0answers
11 views

Linear regression summary in R: Standard vs car.Anova

I am running some linear regressions in R. I am dealing with a linear dependent and linear as well as categorical independent variables using lm. So far, I have looked at the output that ...
0
votes
0answers
15 views

How to detect the outliers in logistic regression while dealing with the R programme ?

I have a data set and its response variable consists of only two results that are success and failure.That's why I used logistic regression method to construct a model. However, I don't know how I ...
0
votes
0answers
11 views

Using the runif function to count occurrences using R [migrated]

Let's say that the probability that an event occurs is 0.2. I would like to, for example for 50 times, count the amount of times that the event occurs, using the runif function in R. Is this the ...
1
vote
2answers
47 views

How to proceed with chi square test in R if one line has zeros?

I am trying to program with R. My categorical data is in a table of 5*5. However, the 5th line has only zeros. When I run the chi square test in a software program, it returns the result INVALID. But ...
0
votes
0answers
10 views

Multilevel modelling in JAGS: Unable to resolve node

I am building a multilevel model, where the time is on the first level and countries are on the second level, in JAGS (JAGS version 3.4.0). I want to build varying-slope-varying-intercept model, like ...