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

1
vote
1answer
113 views

SV model estimation in R using tsbugs

I have been trying to estimate the basic stochastic volatility model using OpenBUGS via R and at an stage of the following command. Please can you comment for the ...
1
vote
1answer
108 views

Which type of residuals to use for the Durbin-Watson test (autocorrelation)

I want to check if there is residual autocorrelation in my model and the test for this is the Durbin-Watson test. I am using R and my question is if it makes a difference which type of residuals one ...
4
votes
1answer
567 views

How to test for outliers in an mlogit model in R

I am running a multinomial logistic regression using the mlogit package and mlogit function in R. Now I need to check for ...
0
votes
0answers
15 views

R for lme complicated study design

I have a data set where siblings (brothers and sisters) had the quantity of a specific bacteria measured at specific intervals since their birth (2 weeks, 1 month, 2 months, 6 months, 1 year). Because ...
0
votes
0answers
4 views

R - cor.ci results interpretation

I am doing some survey analysis for my dissertation, and am interested in studying possible correlations between four variables, based on Technology Acceptance Model.The survey is built on a ...
0
votes
1answer
22 views

aggregate all data by Date and ID

I have a dataset with 20 different columns and i want to aggregate all of the columns by the first two columns (Date and ID). Is there a way to say aggregate all instead of typing the names of the ...
0
votes
0answers
7 views

How to check stability condition of VEC estimates in R?

I am estimating a VEC model and need to check the stability of its parameters. The vars package has a function to do this on an object of class varest generated by ...
0
votes
2answers
208 views

Partial Least Squares structural equation modeling

Im calculating a Structural Equation model with Partial Least Squares (with R). Lets say a simple example: two Response values (R1, R2) are combined to a latent variable RespLV = weight1*R1 + ...
1
vote
1answer
14 views

Different output for cox regression in R vs SPSS

During my analysis that I perform with a collaborator we get consistently different ouputs in cox regression between R and SPSS. Betas and p-values differ minutely, usually somewhere in the third or ...
0
votes
1answer
18 views

MLE of Gamma when only given observations [on hold]

i've been given 10 observations of X, where X is a random variable. the observations are 141 16 46 40 351 259 317 1511 107 567 and now given they are gamma distributed, how do you find the MLE using ...
0
votes
1answer
10 views

Confidence intervals for Tobit model in package AER in R

I use a Tobit model to predict censored data. I use the AER package in R. A toy example looks as follows: ...
4
votes
1answer
2k views

two-sample Kolmogorov-Smirnov test p-value in R confusion

I'm confused about the appropriate interpretation of p-values returned by the two-sample Kolmogorov-Smirnov test (ks.test) in R. In slide 23 of this presentation about non-parametric two-sample ...
0
votes
0answers
9 views

How do I check whether my data fits exponential or lognormal or weibull using chi square and ks tests in R?

I'm a newbie to R language and I need to quickly find whether a set of data I have in a CSV file fits the three distributions Generalized exponential, log normal and Weibull. I need to test it using ...
1
vote
1answer
17 views

Bland & Altman plot for repeated measures using one measuring device

I am examining the reliability of a measuring device by measuring a force generated på test persons 7 days apart using R. In order to assess this properly I want to make a Bland & Altman plot ...
2
votes
1answer
424 views

How to apply an AR(MA) model to a prewhitened signal?

I have two (vehicle velocity) signals that should consist of similar "latent" drivers, but have different autocorrelation structures. The driver-signals are quite nasty statistically, so I'm not ...
0
votes
0answers
18 views

How do I use MatLab or R data model in an machine learning application [on hold]

I want to use matlab or R to create a prediction model, once this is complete how would I use that model in a an application?
0
votes
0answers
9 views

Correlation analysis and Clustering in R - Some suggestions [on hold]

I have a biological data, comprising of intensity values associated to 24 masses. Each mass file has 10,000 intensity values corresponding to 10,000 coordinates. So, the data matrix in R would look ...
0
votes
0answers
10 views

How to extract values for only one particular fixed factor from lmer object in R? [on hold]

I have following output for lmer object constructed using coxme package: ...
2
votes
0answers
111 views

When and why do I have to use “trait” for multinomial multilevel models with MCMCglmm in R?

I want to estimate a multilevel multinomial logit model but I am struggling with the terminology and notation used by the R-package MCMCglmm. There is documentation ...
0
votes
1answer
26 views

Hierarchical cluster analysis with a similarity matrix

I am trying to analyse the results from a card sorting study i did, but all i have is raw data. I have the similarity matrix for 53 cards, but I am trying to figure out how to do a hierarchical ...
-2
votes
0answers
13 views

Bayesian data analysis with R [on hold]

Lets say I have a big list of phone models I have bought through the years with several features listed as a "checkbox"-style: ...
0
votes
0answers
18 views

R ggplot2: overlaying multiple geom_ribbon objects in a single plot using a nested loop [migrated]

I have five line plots from which I'd like to output a shaded area that represents the region between their plotted upper and lower regions. I'm creating an R script (see below) as I have multiple ...
2
votes
3answers
73 views

How does the logit link handle binomial (1/0) data?

I have a data set that contains a continuous explanatory variable and a set of responses as binary success and failures. For example, ...
1
vote
1answer
3k views

Intepretation of crossvalidation result - cv.glm()

My logistic model has been suspicious due to enormous coefficients, so I tried to do a crossvalidation, and also do a crossvalidation of simplified model, to confirm the fact that the original model ...
1
vote
0answers
26 views

How to detect different social groups in a small questionnaire dataset?

