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

Is there a possibility to fix parameters in the R package poLCA?

I'm using the R package poLCA to compute a latent class analysis with 3 dichotomous variables. As I assume 4 classes, the degrees of freedom are negative. ...
1
vote
1answer
23 views

Best fitted distribution to my dataset?

I'd like to find best distribution to my data set below, and I have used (fitdistrplus) package but I do not know which distribution is fitted my data because my ...
1
vote
0answers
15 views

Differences in Linear Regression Using R and JMP [on hold]

I'm working on analyzing a time series of physical variables in many lakes in Florida for an associate, and I've run into an issue. I'm attempting to run a regression for each time series of physical ...
0
votes
0answers
12 views

Inverse Curve, IRT, r [on hold]

I was following a tutorial on creating information functions, I completed the tutorial by now am looking to take it one more step, to create a curve of the inverse of the information curve presented ...
0
votes
0answers
15 views

Particle Swarm Optimization in Neural Networks in R

Is anyone aware of a way to implement PSO in a neural network in R? I am using 'neuralnet' to create neural networks and I have found the package 'pso'. Is there a way to do something like: ...
0
votes
0answers
17 views

R package for active learning and sampling

I tried to find R package for active learning/sampling and stumbled over "activelearning" package. However, this package is not available on CRAN. Does someone know how good is this package? Are ...
0
votes
3answers
72 views

Machine Learning Book (Python)

I'm in search of a good book about Machine Learning. Requirements: Good theoretical depth (while being a ML beginner, I hold a degree in mathematics), but accompained with good examples and plenty ...
1
vote
0answers
10 views

Random Forest: Class specific feature importance

I'm using the bigrf R-package to analyse a dataset with ca. 50.000 observations x 120 variables, classified into two groups. After growing a forest of 1000 trees, ...
0
votes
0answers
17 views

Still trying to learn lme4 syntax

If I have a sample of rats in which I want to measure protein levels in several different brain regions, the rats are of two genotypes and both sexes, and I want to take into account that the brain ...
2
votes
0answers
21 views

Best way to deal with forecasting with noisy data?

I have a bunch of sales data. It is from distributors of 2000 different items, who service big companies and large distributors to a number of small independent stores. They sell some items which do ...
0
votes
0answers
32 views

Fit model to pairwise comparisons

Let's say I have a dataset with a continuous dependent variable: data <-matrix(c(rnorm(10), sample(0:1,40,replace=T)), ncol=5, nrow=10) Imagine that the ...
0
votes
0answers
19 views

How to find extreme values in a dataset in R? [on hold]

I have a dataset containing cities and their corresponding CO2 emissions. I want to find which cities have emissions too high or too low according to mean. Which functions in R can I use to find these ...
0
votes
1answer
37 views

Output of Logistic Regression Prediction

I have created a Logistic Regression using the following code: ...
2
votes
0answers
20 views

Bug in libsvm? Adding a single new example crushes everything!

