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

Diagnostics of a GLMM model using ADMB

I've created some GLMMs in R using ADMB. I've selected this model based on the AIC value. Now I would like to see the diagnostics. Which kind of diagnostics do I have to use for a GLMM? ...
0
votes
0answers
9 views

Using Princomp() in R [migrated]

After running Principal Component Analysis in R using princomp() and running summary() on the results I got a list of ...
0
votes
0answers
9 views

Plotting a boxplot against multiple factors and overlay raw data in R with ggplot2 [migrated]

I have a boxplot like this; library(ggplot2) p <- ggplot(mtcars, aes(factor(cyl), mpg)) p + geom_boxplot(aes(fill = factor(am))) so this plots the data as ...
0
votes
1answer
36 views

When the dependent variable and random effects 'overlap' in mixed effects models

I have a dependent variable that depends on one of my random effects, as such: ...
4
votes
2answers
85 views

ETS() function, how to avoid forecast not in line with historical data?

I am working on an alogorithm in R to automatize a monthly forecast calculation. I am using, among others, the ets() function from the forecast package to calculate forecast. It is working very well. ...
1
vote
1answer
19 views

Generate a random variable with a defined correlation to multiple existing variables

this question is strongly related to: Generate a random variable with a defined correlation to an existing variable. However I'm struggling to implement it in a more complex matter: Given X, a ...
1
vote
0answers
13 views

Lambda's from glmnet (R) used in online SGD [migrated]

I'm using cv.glmnet from glmnet package (in R). In the outcome I get a vector of ...
0
votes
0answers
9 views

Converting to JSON (key,value) pair using R [migrated]

My data frame contains the data as follows ...
0
votes
0answers
20 views

Canonical correlation analysis: taking into account the negatieve correlations?

I've got two data sets on the same observations: one with 4000 variables, one with 5000 variables. I've calculated the first 30 canonical correlations between these two data sets and I look at which ...
0
votes
0answers
35 views

A good multivariate regression solution in R [closed]

I have a data frame with one continuous response variable and hundreds of predictor variables (hundreds of additional columns in my data frame). I'd like to run a regression for the single response ...
0
votes
0answers
18 views

A good Multi-variate Regression solution in R

I have a dataframe with one continuous response variable and hundreds of predictor variables (hundreds of additional columns in my dataframe). I'd like to run a regression for the single Response ...
0
votes
0answers
7 views

weighted regression using plm

My data frame looks like something as follows: ...
1
vote
1answer
27 views

How does R package 'quantmod' receive (almost) real-time data? [closed]

I'm interested in quantmod R package's data extraction methods/algorithms.
4
votes
1answer
73 views

Interpreting linear regression residual plots using R

I'm investigating whether there is a relationship between the day of the week and an outcome value using linear regression in R, and would like to understand how to ...
3
votes
1answer
96 views

Significance of intercept (as portrayed via an R formula)

I'm new to statistics in general (but a very seasoned developer). I'm trying to grasp why it seems like there's a lot of consideration given to intercepts, at least where it comes to models. For ...
0
votes
0answers
13 views

fitdistr among Cauchy / Student-T / Normal distributions in R

I am posting this, hoping that it will also be useful to others. see also Fitting t-distribution in R: scaling parameter . my data series x is fat-tailed, 1063 obs. it seems straightforward to ...
0
votes
1answer
22 views

Error message: Contrasts in r [closed]

When I try to run a model in R with the following formula: ...
0
votes
0answers
8 views

Comparing models in plm, where sample size differs

I've been using the 'plm' package to fit models in R, usually with some kind of dynamic specification--either in ECM (a differenced dependent variable, and differences of the IVs and levels of DV/IVs ...
0
votes
0answers
10 views

interpreting multcompTs from multcompView in R

This graph was created using multcompBoxplot (from multcompView), and I'm having a difficult time interpreting what the mulcompTs of this graph are telling me in terms of differences between my ...
1
vote
0answers
20 views

Co-convexity of Splines