I work with a very small questionnaire dataset, in which perception of 10 respondents to the size of, say, an unseen population is quantified: The population is divided into eight sub-populations, and ...
0
votes
1answer
13 views

Can adding uniform sampling weights change p-values?

I am doing an analysis of Average Marginal Component Effects (AMCEs) of a conjoint experiment in R. The package I use, cjoint 2.0 (see amce function), allows to add sampling weights (I want to compare ...
0
votes
3answers
53 views

how to calculate R-squared in glm?

I came up with below for my glm analysis but I need to calculate R-squared to cite in the paper? anyone can help me with this please? summary(lrfit) Call: ...
0
votes
0answers
9 views

How can I determine a transition point in a curve?

I have plotted a bar graph and knowing that the transition in the curve takes place around values 21 to 25 , I want to find such point in general. ...
0
votes
1answer
23 views

Comparing Height of Web Page against Scroll %

I have a collection of 108 data points in the following format: page height | % of users who scrolled upto 25% of page | 50% | 75% | 100% (full page) I'm trying ...
0
votes
1answer
264 views

Difference in rules via apriori() with target “frequent itemsets” and ruleInduction() and via apriori() with target “rules”

Regarding R package arules: To my understanding the Apriori algorithm works by first finding all frequent itemsets that meet the support threshold and then generate strong association rules from the ...
1
vote
0answers
19 views

Reporting the Actual Formula/Equation of an LME model (with factors) used in R?

I have a dataset that has measurements of resource consumption in buildings for a number of years. I am interested in the differences in resource consumption of buildings in my study area between ...
1
vote
1answer
55 views

Why is my density plot just a line on the bottom?

Basically, I'm just trying to plot a curve over my histogram for the weight of a few students. lines(density(weight), lwd = 2, col = "red") However, what I get ...
0
votes
1answer
14 views

Multi-class logistic Generalized Additive Models [on hold]

I am looking for a package for three-class logit and probit GAM. I have searched and found out that ZeligGAM in R works for this but it seems that it is only applied to binary dependent variables. In ...
1
vote
1answer
378 views

Specifying Cross-Level Interactions in LMER

I am trying to figure out if it's okay to specify cross-level interactions in a hierarchical model with fixed effect predictor variables at both levels using the ...
0
votes
0answers
19 views

Comparing the estimated coefficient in Logit versus Mix Logit, regarding the scale parameter

My question is how can I compare the estimated parameters for a logit model with a mixed logit model? I am using mlogitpackage in R and my code is as follows: ...
2
votes
2answers
32 views

Understanding the direction & strength of a correlation, & causal status, from a chi-squared test

I am analyzing Stack Overflow Posts. So I have a database with 1000000 questions, their current score (upvote or downvote) and a flag, that there is a source code part in the question (or not). So I ...
0
votes
1answer
192 views

How to obtain p-values for a given Kendall's Tau value (not calculated from data)

I want to obtain p-values for Parker's Tau-U (Parker et al., 2011). which is a measure based on Kendall's Tau. Tau-U is related to Kendall's Tau in such a way that it's possible to translate a Tau-U ...
0
votes
0answers
10 views

Displaying data characteristics after multiple imputation

I have original data which I run a few commands on to get a feel for the data. For example, I have men and women, and in each group, I have the percent in each cancer type (eg brain, lung). In the ...
1
vote
1answer
12 views

Model matrix for linear model with multiple contrasts

I don't fully understand the concept of a model.matrix. Assume I have the following experimental design: ...
0
votes
0answers
13 views

Separation problem in GLM

So I think I have a separation problem in my logistic regression model. The response variable (that only takes 0 or 1 values) takes 99.2% of its cases as 0 and only 0.8% as 1. This is the ROC curve ...
0
votes
0answers
15 views

Bootstrap pvalues: strange adjustment — pbkrtest PBmodcomp LRT

As far as I can tell, PBmodcomp is doing some straight up bootstrapping, similar to this Faraway example for lmer models mmod and rmod (maximal and reduced models): ...
2
votes
4answers
8k views

How to calculate stock volatility in %?

How can I calculate the stock volatility in percentage? Do i have to use sd() function without any other calculation ? Thanks
7
votes
1answer
166 views

Julia: Taking stock of how it has been doing

I came across a 2012 question that had a very good discussion about Julia as an alternative to R / Python for various types of Statistical Work. Here lies the original Question from 2012 about ...
1
vote
0answers
20 views

extremely high Cook's D & dfbetas results from influence.ME

I fit a mixed effects logistic regression with the glmer function from the lme4 package to some data I have. Next, I've been using the influence.ME package to run some diagnostics (e.g. Cook's D and ...
1
vote
0answers
18 views

PLS with more variables than data points

Does it make sense to run partial least squares (PLS) on a data set that has many more columns (variables) than it has rows (data points)? I am using plsr in R. I ...
0
votes
0answers
12 views

Understanding my serial mediation from R and creating a serial mediation model

I am having trouble understanding my serial mediation results from R. I think that my results are significant, but I'm not sure how to create a model using my results. Can R create the model on its ...
1
vote
1answer
24 views

Time-dependent variable in survival analysis using R

I am conducting a retrospective study where I have a cohort of cases who underwent the same surgical procedure. The primary outcome of the study is the recurrence incidence rate during a follow up ...
0
votes
2answers
397 views

difference between R square and rmse in linear regression

When Performing a linear regression in r I came across the following terms. ...
-1
votes
1answer
28 views

Gaussian processes ordinal regression in R [on hold]

Is there any ordinal regression using gaussian processes implemented in R? I made a research in the Internet, but I didn't find anything.