I have a set of unbalanced examples, i.e. there is much more negatives than positives. Hence, I decided to use an SVM with weighting. However, when I want to figure out the 'best parameters' (cost and ...
0
votes
0answers
11 views
1
vote
1answer
188 views

How can I recognize when I must apply “log transformation”?

I have some time series - http://ww2.coastal.edu/kingw/statistics/R-tutorials/simplenonlinear.html In this article author try to use log transformation for pressure data. How can I recognize that ...
1
vote
0answers
24 views

Vectorizing code to calculate (squared) Mahalanobis Distiance [migrated]

Say I want to to calculate the squared Mahalanobis distance between two vectors $\vec{x}$ and $\vec{y}$ with covariance matrix $\mathbf{S}$. This is a fairly simple function defined by $$M^2(\vec{x} ...
0
votes
1answer
22 views

How does the Proxy::dist package for r compute cross-distance matrix between two matrices?

I am trying to understand how a cross-distance matrix between two matrices is computed. Can anyone help? Maybe a simple example would help, two matrices having nrow observations of ncol variables ...
0
votes
0answers
4 views

Why might an observation's predicted class probabilities differ from its predicted response in a svm classifier? How can I use both?

I'm using support vector machines to classify an image. I'm new to statistical learning. Using the ksvm package in R I've found that the predicted response is often different than the class with the ...
1
vote
1answer
25 views

Neutral Networks with Categorical Data

I'm building a neural network in R with the neuralnet package, and the data contains categorical values. I have converted the columns into dummy variables, but I have a couple of questions: I ...
0
votes
0answers
25 views

ggplot2: How to curve small gaussian densities on a regression line? [on hold]

I want to graphically show the assumptions of linear (and later other type) regression. How can I add to my plot small Gaussian densities (or any type of densities) on a regression line just like in ...
0
votes
1answer
57 views

Could one say that one dataset is distributed more normally than another?

I am trying to fit a simple linear model: experiment ~ calculated_1. From the basic model, I get residuals_1. And I know that ...
5
votes
1answer
69 views

What are the fitted values in a random effects model?

Consider a linear random intercept model: \begin{align} y_{ij} &= A_{i} + \varepsilon_{ij} \\ A_{i} &\sim N(0,\tau^2) \\ \varepsilon_{ij} &\sim N(0,\sigma^2) \end{align} where, $A_i$ ...
0
votes
1answer
19 views

R train random forest for positive or negative predicitve value, not accuracy

I am working with random forests on financial data (predicting if stock rises versus falls). I figured out that I get better performance, if I build one model for "rising" and one for "falling". ...
0
votes
0answers
18 views

LRT with imputed data in R

I would like to estimate LRTs for nested models using imputed datasets and the survey package in R. I have this: ...
0
votes
2answers
61 views

Logistic regression with bootstrap, how to interpret high standard errors and choose coefficient?

I am attempting to do a logistic regression bootstrap with R. The problem is I get high SE's. I'm not sure what to do about this or what it means. Does it mean that bootstrap does not work well for my ...
0
votes
0answers
13 views

Hardware for Neural Networks in R [on hold]

I am building neural networks in R using the neuralnet package. I am going to build a new PC just for this purpose. Where is my money best spent? Just I put as much ram as I can afford in it? Will ...
0
votes
0answers
13 views

Pointwise Confidence and Prediction Intervals with LMER {lme4}

I am trying to return the pointwise confidence and prediction intervals for a linear-mixed effects model using random intercept and slope, but I'm getting errors in my code. ...
0
votes
2answers
31 views

Generating a simulated dataset from a correlation matrix with means and standard deviations [duplicate]

I have a standard correlation matrix from an academic paper with means and standard deviations: ...
0
votes
0answers
13 views

r glmer warnings: model fails to converge & model is nearly unidentifiable

I have seen questions about this on this forum, and I have also asked it myself in a previous post but I still haven't been able to solve my problem. Therefore I am trying again, formulating the ...
2
votes
0answers
24 views

Implementing random forest to predict the success rate and time of completion

I have a large dataset with more than 120 columns for which I'm trying to classify whether the order will be successful or not. There are two parameters that I need figure out. One is the probability ...
0
votes
0answers
21 views

How to turn nlme syntax into manuscript appropriate equation?

I ran an linear mixed-effects analysis in R using the nlme package. I would like to write out the algebraic equation of the model's specifications. Unfortunately, I do not know exactly how to ...
1
vote
0answers
14 views

predicting the percentile of response variable via linear regression of zscores

Sometimes during modeling we are faced with non-normal data. One of the presumptions of linear regression is the response data being normal. I wish I found a better example data set to illustrate ...
0
votes
0answers
12 views

How to remove zonal anisotropy from directional variogram using gstat in R?

I have a dataframe named seoul315 contains the 107 data of PM10 concentration at 1 march,2012,5.00 am. please, download. I have tried to plot semi-variogram for kriging bt the following code: ...
1
vote
1answer
61 views

In R, what does qqnorm actually do?

qqnorm(x) plot(qnorm(seq(80)/81),sort(x)) Finding that the plots produced by the commands above are slightly different from each other, I tried this: ...
2
votes
0answers
40 views

Why is the derivative not zero?

I am working with survival models and I am using R's coxph function to learn the Cox proportional hazard model. To try it out, I am using the standard veteran dataset (obtainable by loading the ...
0
votes
3answers
59 views

Question on Residuals

After generating the regression model in R using lm, the results will be passed to summary function. results <- lm(y~x, data) summary(results) This function ...
0
votes
1answer
18 views

Effect of “parameters.to.save” in R2jags/ JAGS

I'm using the package R2jags in R, which uses the parameters.to.save argument to specify parameters. I'm interested in the statistical distinction between a ...
0
votes
0answers
6 views

Restarting Lag based on Change in Name in Different Column [migrated]

I am trying to insert lags of a variable into a separate column in my data frame on R. However, I want the lags to 'restart' every time the name in a different column changes. An example of data is ...
2
votes
2answers
52 views

Why log-transforming the data before performing principal component analysis?

Im following a tutorial here: http://www.r-bloggers.com/computing-and-visualizing-pca-in-r/ to gain a better understanding of PCA. The tutorial uses the Iris dataset and applies a log transform prior ...
0
votes
1answer
34 views

Density forecasting

I am having some troubles obtaining density forecasts of any returns series. As I couldn't find any numerical examples on the Internet, I would like to ask you guys for some help. My goal is to ...
0
votes
0answers
11 views

What is VectorSource and VCorpus in 'tm' (Text Mining) package in R

I'm not quite sure what exactly VectorSource and VCorpus are in 'tm' package. The documentation is unclear on these, can anyone make me understand in simple terms?
0
votes
0answers
4 views

Permanent and temporary shock income, variance decomposition

I have a balanced panel data (N= 190, T=5). It's about income and personal characteristics of the householder. I would like to find the coefficients of a temporary and of a permanent income shock. I ...
0
votes
0answers
10 views

Non-parametric alternative to a mixed anova?

My data fails assumptions of variance - (norm dist is good though) - and I was wondering if anyone had a suggestion for an alternative to a mixed anova? Three repeated measures (Test 1, Test 2, Test ...
1
vote
1answer
33 views

Model selection for linear regression with categorical variables

I regressed the dependent variable Rating (numeric) on Judge which is categorical. The output of the first model is given at the end of the question. Only Judge John Foy and Linda Murphy came out to ...
0
votes
0answers
7 views

Model selection for linear regression with categorical variables [duplicate]

I regressed the dependent variable Rating (numeric) on Judge which is categorical. The output of the first model is given at the ...
0
votes
0answers
15 views

How to define smooth.terms in GAM?

I am new comer in GAM. I read into gam introduction but still confused below questions: 1) how to know which independent variable need to be smooth ? To make smooth terms, now I try with different ...
0
votes
0answers
14 views

How do I Forecast new Yts given new Xt's using a Dynamic Linear Model?

I am trying to forecast predict new observations of interest rates given new data using the DLM modeling framework. Essentially, my problem is this: I have a training set (a set of data i want to ...
1
vote
2answers
119 views

How to standardize the variables in R for regression analysis

I have been looking at some tutorials and articles and couldn't get a scenario where two variables are in different scales and used in modeling. So, firstly lets assume I have one metric of numeric ...
1
vote
0answers
16 views

plot.gam versus visreg [on hold]

I am trying to understand the difference between the two plots I see in the code below. Looking at the visreg manual pg 2 correctly and if the same applies to gam models, then visreg plots residuals, ...