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

-2
votes
0answers
13 views

Summary of quantile regression without st. error, t value and p value [closed]

I need the p value of the third coefficient in quantile regression but R shows only lower b and upper b ...
3
votes
1answer
72 views

How to specify logistic regression as transformed linear regression?

I am trying to reproduce the following example of logistic regression with a transformed linear regression: ...
0
votes
0answers
28 views

Sample size for logistic regression with a random effect

I wish to dig out a sample size (or to do a power analysis for a given sample size) for a logistic regression model with a random effect. To simplify, let's say I have a binary dependent variable Y ...
1
vote
1answer
37 views

Estimating regression coefficients in the presence of stochastic trend

I have a very basic problem. My time series is modeled as: $$Y_t = a_t + \beta x_t + v_t$$ $$a(t) = a(t-1) + w_t $$ where $ w_t$ ~ $N(0,W) $ with known W, and $v$ is white noise. I don't know if ...
2
votes
1answer
98 views

What does the HAT matrix looks like when the residual sum of square equals zero?

What does the HAT matrix looks like when the residual sum of square equals zero? How do the predicted y and the measured y relate to each other in this case?
0
votes
1answer
68 views

I built a random forest model in r…now what? [closed]

I've built a random forest model in R. All looks great in terms of my accuracy and AUC on the test set. How can I take extract the model so I can apply it to data in my database? For linear ...
3
votes
1answer
84 views

Multiple ARIMA models fit data well. How to determine order? Correct approach?

I've got two time series (parameters of a model for males and females) and aim to identify an appropriate ARIMA model in order to make forecasts. My time series looks like: The plot and the ACF ...
0
votes
0answers
10 views

Canonical correlation analysis on R: repeated data

I'm new to this, so I am sorry if it a dumb question! I have one set of data with 88 variables (X) and another set of data with 3381 variables (Y), hence I will be using the regularised CCA (both ...
0
votes
0answers
19 views

Looking for a package to visually show this [closed]

I want to be able to visualize a very long string of say 1000 characters in one line. From there the user can horizontally scroll through that long string of 1000 characters or zoom in to only see the ...
1
vote
0answers
36 views

R optim function : can it be used as a Solver [migrated]

I saw another question here on this forum, and saw that the Optim function was used as a kind of Solver instead of as an optimizer. Here is the link: ...
0
votes
2answers
25 views

Strange result in Poisson regression - R

I have performed a Poisson Regression in R, but I got strange results that I cannot find an answer for. My data is like this: ...
0
votes
0answers
7 views

softmax in nnet with cost function

I have 40 classes in a classification problem. I'm using nnet with softmax but since the classes are very imbalanced I get the same probabilities for every case to predict. I read about F1 score. Is ...
1
vote
1answer
35 views

CLT simulation with R

I am trying to run a simple CLT simulation with R. I want to create a vector with 10000 dice rolls, then take 100 means of samples of "n" size to see how when "n" increases, the distribution starts ...
2
votes
0answers
30 views

Modelling against “day” or “day^2” in to look at change over time?

I'm a masters student trying to model changes in behaviour, heart rate variation and faecal cortisol as welfare measures in sheep over the course of 22 days. Days -4 to -1 is used as baseline, day 0 ...
0
votes
0answers
2 views

open new seperate R session from R script for several processes [migrated]

