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 program in `R`.

learn more… | top users | synonyms

0
votes
0answers
7 views

quadratic endogenous variables in R

As part of ongoing research I'm to test a certain model on some data. One of the questions asked (c.f. one of the hypotheses) involves estimating the quadratic term of an independent variable (in R). ...
0
votes
0answers
4 views

e1071: does the tune function do the scaling?

I'm using tune to choose the optimal gamma and cost hyperparameters for a RBF SVM. As feature scaling is essential, my question is: does the tune function do the scaling?
1
vote
0answers
9 views

Q: Exploratory factor analysis in R

I am trying to do an exploratory factor analysis (EFA) in R with oblique (promax) rotation. From Wikipedia, In oblique rotation, one gets both a pattern matrix and a structure matrix. The ...
0
votes
0answers
16 views

Need help with multivariate multiple regression models

I want to predict more than one dependent variable by running one model, I thought that we can use Multivariate Multiple Regression Model. But I don't know how to do it with Excel or R. Can anyone ...
0
votes
0answers
17 views

optim() for multi variable returns values on the boundary in R

I would like to use function optim() in R to minimise the target function. The two optimised parameters both have constrains. I have created a test sampel data. ...
2
votes
0answers
21 views

How to implement reduced-rank regression in R?

How can I fit reduced-rank regression with continuous response in R? I found the package VGAM but it only fits for discrete distributions...
0
votes
0answers
3 views

Conditionally remove rows that match in column A, based on column B in R using data.table [migrated]

Trying to fix a de-duplication problem using data.table in R. Column A is a list of names, some of which appear multiple times. Column B is a list of dates. There are a bunch of other columns that I ...
0
votes
0answers
5 views

EM convergence when using em.hmm from PLIS

I use em.hmm function from PLIS package. I tried it on dimensions in range from 2 to 6. In every case of provided data (z-values) EM algorithm does not converge for dimensions 2, 5, 6. So, I wonder ...
0
votes
0answers
5 views

find optimal parameters for SVM from tune() in R= [migrated]

I am optimizing the gamma and cost variable using the tune function ...
0
votes
0answers
6 views

assign asymmetric cost in SVM classification in R?

I know that we can set a symmetric cost in R for svm,how do we set an asymmetric cost? I want to do a grid optimization like the following: ...
4
votes
0answers
20 views

What is the “pdm” stat in the “rms” R package?

I am new to the world of Regression in statistics and I have been doing a research in which I am building an ordinal logistic regression model (ORM). In order to fit my ORM model, I am using the 'orm' ...
0
votes
1answer
11 views

Benjamini-Hochberg and GEO2R

I'm currently using GEO2R to analyze a microarray data set. There is an option to generate the 250 most statistically significant genes, which calculates an adjusted p-value using the ...
0
votes
1answer
30 views

R adds unexpected variable to interaction model

Not sure if this is more of a programming question (in which case please move to stack overflow) or a statistical model question (in which case, please read on!) I'm exploring a data set and doing ...
0
votes
0answers
10 views

R: “weights” option will help calibrating class inequality?

I have a database with a binary response variable and 100 predictors (correlated and uncorrelated). I want to try the machine learning techniques in R I've been reading about in the last 3 weeks ...
0
votes
0answers
10 views

Analysis of Beetle Community in R

I'm working on my thesis but I have a problem making the last analysis. I have 4 different kind of forest: a, b, c and d each kind of forest has been analyzed in 15 different places (so we have a1, ...
0
votes
0answers
27 views

How can I create a linear regression model with some negative coefficients in R? [duplicate]

What I'm trying to do is to construct a linear model in a form like $$ Y = \beta_0X_0-\beta_1X_1+\beta_2X_2 + \beta_3 $$ where $\beta_0$, $\beta_1$ and $\beta_2$ are coefficient of predictors $X_0$, ...
0
votes
0answers
22 views

faster alternatives to solve() in R [migrated]

