R is an open source programming language and software environment for statistical computing and graphics.

learn more… | top users | synonyms

0
votes
0answers
10 views

Reduce Sample Size (Categorise??) [duplicate]

I have been looking for an answer to my question but havn't been able to find any literature documentation or help in regards. I have a large dataset which I need to further analyse. Because of this I ...
0
votes
0answers
10 views

Parameter MLE for dlmModReg: why not include both V and W?

I'm fitting a univariate regression model using the dlm R package, and was able to get sensible results (compared to least squares, PCA) only after I dropped the process noise covariance term $W$ from ...
0
votes
1answer
29 views

I study subpopulation so huge that chi-squares test insists it is not representative. How do I get confidence intervals for my population?

I want to get results about population A. But all I can study is subpopulation C of B, where B is a subpopulation of A (that is, C $\subset$ B $\subset$ A). Each member of A is classified into one of ...
0
votes
1answer
47 views

Is there an interactive notebook tool for R as iPython Notebook?

I've been using RStudio and I like it, but for the type of work I do a Notebook environment (like iPython Notebook) is more useful than an IDE. Is there an iPython Notebook equivalent for R?
0
votes
0answers
27 views

How do we get log likelihood of KNN?

For getting log-likelihood values, I am using R AIC() method. Although I can get the log-likelihood values of linear regression models, getting the following error for when I applied R AIC() method on ...
4
votes
1answer
24 views

How to model month to month effects in daily time series data?

I have two time series of daily data. One is sign-ups and the other terminations of subscriptions. I'd like to predict the ...
0
votes
1answer
13 views

ARIMAX and xreg variables

Just wondering how to setup xreg variables for ARIMAX models? I am particularly interested in whether I should be grouping together events for dummy variables. For example should I create 1 dummy ...
0
votes
0answers
17 views

Problem with the formulation of a gaussian copula likelihood function

I recently got to hear about copulas which to me sounded like a nice tool to model relationships between variables. I decided to try to implement the likelihood function for a bivariate Gaussian ...
2
votes
0answers
20 views

Algorithm to detect if a particular event (date) has an impact on a time series

I have many time series and a set of dates (key events eg public holidays or big sales days). There are too many for me to look as manually and determine if either an increase or decrease occured as a ...
1
vote
0answers
36 views

Non-linear regression, plot mean, SE in R

I need to create a graph like the one below.The idea is that I have three data groups with 5 replications on the first two groups and 3 replications on the last one. I must obtain a regression curve ...
2
votes
0answers
53 views

Mixed/hierarchical/multilevel model for n-of-1/single-subject design: incorporating baseline data?

So I often do little self-experiments where I blind & randomize things; these can be formulated as your normal t-tests, but sometimes the measured metrics have extensive baselines which seem like ...
0
votes
0answers
25 views

Bolasso in R, or other model selection techniques for parametric models

I can't find any packages which allow me to implement bolasso in R, does anyone know of one? Otherwise, I am interested in model selection techniques which can be implemented in R for logistic ...
0
votes
1answer
27 views

How do I use a mean and 95% confidence intervals to draw from a distribution? [duplicate]

I have a number of parameters for a model. The parameter values are presented as the mean and the 95% confidence interval. I am not provided with standard deviation or sample size. I am using R. I ...
1
vote
1answer
46 views

Is it appropriate to use SE in place of SD in rnorm()?

I have wood density data for a number of tree species given a tree's state of decay. I am presented with mean density and standard errors (SE). I am NOT provided with sample sizes. For example, a ...
1
vote
0answers
23 views

Is there an R package for nonlinear mixed effects model with spatial autocorrelation?

I want to fit a nonlinear mixed effects model for repeated measures data. The subjects on which the measures were repeated are spatially structured. Is there a package in R for this? I also have ...
1
vote
1answer
48 views

What is the best way of presenting a correlation? (in R)

I have two variables which show significant correlation (Spearman). I would like to graphically show the strength of the relationship, much like showing a linear regression fit with confidence bands. ...
1
vote
0answers
12 views