I wrote a Schumaker Shape-Preserving Spline in R. I am confident that I got the coding right because I get the same results as another person in matlab. This was written based on Judd (1998, ...
3
votes
1answer
86 views

What kind of Logistic Regression?

I am not an expert in regression, but I have a problem that I believe should be solved by logistic regression. The problem is rather specific, so I try to describe it using a more tangible example. ...
1
vote
0answers
38 views

Should I perform linear regression multiple times to train my dataset?

I am working on Boston data set from MASS library. I separated the training and test data (70 / 30) In order to train my data, should I run linear regression multiple times on training data? Is this ...
0
votes
1answer
49 views

Multiple Linear Regression coefficents

I'm doing a linear regression, in R. The values are like this - ...
0
votes
0answers
32 views

Fitting a model

I have a problem with fitting a model in lmer. My DV is reaction time to picture naming which is a continuous variable. I have three IV which are categorical. The first factor is TMS condition: either ...
0
votes
0answers
16 views

Fitting an asymmetric Gaussian

I've got some spectral data that I'm processing, but there is a clear skew in the data. What I need is to quantify how asymmetric the data is, and to plot a skewed Gaussian in order to obtain the ...
3
votes
0answers
45 views

How to fit an exponential equation of the form $Y = A + Be^{CX}$ to data

I need some assistance with a nonlinear adjust. I am trying to make a mathematical model that describes the rate of silicic acid escaping from an underwater sediment. For theoretical reasons, the ...
3
votes
0answers
35 views

Strucchange R package: correcting heteroskedasticity and autocorrelation [closed]

I’ve got a question concerning the R package strucchange that I use for testing and dating structural breaks in my PhD thesis. To be specific, I use the generalized fluctuation test framework with ...
0
votes
0answers
40 views

Extracting model equation and other data from glm function in R [closed]

I've made a logistic regression to combine two independent variables in R, using pROC package and I obtain this: ...
1
vote
2answers
42 views

Does this regression diagnostic plot mean my data is invalid, and if so how should I go about fixing it?

I am doing a project on cloud cover and cosmic rays and have undertaken a regression model in R. Above is the regression diagnostic plot and from the QQ plot I can see that the tails are skewed, ...
-1
votes
0answers
20 views

How would I find the parameter estimates for this model in R code? [closed]

How would I find the parameter estimates for this model in R? I need the lambda values. ...
0
votes
0answers
20 views

Panel data logistic regression with clustered robust errors in R [migrated]

I am trying to estimate a cluster-robust logistic regression from panel data in R. I have observations from companies over several time periods and a discrete (0,1) dependent variable. ...
1
vote
0answers
20 views

Why R linear ksvm don't use all support vectors

I was playing with svm and I made this data: x y | type ----------- 1 1 | 1 2 2 | 1 2 0 | 1 0 0 | -1 0 1 | -1 1 0 | -1 and using this setting ...
2
votes
2answers
87 views

Why do I get linear model when I tried to fit exponential model?

I was wondering why do I get linear model when I'm using exponential model, y = a * exp(-b*-x), to fit my data. Here is my code: ...
0
votes
1answer
18 views

ANOVA Table for Model In R

I'm trying to figure out how to produce an ANOVA Table in R for a multiple regression model. So far I can only produce it for each regressor, and the Mean Square is calculating as the same as Sum Of ...
0
votes
0answers
8 views

Tetrachoric Correlation Between Some Columns — R Factor Analysis Smoothing

My data has a number of columns that are dichotomous (in one case I seem to have a ternary logical relationship). I have been trying to perform exploratory factor analysis on this data. I can split up ...
0
votes
2answers
29 views

Calculating P- value

In ANOVA table , I got $F$-statistic $=330.285$ degrees of freedom (df) due to regression $= 6$ Error degrees of freedom $= 9$ But i don't know how to calculate $p-$value ? I have tried in ...
0
votes
1answer
24 views

R Linear model step NA values

My aim is to carry out a generalized linear model (glm) with 1 response variable and 13 explanatory variables.Unfortunately 3 out of the 10 explanatory variables contain NA values (2/3 of data set of ...
0
votes
0answers
11 views

Design of experiment - coding, method to analyze data

We have data from an experiment where there are two groups. They are both measured at time 0, before training and one of the group is trained the other is not. We measure some outcome variables ...
1
vote
0answers
26 views

R Linear model step NA values

My aim is to carry out a generalized linear model (glm) with 1 response variable and 13 explanatory variables.Unfortunately 3 out of the 10 explanatory variables contain NA values (2/3 of data set of ...
2
votes
1answer
35 views

L-BFGS-B converging in iteration 0 in R [closed]

I am trying to fit an F distribution to a given set using optim's L-BFGS-B method. For some reason, it is always converging at iteration 0, which obviously doesn't ...
0
votes
1answer
29 views

t Student test for two samples (and paired) in R. How to Apply for my specific data table?

I'm having a trouble trying to apply the t Student test for two samples in the data of the in the image below : The diff column is the difference of the observations. The experiment is: "A field ...
0
votes
0answers
35 views

Stability of boostrap confidence intervals

As a word of background, I want to show that certain result is stable when averaging over a large number of simulations, but could be just a lucky draw with a small number of simulations. I have a ...
-1
votes
1answer
36 views

Clustering Data of 8 dimensions

I am working on a data clustering and don't know how I can achieve it with R ! I am working on a data set of 50 observations each of 8 variables. What i want is to have clusters gathering the ...
0
votes
0answers
18 views

How can I replicate this r value? [closed]

I have the following spreadsheet: https://docs.google.com/spreadsheets/d/1uDtQ5iVixqzzM9HD6UkJ5kuOA7k2WUklCJumX3944kM/edit?usp=sharing The main tab is a database with concepts and semantic features ...
3
votes
0answers
26 views

Confidence interval of the mean response from nonlinear model

My problem (question at the end) is to calculate confidence interval (CI) (NOT prediction interval) of the response of a nonlinear model. I am working with R but this question is not R-specific. I ...
0
votes
0answers
15 views

Where I can find resources to learn how to calculate the sample size representativeness, and realiability and validity of questionnaires?

I'm totally newbie in psychometrics but starting from a research paper with full data I would like to understand: how to calculate if the sample size is representative; how to calculate reliability ...
0
votes
0answers
62 views

How do I analyse in R? [closed]

Edit: Re-write of my previous question due to my shoddy presentation. I am a complete R beginner and so have little to no knowledge as to how to go about performing statistical tests in R. Sample of ...
3
votes
1answer
48 views

Estimating robust standard errors in panel data regressions

I am trying to estimate robust standard errors in a panel data regression. I understand panel data regressions conceptually, but R offers a lot of options I am not sure about. My data is of the ...
0
votes
1answer
13 views

Combing Models for different levels of target variable in R

Beginner question please go easy. I have a classification variable with 7 levels. The crux of the problems comes down to the splitting of levels 1 and 2. Below is the output of a random forest in R. ...