Use this tag for any *on-topic* question that (a) must have an `R`-based solution yet (b) is not *just* about how to program in `R`.

learn more… | top users | synonyms

0
votes
0answers
2 views

Are there any packages in R to use Apache Shark?

I would like to data mine Apache Shark with R but I'm not sure if there any packages available for R. Does anyone know of any? Thanks
0
votes
1answer
6 views

maximizing frequency

I am trying to find the area with thickest density. I have newborn numbers by day for which I am trying to find the series of 7 consecutive days that would produce the highest frequency. So the start ...
2
votes
0answers
11 views

Inspecting mechanism for missing values in categorical data without prior knowledge

Scenario I am inspecting the Soybean data set, which has a quite a number of missing values for various categorical variables. Plan My plan is to eventually perform data imputation. However, ...
0
votes
0answers
14 views

how we get Initial starting value in goodness of fit in R [on hold]

How we chose starting initial value in R to estimate the parameter by goodness of fit or MLE
0
votes
0answers
16 views

Hyper-prior for negative binomial in hierarchical model using JAGS/BUGS

Below I'm using a negative binomial because it is more flexible than a simple poisson model. The data are counts $y$ of events for 16 individuals $x$. There are 14 counts (i.e. counting periods) for ...
1
vote
1answer
20 views

P value for interaction term in mixed effects models using lme4

I'm analysing some behavioural data using lme4 in R, mostly following Bodo Winter's excellent tutorials, but I don't understand ...
1
vote
0answers
23 views

Repeated measures mixed model using lmer in R

I’m hoping to get some guidance in specifying a mixed model using the lme4 package in R. The study is quite straightforward. It’s a repeated measures design with pre/post measurements on the ...
1
vote
1answer
20 views

Variance-covariance matrix of survival model

Suppose I have a survival model like this: ...
0
votes
0answers
17 views

what is the return value of predict in the fGarch package

I have a question about a quit sophisticated model for a time series. Suppose $ \{X_t:0\le t\le T\}$ is a time series. The plot of autocorrelation function and partialcorrelation function suggest and ...
0
votes
0answers
8 views

Error message when fitting 3-dimensional Copula [migrated]

I want to use a Gumbel Copula for a 3-dimensional data set. I use R and the Copula package. It gives me an error, though. This ...
1
vote
1answer
33 views

Compare two samples

similar questions have been asked but have not managed to get a conclusion from them. I am comparing two sets of samples, where ratios have been obtained for several analytes per sample. So the values ...
1
vote
0answers
7 views

Optimum value of minlev in function combine.levels

I have a dataset of 306967 rows and 23 columns, and I am building a regression model for predicting a factor based upon 6 other iid variables. Doing this I encountered an issue of large no of levels ...
1
vote
0answers
14 views

Problem with visualising logistic regression using the effects package in R [migrated]

I am using the effects package in R to plot the effects of categorical and numerical predictors in a binomial logistic regression estimated using the lme4 package. My dependent variable is the ...
0
votes
0answers
6 views

Balanced sampling in R [migrated]

Currently I'm using "cube" function for balanced sampling in R. It works fine on moderate amount of data. However, if the entire population of 10,000,000+ is used, R hangs. Is there any alternative ...
0
votes
0answers
15 views

Simulating a bimodal biased IV estimator

How can I simulate a bimodal biased IV estimator? The common unimodal heavy-tailed biased estimator would be something like this: ...
0
votes
0answers
22 views

Hidden Markov Models methods for selecting optimal number of states

Package RHmm (R) I have a vector which I fit into a hmm model in an attempt to select an optimal number of states for a hidden markov model. ...
0
votes
1answer
29 views

Estimating finite sample bias for Instrumental Variables

Are there ways to estimate the finite sample bias with instrumental variables? I guess this would be conditional on assuming some structure to the problem and also would involve simulation, but, at ...
5
votes
0answers
26 views

Multivariant time series in R. How to find lagged correlation and build model for forecasting

I'm new in the page and pretty new in statistics and R. I'm working on a project for college with the objective of finding the correlation between rain and water flow level in rivers. Once the ...
2
votes
1answer
55 views

Plot graph with more than one value on x and y-axis in R

I have a dataset containing two columns and a total of 90 rows. The data is from my experiment where in the first column I have an integer representing the quantity, in the second column I have a ...
1
vote
0answers
21 views

How to predict cumulative hazard in survival analysis?

Suppose I have a survival model like this: ...
0
votes
0answers
16 views

Cochran-Armitage test for trend in R

I have a 4x2 table that I want to do a Cochran-Armitage trend test for. Basically, I want to test for lack of independence as the dose (the rows) increase. I'm trying to figure out the R code but am ...
0
votes
0answers
10 views

Degrees of freedom correction to pooled regression of demeaned data in R