Does anyone know if its possible to source R scripts from within a main R script buy have each sourced file run in a separate R session? I am trying to run multiple R processes in parallel (without ...
0
votes
0answers
33 views

Packages for ranking algorithms [closed]

Do you know any good packages for ranking algorithms in R or Python? Basically given a train set, I want to a create model which learns how to rank rows based on their features. Then I can predict ...
0
votes
0answers
6 views

Test for Regression Slope different from zero in R [duplicate]

I know how to do the Test for Regression Slope in R when the H0: b1=0 H1: otherwise but how do I do the Test for Regression Slope when i want to check H0: b1=1 H1: otherwise is it possible? ...
0
votes
1answer
30 views

Statistical test for logical vectors in R

The first issue that I feel like I have is that I have limited experience with actually using statistical tests. I apologize ahead of time if this question is illogical. I have two example vectors ...
0
votes
0answers
7 views

Input, analyse and graph Semantic Differential Data with R?

Has anyone tried to use Semantic Differential data in R? This is a very useful survey scale and I was surprised that information on it's use in R is very hard to find. The Likert package states ...
1
vote
0answers
71 views

Mixed effects model for longitudinal data

I have the following data: a group of patients for which I measure blood pressure (bp) 1 hour before treatment where they are given a placebo, then during treatment with the drug, and then 1 hour ...
0
votes
0answers
33 views

Multiple comparisons in linear mixed models for several correlations, in R

I am performing several correlations in R using the lme function, on a data set corresponding to the result of an experiment involving repeated measures. I would like to know whether some kind of test ...
0
votes
0answers
17 views

Question about aggregate function [migrated]

I'm an R user and I'm trying to rewrite some second hand SPSS code in R. Could someone give me a basic idea of what this code is achieving?: ...
0
votes
1answer
18 views

How can I extract all the p values from a model for an individual factor variable?

Let's say I have factor variable Var_1 with 3 levels, "1", "2", and "3". "1" is the base level of the factor variable. So when I run a linear regression, I get a p value for each level of that ...
8
votes
1answer
185 views

How many distributions are in the GLM?

I've identified multiple places in textbooks where the GLM is described with 5 distributions (viz., Gamma, Gaussian, Binomial, Inverse Gaussian, & Poisson). This is also exemplified in the family ...
0
votes
0answers
20 views

Best Subset selection and interaction terms

I am reading Introduction to Statistical Learning and I have a question related to best subset selection with interaction terms. My purpose is to graph R^2 or ...
0
votes
0answers
34 views

How to compute t-statistic and p-values for a DLM regression

I have a dynamic linear model (DLM) representation of a time series, which is modeled as a random walk component, and two time-invariant regressions: $$ Y(t) = a(t) + \beta_1 x_1(t) + \beta_2 x_2(t) ...
1
vote
0answers
29 views

simulate censored data (right censored) using R statistics [duplicate]

I want to generate right censored data, but I want to be able to pass in a parameter to a function to dictate that a certain percentage of the data will be censored. I have found this R-package: ...
0
votes
0answers
28 views

What statistical test can be used to determine if a list of attributes fits a known list?

My questions relates to microarray signature matching, but I will generalize the concept for anybody who isn't familiar with this technology. Say there is a list of attributes for a given sample. ...
2
votes
0answers
23 views

How to organise an iterative manual rotation of n component pairs?

I am currently building a q.rotate() function for the qmethod R package for Q Methodology. As is desirable for Q, I'd like users to be able to iteratively rotate ...
0
votes
0answers
25 views

How to clean corpora from words with fourfold repeated letters? [migrated]

On inspecting a term-document matrix created with TermDocumentMatrix of the tm library (of Twitter data), I find that many words ...
1
vote
1answer
29 views

Hazard estimate of 'muhaz' function?

library(muhaz) nsam = 5000 time <- rexp(nsam,4) cause0 = rbinom(nsam,1,.75) haz = muhaz(time,cause0) plot(haz) I simulated failure time data which is ...
0
votes
1answer
39 views

What type of Anova to use and how (in R)?

I tried to find differences between delta G values in amino acids between 9 species. Here is a link to the table that I read in. (The header lists the species): ...
1
vote
2answers
20 views

Text Categorization packages in R [closed]

I have a dataset of 1400 data points. My fields are Description and Category. I have 1200 data points as the training dataset and 200 for testing purpose. My goal is to analyze the Description column ...
0
votes
1answer
31 views

Is there a relationship between these two standard deviations

I just started thinking when you have time series data and was curious about the following question. Suppose you have the standard deviation of one observed result. Would the standard deviation of the ...
0
votes
0answers
4 views

How do I appropriately use polygon() to shade the confidence interval of a plot and appropriately scale it so that everything can be seen? [migrated]

Currently I have a simulated data set describing the concentration-time profile of a drug at 10 different doses, with five replications ("subjects") for each dosing group. I am trying to create one ...
0
votes
1answer
18 views

Simple effects of categorical interaction

I have two two-level categorical variables, IV1 and IV2. I want to fit a linear model in R and find out the simple effect of IV1 on the DV at each level of IV2, separately. I'm not interested in the ...
0
votes
0answers
16 views

Portmanteau test vs Breusch Godfrey test

I recently fit a VAR model to two time series and I was trying to check for serial correlation in my model. My main question is, when i use a function called serial.test in the R package, there are ...
1
vote
2answers
48 views

Is it correct to use the scores of PC1 as a composite index?

I have three correlated variables for 18 cases. I would like to construct a composite index using PCA, where each case has a score. Basically to reduce three dimensions to one, and use that dimension ...
-2
votes
0answers
18 views

Difference between clustering functions in R

I am trying to understand the difference between the varclus function and the hclustvar function for clustering in R. I understand that in the varclus function you can specify a similarity measure, ...
0
votes
1answer
17 views

Comparing Species diversity of 32 plots between years

I need to know what type of test to use to compare species diversity between 2 years. I have been analyzing a species survey data set collected in 2012 and 2014. The data include stem count ...
2
votes
0answers
26 views

Difference between clustering functions in R [duplicate]

I am trying to understand the difference between the varclus function and the hclustvar function for clustering in R. I understand that in the varclus function you can specify a similarity measure, ...
0
votes
1answer
41 views

Multiple testing adjustment in linear models

I have troubles with multiple testing correction (For example, bonferroni adjustment. I'm aware that it's not most correct one). ...
0
votes
0answers
65 views

R syntax - Multivariate regression with an unknown coefficient or two, for a dummy (engineer)

Something I rather vaguely asked a few months back, saw the tumbleweed roll by (actually hacked some hardware in the time, to get a few answers) before the question was deleted, so I'll try again on a ...
0
votes
0answers
15 views

How can I filter marketing campaigns out of my decomposed seasonal data?

I've recently jumped into the deep end of statistical analysis of revenue. I've learned a ton about statistics, probability, decomposition (stl), and the Python and R languages. I feel like I'm ...
1
vote
0answers
19 views

Applying a beta binomial distribution and my understanding

I am having a bit of a problem in understanding the betabinomial distribution. I've only read some short introductions, but I can't really seem to get a grasp of it. What I do not understand is the ...
0
votes
1answer
30 views

Classification trees: favor one classification over other

We're using classification trees (c50 package) for a BUY/WAIT advice. However, the advice in our training set is not well balanced. That is, we advice to buy 3/4 times more than to wait. Probably as ...
1
vote
0answers
19 views

Correlation between counts

I'm trying on attendance data to find relationships between where people go. For example, say I have information on users A, B, C & D and what kinds of places they've visited in the past few ...
0
votes
0answers
18 views

Covariance Matrix vs. Pairwise Covariance Matrix?

I found this equation here to calculate a covariance matrix of any number of variables using matrix algebra. $1/N(X - 1\bar{x})^T(X - 1\bar{x}^T)$ For a given matrix $X$ with $N$ samples. The ...
0
votes
1answer
20 views

GLMM with Gamma distribution vs. Gaussian distribution with log transformation

Is there really a difference in result if I use a GLMM with Gamma distribution vs. a model with a Gaussian distribution with log transformation? If so, how do I choose between the two methods? See ...
1
vote
0answers
13 views

How to interpret Realized Volatility and TSRV using R

I am looking at some high frequency data and I would like to know how to interpret and compare Realized volatility (RV) and Two Scale Realized Volatility (TSRV). References below. Given X is the log ...