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

Experimental comparison and variants [migrated]

Could anybody explain this code from Luis Torgo (the DMwR package): ...
0
votes
0answers
22 views

R - quadprog package for constrained Lasso (penalized) linear regression

What I am doing so far: I am doing a constraint linear regression with R's quadprog package, function solve.QP(). The ...
1
vote
2answers
111 views

Multivariate Data

There is a built-in data set USArrests data in R software . ?USArrests We use this ...
0
votes
0answers
14 views

“Factorial” Profile Analysis, does it exist? Or is there maybe a better statistical method I should be using?

I am working on a visual search project that I created in Psychtoolbox with Matlab. As with most visual search studies, there will be within subjects tests, since each subject completes many trials. ...
0
votes
1answer
19 views

Confused about how to run MCMC using OpenBUGS [closed]

I am running the code below: ...
1
vote
2answers
22 views

Dealing with studies with no cases in meta-analysis

I am meta-analysising the following data by age range: ...
-1
votes
1answer
68 views

Do probabilities need to sum to 1 in a choice model? [closed]

We're create a discrete choice model, in which there are more than two alternative choices. There are some options for this, such as the multinomial logit and the conditional logit.. We started with ...
0
votes
0answers
33 views

one way anova in R

I have only just started using R in my first year at university and I am completely stuck. I have done an anova test as the data is normally distributed and parametric. However, this is my result. I'm ...
0
votes
1answer
36 views

Normality test for large samples

So I working on a programming assignment that uses multiple algorithms to solve the floodit game. I have taken some of my data that I have collected thus far. I did a shapiro test: ...
0
votes
0answers
7 views

plot does not show up for an svm object and no error is returned as well [migrated]

I am trying to use svm() to classify my data. A sample of my data is as follows: ...
0
votes
0answers
3 views

R: Formula with multiple Conditions and Categorized Surface Plot [migrated]