If chol2inv(chol(matrix)) is not applicable to my matrix (i.e. not positive-definite square matrix), is there any other alternative methods in R to do matrix inversion (or avoiding the inversion). I ...
0
votes
0answers
10 views

how can I block by location in r?

still new and learning how to use R, but I'd like to get some help with figuring out how to block my data by location. I found this, but I don't understand where to put my data into the code: ...
0
votes
1answer
43 views

R - Creating conditional variables with loop [on hold]

I have a dataset like this, where each data point has a person's gender, and whether they checked off a number of descriptors (1) or not (NA): ...
0
votes
0answers
6 views

Is there a minimum sample size for Besag's transformation of Ripley's K-function?

I am using Besag's L function to test complete spatial randomness for plant populations. Specifically, I am implementing the univariate L-function Lest in R on a ...
-1
votes
0answers
22 views

Repeated measures with time varying covariates in R

On this page (Model 5, http://www.ats.ucla.edu/stat/spss/faq/repeat_covar.htm), there is a description of how to carry out this type of analysis using SPSS. Does anyone know how to do the same thing ...
0
votes
0answers
14 views

Weight of Evidence(WoE)/Information Value(IV) in R [on hold]

I am building a credit scoring model in R. I have to run logistic regression. But my number of variables is too high, about 3000. I have both continuous and factor variables. And number of observation ...
1
vote
1answer
50 views

Negative Binomial Distribution R

This question was given in class and I was wondering how to do this in R: "Sixty percent of a large lot of old spark plugs are still usable, and they can be individually tested to determine this. Let ...
1
vote
1answer
27 views

How do I contrast code for a factor where one level is the application of both of two others?

I have a factor 'Music' that has four levels: none, piano, guitar, and mixed. Subjects gave a response hearing no music, piano only, guitar only, or piano and guitar, so I want to create an lmer model ...
1
vote
0answers
16 views

CBC analysis using choicemodelr - interpretation of the output attribute values

I finished a choice-based conjoint (CBC) survey. Now i am evaluating my results with the R-Package "ChoiceModelR". With this i get Beta Values, with which i can, for example, compute attribute ...
0
votes
1answer
14 views

Calculating sample size of a mixed ANOVA in R (2 between, 1 within variable)?

I'm searching for a built-in function in R for calculating the required sample size (given certain power, alpha,..) of a mixed ANOVA (2 between, 1 within variable, 2x2x2 design). Does this function ...
0
votes
0answers
7 views

density estimate for continuous support with continuous frequency

I have data with continuous frequency and a continuous support which I'd like to analyze and plot using a kernel density estimate in R. I can create the basic plot in JMP fairly easily using the ...
0
votes
0answers
15 views

Machine Learning Predictors Evaluation Using R

I've bee using R for predicitve analytics and here is issue: I'm trying to predict the species (categorical variables E1, E2, E3 and E4) of an animal using as predictors a set of nominal (NO1, NO2, ...
0
votes
0answers
36 views

How to Calculate π In R [on hold]

This GLM From My Data How To Calculate π With R. I Need R Code.
2
votes
1answer
24 views

Interaction effect of 2x2 ANOVA in meta-analysis

I want to meta-analyze the interaction effect of a 2x2 ANOVA. (I am not talking about an interaction in the meta-regression, as in this question but about an interaction as the focal effect that ...
1
vote
0answers
12 views

Checking the proportional odds assumption holds in an ordinal logistic regression using polr function

I have used the ‘polr’ function in the MASS package to run an ordinal logistic regression for an ordinal categorical response variable with 15 continuous explanatory variables. I have used the code ...
1
vote
1answer
29 views

Bootstrap glm and extract pvalue

I am running a glm model using bootstrap, I can extract the coefficient mean and the confidence intervals for all the factors in my model. But how can I get the pvalue from there? Model: ...
-1
votes
0answers
5 views

Using googleVis api in java [migrated]

I have used googleVis api in R for dynamic map.Now i am trying to make a small webapp in which servlet access this api and the result is displayed in jsp.But i am not able to access googleVis api from ...
0
votes
0answers
6 views

Determing goodness of fit at data with few and sometimes heavy change

Currently, I happen to analyze data where I do have a data matrix for two time points each. Each of these matrices is of dimension nxm, where n is the number of samples and m is the number of ...
0
votes
0answers
57 views

Can I use the correlation value to measure the correlation between two variables when observations in each variable have auto-correlation?

I have two variables: urban areas protected areas. My observations are urban areas and protected areas in each year. But these observations are the cumulative ones, so observations in each ...
0
votes
0answers
18 views

Is it correct or not I applied PERMANOVA-test and interpreted results?

I want to associate nutrients with microbiota bacteria composition. My data consist of two tables: nutrient table (row - patients, column - some of nutrients, e.g. protein, calorage); bacterial ...
0
votes
0answers
13 views

How does one do a Post-hoc test for a Poisson glm in R?

My data consists of the following categories: Site - 3 sites - Boulder, Rubble and Cul-de-Sac Season - 4 types - warm1, warm2, cold1 and cold2 Behaviour - 6 behaviours scored - Basking, ...
0
votes
0answers
23 views

Calculate probability of consecutive event from R simulations

he problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use $sample(0:1,N,rep=T,prob=(0.25,0.75))$ to ...
1
vote
1answer
29 views

Calculate probability of consecutive event from R simulations

The problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use ...
2
votes
0answers
18 views

Maximum likelihood of multivariate t-distributed variable with scaled covariance

I am trying to estimate the covariance of a iid multivariate t-distributed random variable, where I define the multivariate density as in the Statlect textbok, which is the same as the wikipedia page. ...
0
votes
0answers
22 views

lowess: R (& python-statsmodels) vs MATLAB (& biopython)

There seems to be two different interpretations of what LOWESS really means: one from R (also used by python-statsmodels), and one from MATLAB (also used by biopython), see comparison below. Could ...
3
votes
1answer
26 views

Selecting variables using SAS and R - all effects are significant even when shuffling the data

Dear all: I need to test which effects I should include in my model for genetic evaluation of cows. I was using the following code in R: ...
0
votes
1answer
17 views

Full effects from Poisson GLM

I am running a Poisson GLM with count data as response variable and both continuous and categorical variables as predictors. I made use of the following (dispersion is OK): ...
0
votes
0answers
17 views

One Step Ahead Forecasts Using Predict() in R

I just fit a model to a time series. I am now required to generate a 10-year extrapolation forecast of my model. My model includes a time term, a time^2 term, 12 seasonal dummies, and 4 lagged ...
2
votes
0answers
29 views

Meta-analyses for variance rather than means

What are the main complications / differences when conducting a meta-analyses where the metric of focus is not effect size (i.e., means) per se, but instead estimates of variances from models? Nods ...
2
votes
0answers
35 views

Is There A Machine Learning Algorithm For Textual Data With Thousands Of Classifiers?

I've been asked to migrate this from StackOverflow to CrossValidated. I have a problem that I think Machine Learning can solve but am having a very hard time determining which ML Algorithm to use and ...
0
votes
0answers
18 views

Regression Analysis with String values in column of DataFrame

I have a dataset which is having multiple columns where some column has string values with comma seperated ...
0
votes
1answer
44 views

Why does the linear SVM give a lot of support vectors?

I simulate a simple linear setup: n = 1000 X = runif(n) Y = runif(n) ind = X + 2*Y < 1 ind[ind == TRUE] = runif(sum(ind)) < 1 plot(X,Y,col = ind + 1) ...
0
votes
0answers
27 views

Handling Sparse Data Frames - algorithm selection

I am new to machine learning/statistical modelling. I am trying to run a classification on a highly sparse dataset with 100 features, most of which are categorical (TRUE/FALSE) with the remaining ...
0
votes
0answers
22 views

What does muhaz return?

A pretty basic question. I have read somewhere that the muhaz function in muhaz package will return the baseline hazard rate for COX model. The muhaz document states that it "Estimates the hazard ...