Is there a canonical way to do degrees of freedom (DF) correction to ols objects from the rms package (and to ...
1
vote
3answers
96 views

Sampling data to have specific mean and standard deviation

I have a data that I want to sample such the resultant distribution of values should have specified mean and standard deviation. I can think of rejection sampling to achieve this however that seems to ...
0
votes
0answers
9 views

Probabilities of predicted classes for a bayesnet using bnlearn R package [on hold]

I have been trying to use a Bayesian network to predict a target node. I want to find the probabilities of each class instead of the class labels when I use the corresponding predict method. I am ...
0
votes
3answers
48 views

Problem with PCA

I am trying to do some PC analysis on my data coming from lipids measurements in different samples. I only have one factor: if samples are diabetic or non-dibetic. Here is the PCA graph I get: As ...
0
votes
1answer
36 views

Power transformation using Box-Cox transformation

I have a dependent variable Cost and an independent variable VPT. I want to perform a power transformation on ...
0
votes
0answers
65 views

Data Visualization with R, not possible by excel 2007 [on hold]

Can you please suggest me some good data visualizations using R which are very tedious to do using Excel 2007? For example, I found treemap in R which I can't able ...
3
votes
1answer
212 views

Newton's algorithm for a Minimax Procedure

In order to find the minimax solution of a certain problem I have to determine the constant $c$ that provides the root for the following equation: $$l(c)=3\times \left [ 1-\Phi \left( c-75 \right) ...
0
votes
0answers
8 views

Minimum Distance Estimator in r

I am running a regression to estimate the relationship between a dependent variable and some regressors. Let's say I have two alternative models based on two different assumptions about the exogeneity ...
0
votes
0answers
30 views

avoid for loop in R [migrated]

I am basic level in R. It's said better to rewrite loops by apply. But for the following problem, I've no idea how to achieve that. Can anyone help? Or recommend some similar examples? ...
2
votes
1answer
33 views

What exactly does the 'boxcox' function in R do?

I am familiar with the power transform family and I know how to estimate the MLE for $\lambda$ for given samples of a random variable. I have been using the 'boxcox' function in R for a sample of a ...
0
votes
1answer
40 views

What do the coefficients of the crossproduct of regression mean?

How can I interpret the coefficients of the crossproduct of each of the following codes? What do they mean? How can I deduce that they correspond to our expectation? ...
0
votes
0answers
9 views

Using a Decision Tree Algorithm such as C4.5 to understand population Partition

I have multivariate data about a certain population with more than 1000 attributes per exemplar. Some of the variables are basic demographics attributes including: gender, age, race, ethnicity, ...
3
votes
2answers
102 views

Efficiency of beta estimates with heteroscedasticity

I need something clarified and that is when you have non-constant variance, estimates won't be biased but will be a problem when it comes to the S.E. formulas and efficiency. Therefore OLS estimates ...
1
vote
0answers
38 views

Stata's xtlogit (fe, re) equivalent in R?

Stata allows for fixed effects and random effects specification of the logistic regression through the xtlogit fe and xtlogit re ...
0
votes
0answers
3 views

Plotting the overlay using an exponential smoothing of a time-series using `lines()` [migrated]

I have the following code so far but I am not sure which function I should use for plotting the yearly average measurements of temperature for New Hampshire, from 1912 to 1971, and overlay an ...
2
votes
2answers
124 views

Difference between regression methods

I have a set of data where the response is a proportion. For each event in the experiment, a system will correctly tag X of Y ...
0
votes
0answers
8 views

How to insert output into command line / function [migrated]

I have output ("1b" "2b" "3b" ... "40b") The values are then inserted into a function for further calculations. I am prepping the values with the following code. ...
0
votes
0answers
15 views

Model matrix of a mixed model

Suppose I have a mixed model like this: ...
2
votes
0answers
23 views

Plot and interpret ordinal logistic regression

I have a ordinal dependendent variable, easiness, that ranges from 1 (not easy) to 5 (very easy). Increases in the values of the independent factors are associated with an increased easiness rating. ...
0
votes
0answers
16 views

How to obtain the complete model matrix of a mixed model?

Suppose I have a mixed model like this: ...
0
votes
0answers
15 views

test for variance by using chi square test in R

how can i know if these data -> 93, 91, 93, 150, 80, 104, 128, 83, 88, 95, 94, 97 58, 139, 91 provide evidence that the pop variance is greater than 0.05 (a=0.05) by chi square test in R? please ...
0
votes
0answers
12 views

About penalty setting in package changepoint

I have read the documentation for this package,but there is one place I don't understand, in page 7 the author set the penalty value to 1.5*log(n), where does this "log(n)" originate from? A bracket ...
1
vote
0answers
9 views

How do i read only lines that fulfil a condition from a csv into R? [migrated]

I am trying to read a large csv file into R. Even though the file is large, I only want to work with some of the rows that fulfil a particular condition (e.g. Variable2 >= 3). This is a much smaller ...
2
votes
1answer
58 views

Remove effect of a factor on continuous proportion data using regression in R

I have a data set of continuous proportions which depend on a fixed-effect factor, e.g.: ...
4
votes
2answers
82 views

Plot Pareto tails in QQ-plot for log-normal distributions

I'm working on samples that I'm trying to fit into log-normal distributions. In some cases, Kolmogorov-Smirnov test statistics is something like D = 0.0056 with an associated p-value of 0. Hence, my ...
0
votes
0answers
15 views

Why naive bayes classifier cannot perform correctly on 1 conditional probability?

I use e1071 package for naive bayes classification. My dataset is having 2 condition/feature (FF1 and FF2) to predict a class of signal (ELO or FP). When I used the following line of code: ...
1
vote
2answers
63 views

How to produce the minimum forecast error using R?

Considering that we want to use optimize() on the interval [0,1] how can I write an R code for finding the value of β that produces the minimum forecast error without using external packages like ...
0
votes
1answer
26 views

Decision Tree - Splitting Factor Variables

I'm new to decision trees and I have some confusion about how factor variables and non-ordered character/string variables get handled in a split. Suppose I have a factor such as "tiny, small, medium, ...
0
votes
0answers
9 views

How to get overlapping edges using igraph? [migrated]

I am trying to create a network graph with overlapping edges. ...