I want to make 3D plots for linear Regression Models in R: I wish to display surface of the regression plane of a linear model. I have 2 continuous variables (say AGE, HEIGHT) and 2 factors (SEX, ...
0
votes
1answer
13 views

What is the difference between the standard errors calculated by predict.lm() and summary.lm()

I am trying to calculate standard errors of group means for a two-way-anova. I found two ways to do this (predict.lm(, se = T) and ...
0
votes
0answers
21 views

How to interpret factor by factor interactions?

I'm a bit confused on how one should interpret factor by factor interactions, and what interpretations can be validly extracted. Consider this example from Fox 2003. In the regression below, these ...
0
votes
0answers
6 views

R Multivariate polynomials parameters (polym function) [migrated]

I am looking for the best fit for some data containing three variables: x, y, m, by using R. For that I use the function "polym" like: ...
1
vote
0answers
16 views

How does glmmlass work for Linear Mixed effect model?

When I used the glmmlasso for a linear mixed model (gaussian), I got a warning message: ...
1
vote
1answer
63 views

R and Regression: How to determine distribution of residuals?

I have residuals from a linear regression model on my data set. I want to find an appropriate distribution of my residuals. Say, I assume my residuals are Skew-T Distributed, how can I find the ...
0
votes
0answers
6 views

Plot influence function of a datapoint [closed]

I was wondering whether there is a command in R that allows to plot the influence function of a datapoint for a certain estimator. I have been looking for this all day but I seem not to find it. All ...
0
votes
1answer
29 views

Powering a study to show differences in variance, e.g. in R?

I'm hoping to do a study to calculate whether 1 method of measurement is more variable than another in a subgroup of patients. I assume this will be done with an F-test, from some reading? However, ...
2
votes
0answers
42 views

How does the presence of factors affect the interpretation of the other coefficients in a regression?

The answer to Interpreting coefficients of an interaction between categorical and continuous variable contains a phrase that seems to have some significant impact on how coefficients are interpreted ...
0
votes
1answer
44 views

How is the error calculated in ETS using R?

I'm trying to replicate the ETS algorithms from R in Excel using the formulas present in the link below. https://www.otexts.org/fpp/7/7 According to my research the error is supposed to be ...
0
votes
0answers
14 views

Error using MissMech package for handling missing data [closed]

I am trying to determine whether my data are MCAR (Missing Completely at Random) using MissMech R Package. However, the output of the function from the package is: ...
0
votes
0answers
14 views

Prediction in longitudinal data mixed models

Suppose I have a GLMM for longitudinal based on 1000 observations. Now I want to predict the responses based on 20 more observations. How can I do it in R? I have used the lme4 package in R to ...
0
votes
0answers
45 views

R:Text Analysis and Classify as type

I am new to R and Analysis, I have content set (emails) that are stored as csv file that is of more than 1000 rows(more than one email content in a row) , these are been imported to R and have been ...
0
votes
0answers
25 views

R:Creating Document Term Matrix for particular words [closed]

I am new to R and working on Text Analysis on Email content to classify it as particular type . I have cleaned (remove stop words, punctuation, lower case, remove numbers)the content set using ...
0
votes
0answers
13 views

R: Caret Package - Regression with (strong) confidence?

I am fairly new to using prebuilt machine learning packages in R. I am looking at the following problem. I have a long feature set, very small training set, and a large test set. The goal is to ...
0
votes
1answer
14 views

Confidence measures for Gaussian mixture models

When generating Gaussian mixture models using expectation maximization with Bayesian Information Criterion, is it necessary to report a confidence measure? How do you know that the algorithms are ...
0
votes
0answers
10 views

Likelihood ratio test to choose between components of gaussian mixture model?

I have a Gaussian Mixture Model with 2 components. Is it possible to use a likelihood ratio test to determine the point at which the probability of being in component A is the same as being in ...
1
vote
1answer
35 views

How to find out if the distributions are the same?

I measured the isoelectric points of proteins in two samples (A and B). These proteins can be divided into two groups (G1 and G2). A fictional example for the G1 group is given below: ...
0
votes
1answer
19 views

ADF regression in r statistical package [closed]

Please how do i conduct adf regression in r. to be precise i need the codes used in conducting adf regression in r. I am working on time series data and i need to determine how many lags to include in ...
2
votes
0answers
39 views

Compare sample means of normal distribution with autocorrelation issues

Please forgive me if this is a naive question, but I haven't been able to find an answer in my stats books or online. I'm working on a fish tracking dataset that consists of detections of tagged fish ...
0
votes
0answers
8 views

R gplot for normal distribution - add data to graph [migrated]

I'm trying add to my plot some data that will facilitate users. My distribution graph comes from this code: ...
0
votes
0answers
18 views

Scaling factor in R?

I am implementing a logit model on fraud detection data set which is having several attributes.Target column is truth or fraud.Data contains transaction amount is one of attributes.I generally scale ...
0
votes
1answer
28 views

How to interpret the Durbin-Watson test output in R [closed]

Just for "train" with linear regression in R I'm doing a Durbin-Watson test over the residuals of a regression (over stock ...
0
votes
1answer
20 views

How to test if one mean is greater than the other in R?

What would an appropriate test be for testing whether group 3 has a larger vital capacity than group 1 from the vitcap dataset in the ISwR package. This is what I was thinking so far, but I'm really ...
2
votes
1answer
129 views

Deriving Density Function (pdf) from Distribution Function (cdf)

A random variable $V$ has the distribution function: $$ F(v) = \begin{cases} 0, & \text{for $v<0$ } \\ 1-(1-v)^A, & \text{for $0\le v\le1$ } \\ 1,& \text{for $v>1$ } \\ \end{cases} ...
0
votes
0answers
28 views

Which test for count data?

I would like to know which test is better to use to test if two sets of counts are significantly different. kindly
0
votes
1answer
40 views

Testing two raters' time-point data for interrater reliability

My data consists of two raters interpreting one specific phenomenon to occur at different points in time (the observations are not paired, the raters actually identified different amounts of ...
0
votes
0answers
18 views

Full Information Maximum Likelihood, Imputation and Classification

I need to do a classification of a dataset, I have some missing data and I would like to try some "missing data techniques" to achieve the best accuracy. I already tried multiple imputation and ...
1
vote
0answers
33 views

Custom Distribution in R [on hold]

I am trying to create a "custom distribution" in R based on historical data. More specifically, I have some 10 years of daily stock price and P/E data. What I want is to pull that data into R, ...
1
vote
0answers
34 views

Sample time series to equal interval

I have data with timestamp and associated values. time interval between two consecutive data is not constant. How to standardize the the time series and associated value ? eg- Input data is Timestamp ...
0
votes
0answers
16 views

implementation of Poisson regression [duplicate]

I am trying to work with Poisson regression. I came across this video which is very helpful - https://www.youtube.com/watch?v=HntUY8SsYZg. In the video one of parameters (Race) is categorical and ...
0
votes
0answers
4 views

Update an entire row in data.table in R [migrated]

I have a data.table object in R that has 9,000 columns. My code calculates new values for all 9,000 columns at once and returns a vector of values. I'd like to just replace the row in the data.table ...
3
votes
0answers
23 views

visual statistics: fractions of people [closed]

Are there any packages/functions in R to plot visual fractions of people (for frequencies, probabilities, etc)? Examples of the kind of plots I would like to make in R (static, without the ...
0
votes
1answer
45 views

Why pglm fails for within model?

Trying to run a panel logistic model. In the parameters a default NULL is specified for the "start" parameter. My model is: ...
0
votes
3answers
39 views

Exploratory data analysis for a dataset with continous and categorical variables

I have a data set which has DV and around 40 IVs. I want to select best variables out of the existing ones. I can use correlation, but it requires only numeric variables. I would like to see relation ...
3
votes
1answer
26 views

why do decision tree packages convert factor variable into two binary variables

Why are decision tree packages like say, rpart slow with increasing the number of factor levels in R. I read that it basically converts each factor variable into two binary variables representing ...
3
votes
1answer
44 views

P values of coefficients in rlm robust regression

I am using rlm robust linear regression of MASS package on modified iris data set as follows: ...
0
votes
0answers
16 views

R: weighting with two variables while boostrapping

I have two variables that I'd like to analyze with a 2x2 table, which is easy enough. datatable=table(data$Q1data1, data$Q1data2) summary(datatable) However, I ...
1
vote
2answers
93 views

Regression with categorical predictors - use only some dummy variables [duplicate]

I am working on a regression and I have a factor variable "Marital Status" Marital status has 5 levels: Single, Married, Divored, Widowed, Other (don't ask me what constitutes someone being an ...
0
votes
0answers
24 views

Why small values produce undulating densities when ploting logarithm of a loguniform prior (in R)?

I am using a program that draws random values in a log-uniform distribution let say between 1 and 100. When I plot the density of the produced values with R it looks like a log-uniform distribution ...