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

2
votes
1answer
16 views

R power.prop.test and power equation in the difference between proportions

I am looking into the formula built into the R function power.prop.test{stats} and I am stuck trying to understand the following calculation: ...
0
votes
0answers
31 views

Why is locally weighted regression is a nonparametric method? How is it implemented in R?

I'm wondering where does the "nonparametric" label of locally weighted regression like LOESS or LOWESS comes from, i.e. why they are nonparametric methods? Also, I would like to know in general how ...
0
votes
1answer
34 views

Plotting k-means clustering with mixed numerical/categorical data

I have a dataset in CSV format that looks as follows: ...
1
vote
1answer
62 views

Hierarchical method of regression in R [closed]

We are looking to use a "hierarchical" method of regression in order to input predictor variables in three steps. From what we can tell, the default method of regression is "stepwise," but we can't ...
1
vote
0answers
33 views
0
votes
1answer
19 views

Correct arguments for svm() function in R

I'm looking to implement a linear and non-linear SVM in R but having some confusion over which argument to use in svm(). For the linear SVM I want to add in the penalty $\gamma$ for soft margin. This ...
0
votes
0answers
10 views

How to get beta values for categorical moderator levels in mixed-effect meta-analyses? [closed]

I've used the metafor package in R to run some mixed-effects meta-analyses, and the final reduced model for each analysis contains several categorical moderators as well as a continuous moderator. For ...
1
vote
0answers
21 views

Goodness of fit for multi dimensional scaling

What is considered to be an acceptable value for goodness-of-fit in multi-dimensional scaling (MDS). I tried to run an MDS analysis on my data with four dimensions in R. The goodness of fit comes ...
0
votes
0answers
8 views

tbats{forecast} in R gives strange predictions for some folds in cross validation

My daily data shows weekly and yearly seasonality, so I decide to try the tbats function. When I first fit the model with all the data, it worked fine. However ...
0
votes
0answers
23 views

Fitting linear regression using function of categorical variable in R

I want to fit a linear model for goal differences of ice hockey matches with regressor - difference in forms of teams. So my model has form: $y_{ijt} = \mu + \alpha_i - \alpha_j + \varepsilon_{ijt}, ...
2
votes
1answer
73 views

lme summary() interpretation

Need some help interpreting the summary() -function results. I am running a lme from the package nlme in R. I have a simple ...
0
votes
3answers
33 views

How to predict categorical reponse?

I am trying to predict categorical response by using several categorical variables and quantitative variables? I tried linear regression model in R, but I don't think it works well as the response is ...
2
votes
0answers
34 views

Prediction Intervals for Robust Regression: Formulation and are they larger than for OLS?

I have created regression models using robust regression - in particular, LTS and MM-estimators (using the R package robustbase). I am now looking to creation prediction intervals. The standard ...
2
votes
1answer
24 views

Paired permuted t-tests?

I have a small dataset which are not normally distributed. I would like to perform a pairwise analysis of the differences in values between two groups. It has been suggested that I use permuted ...
0
votes
0answers
12 views

R limma voom function trend in mean-variancerelationship

I am new to the Limma package and when using voom I get this. I am really not sure what it means. I wonder if anyone here have seen something like this before, or ...
2
votes
1answer
33 views

Identical SEs for all slopes in a regression on a factor