Nested test to remedy pseudoreplication

Data structure: I have two datasets from two protected areas that differ in protection status. Both areas contain 43 and 37 sites each. Question: I would like to know which test would be the best ...
0
votes
1answer
44 views

Continue from my previous question - distribution for a set of data using R results

Follow the very useful answers from Peter Flom, Wayne and many others. I have now started using R and it gives me a feeling of python :) The results are below but I am not sure how should I go from ...
0
votes
1answer
20 views

Search for interactions using carets rfe function

it is straight forward to search for purely additive models using the rfe function in caret. Is it possible to include all interactions as part of the search? In the train method, we can simply say ...
0
votes
1answer
50 views

Which is the better method to do forecast..1-step or h-step ahead?

I am using forecast() package in R to predict future values. I have a time series data for approx 6-7 years. First, I split the data into training set and test set. Test set contained values of the ...
0
votes
0answers
25 views

Remove terms with NA coefficients from lm model with interactions [migrated]

I'm training a model using lm with interactions by fit <- lm(Y ~ .^2, data) Some of the interaction terms have "NA" as their coefficient, indicating I suppose ...
1
vote
0answers
28 views

GRM or mixed effect models

I need your help. In experiment I have measured the grow of one plant on 40 locations. At one location different number of plants were measured, but always the same species. The distribution of ...
1
vote
1answer
39 views

Methods for imputation of missing values with spatially autocorrelated data

I am looking at the spatial patterns of turnover in aquatic assemblages using gradient forest and generalized dissimilarity models in R. I have species and environmental data for more than 400 sites ...
8
votes
1answer
149 views

Regression for a model of form $y=ax^k$?

I have a dataset which is statistics from a web discussion forum. I'm looking at the distribution of the number of replies a topic is expected to have. In particular, I've created a dataset which has ...
0
votes
2answers
27 views

Need cube (square) plot for 2 factors factorial design in R

Is there any R package that can produce cube plots for 2 factors (in fact it is a square plot)? I want something similar to the first plot at the end of this page on factorial plots. In the package ...
2
votes
1answer
32 views

Alternatives to the Baron-Kenny approach to modeling mediation

I'm about to open the door to a very thorny issue in the social sciences. How does one correctly model and test hypotheses about mediating variables using observational data? I'm familiar with the ...
1
vote
0answers
30 views

Maximum likelihood parameter estimates for Kalman filter with time-varying state transition

I'm currently studying Kalman filter, and the model I'm trying to fit is a uni-variate regression: $Y_t = \beta_t \mathbf{X_t} + v_t$ $\beta_t = \beta_t-1 + w_t$ where $v$ and $w$ are both ...
0
votes
0answers
42 views

Is there any Python equivalent of R's biglm?

I have used biglm in R and found it very useful. Now I need the same type of functionality in python. Any ideas? I have seen that patsy/statsmodels has an ...
0
votes
0answers
10 views

Import Voozanoo data into R [migrated]

Voozanoo allows exporting the data in various formats. What's the best way to import the data into R? I tried the CSV export, it worked, but extracting the codes and values of categorical variables ...
3
votes
2answers
37 views

Use Random Forest model to make predictions from sensor data

say I have a sensor that measures temperature, pressure ++, and want to use this data to predict some quantity "A". If I use multivariate regression, I can simply implement a model of the form ...
1
vote
1answer
39 views

How to plot a “differential word cloud” in R?

I have a questionnaire with one "open" text box, and 20,000 responses. I'm not planning to read all of them, but I'm thinking of interesting things to do with them. A general tag cloud would not be ...
0
votes
0answers
35 views

How to deal with a lot of plots in R [migrated]

I have a for loop which produces 60 plots. I would like to save all this plots in only one file. If I set par(mfrow=c(10,6)) it says : ...
3
votes
1answer
25 views

How to interprete TraMineRs results of disstreedisplay and seqtreedisplay

I am not quite sure what the differences are between the outputs and results of disstreedisplay and seqtreedisplay. Maybe you ...
0
votes
0answers
12 views

deviding a storing a file as different vectors [closed]

I have a file with 3 columns how can i read the file and then save the third column’s values in different vectors depends on the first and second columns. for example in this example i need to save ...
4
votes
2answers
95 views

The way an MA(q) model works

I am trying to understand the way MA(q) models work. For this purpose I have created a simple data set with only three values. I then adapted a MA(1) model to it. The results are shown below: ...
1
vote
0answers
31 views

Shapiro test on replicated values

I have a distribution of frequencies (1000 data points) expressed as %. The list of data looks like this: 3.10% 1.80% 1.70% 1.70% 1.60% 1.60% 1.50% I would like ...
-2
votes
1answer
32 views

A function like lmer?

Can you suggest me any random effect linear model in R? At the moment I am using lmer, but I would like to know if there is any other similar function. Thank you
-1
votes
0answers
48 views

Plotting group means of cdf in R [closed]

I normally plot my graphs with below code: ...
0
votes
1answer
35 views

Using the rugarch package when sample size is small

I have a question about the rugarch package. My sample size is 43 and I have a problem to model a garch whose mean equation includes an exogenous model; otherwise ...
4
votes
0answers
29 views

How can one perform a two-group binomial power analysis without using normal approximations?

I would like to do power analyses for hypothesis tests of (non-)equality of proportions in which the proportions are very small. I would like to do so without using normal approximations of the ...
0
votes
0answers
58 views

Easy-to-apply tests for randomness

I'm interested in testing a sequence of numbers for randomness. I've done some searching and come across die hard and die harder. However these tests seem to require some expertise to apply, or at ...
3
votes
1answer
60 views

Value at $D_\max$ from Kolmogorov-Smirnov test in R

I am comparing two distributions using the Kolmogorov-Smirnov test [ks.test()] in R and would like to know what the numerical value is where $D_\text{max}$ occurs. ...
0
votes
0answers
38 views

cumulative distribution function plotting [duplicate]

I have some values from different repetitions of different experiments and I need to plot cumulative distribution function. You can see a fraction of my file below. can you help me how can i do that. ...
0
votes
1answer
58 views

How do you prepare longitudinal data for survival analysis?

I'm trying to plot a Kaplan-Meier curve of my data with R. Currently, the data is in the following format: ...
0
votes
0answers
46 views

How to reshape a variable to, say, mean = 5, sd = 10? [duplicate]

The problem I am having is that I have a distribution that I want to remain the same shape, but the mean and variance altered. When I use scale() in R, it can ...
1
vote
1answer
56 views

How to adjust the shape of a gamma distribution

I have a dataset (vector) to which I would like to fit a gamma distribution (x), which given the shape seems reasonable. The charts below show the histograms of the two dataset: vector and x. The ...
0
votes
0answers
25 views

Selecting tuning parameters with caret using standard deviation of custom metric

I'm using caret with custom fitting metric, but I need to maximize not just this metric but lower bound of it's confidence interval. So I'd like to maximize something like ...
0
votes
0answers
26 views

Fixed Effects Regression with Interaction Term Causes Error

I am trying to estimate a panel dataset with an interaction term for geographical areas (LoadArea, DischargeArea) which signifies a route. Using the fixed effects specification, it does not like the ...
0
votes
0answers
42 views

Is my random variable affecting my response?

I performed an experiment on coral colonies (10 colonies, randomly chosen in repeated measurements); manipulating aragonite/carbon chemistry and temperature (fixed effect) to analyse effects on the ...
3
votes
1answer
98 views

Dummy coding for contrasts: 0,1 vs. 1,-1

I'm seeking your help in understanding the difference between two different contrasts for dichotomous variables. On this page: http://www.psychstat.missouristate.edu/multibook/mlt08.htm under ...

1 2 3 4 5 79