I'm relatively new to R and stats, and I just encountered a situation that I haven't before. I ran an lm (in R) with species richness as the response variable and elevation level (I have five of them ...
0
votes
0answers
10 views

One way ANOVA in R given Mean, SD, sample size only? [duplicate]

I am trying to run a one way ANOVA on some data. One factor, 4 levels. I only have mean, SD, and sample sizes to work with. Is there a way to do this in R?
0
votes
1answer
45 views

Computing repeatability from overdispersed zero-inflated negative binomial GLMMM in R

I'm trying to compute repeatability of a count response variable from a Generalized linear mixed model with multiple fixed effects and individual ID as a random effect. I'm dealing with both ...
0
votes
0answers
29 views

Exploratory Structural Equation Model (ESEM) in R: Exploratory Specification Model

Thanks in advance for your help. I have been trying to developed ESEM in R, and am hoping to generate some fit statistics for a 3 factor model. My data include 12 items and 213 observations. I ...
1
vote
0answers
39 views

plot logistic regression line over heat plot

My data is binary with two linear independent variables. For both predictors, as they get bigger, there are more positive responses. I have plotted the data in a heatplot showing density of positive ...
0
votes
0answers
26 views

Data-driven company: 15 days activity, scatter data

I am a co-founder of a company as CTO, I want to create a data-driven company, as I am a Computing and Electrical Engineer I have some statistical background but is the first time that I am trying to ...
0
votes
0answers
9 views

How can I count the number of cases in the last 1 hour using the R package dplyr? [closed]

I have here an anaemia dataset of blood donors. I want to calculate how many times that donor had a donation in the last 2 years. Consider that I have one column with the dates of the donation, and an ...
0
votes
0answers
33 views

What do xtest= and ytest= do in the randomForest algorithm in R? [closed]

I am fitting a random forest and I have split my data into a training set and a test set using the following code: ...
0
votes
0answers
8 views

regression trees to model rates

I am performing a predictive modeling application where I have to predict claims. If I had used classical GLMs, I would have used a poisson glm using log exposure as offset, assuming therefore $claims ...
0
votes
0answers
5 views

Atomic file transfer from R [migrated]

I need to push a file to a remote server from within R. It needs to be atomic (or nearly atomic). Conceptually, my idea was to first scp it to a tmp directory, and then move it to its final ...
0
votes
0answers
8 views

I have got zero values in my z matrix of bivariate cdf function?

I have been written this r script to calculate cdf of bivariate function. However, I got zero values in my z matrix. Is any one can help me? This is the sample script. ...
0
votes
0answers
14 views

Should I normalise (to sum to 100%) the MSE reduction for variable importance in a random forest?

I am investigating the importance of a set of variables in a linear model. I am conducting a random forest analysis and using the permutation-based Mean Square Error (MSE) reduction as a measure of ...
0
votes
0answers
17 views

How to compare diagnostic accuracy of two tests in unpaired data?

I am wondering whether I can compare diagnostic accuracy, sensitivity, specificity, positive and negative predictive values, and likelihood ratios, between two diagnostic procedures employed in two ...
0
votes
0answers
12 views

L moment estimaion

I'm trying to estimate three unknown paramters(alpha,gam and delta) using L-moment: my distribution is: v= runif(n) x =delta*((1-v)^(-1/gam)-1)^(1/alpha) and ...
0
votes
0answers
23 views

Difference in forecast accuracy between numeric vector and time series [closed]

I'm trying to compute the accuracy for my forecasting but I found that the accuracy changes when I convert my test data from time-series to numerical vector, especially as measured by MASE and Theil's ...
0
votes
0answers
15 views

How does effect() in R calculate error bars from glm?

I have been using glm in R to determine which factors are most likely to predict a positive/negative outcome for a particular problem. Having found the best fit model I was advised to use effect() to ...
2
votes
1answer
81 views

Finding probability distribution that describes data

I have tried to fit several distributions to my continuous data (Pareto, Log-normal, Exponential, Gamma). The distribution of data is given below. I used Kolmogorov-Smirnov test to compare my data ...
0
votes
0answers
6 views

Conjoint Analysis with multiple set of ranked questions

I have performed conjoint analysis in R and SAS with a single ranked set of questions. Now, I am faced with the situation where I am to perform the analysis on multiple sets of ranked questions. ...
0
votes
2answers
75 views

Logistic regression and dependent variables in R

Iā€™m trying to do logistic regression, I utilize the following command: mylogit <- glm(Var0 ~Var1, data = mydata, family = "binomial") And I obtain a p-value ...
0
votes
1answer
21 views

Feature normalization in Text Classification

I'm doing Text Classification in R, and my initial features are just word frequency inside a Document. For example: ...
1
vote
0answers
26 views

Test to see if individuals are distinguishable

I conducted some experiments where I modified two variables (var 1 and var 2), and measured an outcome variable (yield). For each combination of var 1 and var 2, I assigned a TestNumber. Some ...
1
vote
1answer
31 views

Beta binomial mean different from actual mean

I have data that I am fitting a beta binomial distribution to. The VGAM package for R is being used to do this. However, the the mean of the fitting beta binomial distribution is vastly different from ...
0
votes
0answers
19 views

Multiple T-Test with Trended Data in R

I am having issue getting the p-values from a T-Test for a 'typical trended study'. The aggregated values for satisfaction by months are the following. ...
1
vote
0answers
6 views

Confidence Interval for mean difference with non-mutually exclusive 1 to many matches in R

This is somewhat both a programming question, and a stats question. So sorry for the overlap (although it seems that there is a large overlap between the realm of stats and programming of ...
0
votes
0answers
13 views

How do I do RLM normalization in R?

I have a combined dataset of 123 samples and 9,482 features (expression levels of antibodies from Invitrogen's ProtoArray v5.0). Based on ...
0
votes
0answers
22 views

Conducting Analysis after Propensity Score Matching

I want to perform propensity score matching of observational data of an Intensive Care Unit in order to find out wheather hydroxyethyl starch is better or worse than colloids in terms of renal ...
0
votes
0answers
11 views

When do contr.sum and contr.treatment give the same ANOVA results?

If using the default contr.treatment setting in R, the Type III SS are supposedly incorrect. I've been trying to figure out when this is the case, and to what extent it matters. However, on a sample ...
3
votes
3answers
126 views

How to test if my distribution is multimodal?

When I plot a histogram of my data, it has two peaks: Does that mean a potential multi-modal distribution? I ran the dip.test in R (...
0
votes
1answer
30 views

NA values in linear model in r

I have the following dataset: desingmatrix <-read.csv("path of csv with data", sep=";", dec=".") View(desingmatrix)# vision de los datos Then I try to set ...
1
vote
1answer
27 views

dmulti in jags when sum(p[i]) < 1

I have a problem with dmulti. Principially, this would be my model: ...
0
votes
1answer
40 views

Weights in IPSW (inverse propensity score weighting) too high?

I used a logistic regression on a variable indicating whether a person of an address-dataset took part in a survey (1), or not (0). I extracted the probabilities of each person to participate and ...
1
vote
0answers
13 views

error message for typo in variables [migrated]

Is there a way to force R to reject a wrong variable name instead just run it successfully without any error message? For example: ...
3
votes
1answer
65 views

R glmer.nb output. How to get $\hat{\theta}$?

I would like to obtain estimated $\theta$ from glmer.nb function in lme4 package. In my understanding this function fits the model: $$ Y_{ij}|\boldsymbol{B}_{i}=\boldsymbol{b}_i \overset{ind.}{\sim} ...
2
votes
2answers
93 views

Unable to get suitable forecast for ARIMA model in R due to outliers— attached code for easy replication

Using the attached data that has been recently updated I am not able to obtain a statistically significant forecast. The data is extremely seasonal. The data is stored here for easy replication: ...
0
votes
0answers
21 views

Weibull distriution. Problem with paramets and qqPlot

I have 10 years worth of mean wind speed meteorological data (timely 10-minutes data). I want to compare the observed wind speed data against a Weibull distribution on a graph of the probability ...