Questions tagged as 'r'

2
answers

How to filter data from a data frame in R?

I have a data frame (out.predict.garch) in, what I want to get is to filter the data following the condition that the variables out.predict.garch $ name is equal to one of the levels (ibex) (that if it is done) and that the variable out.predict....
asked by 16.11.2018 / 10:26
2
answers

Ifelse does not work, any ideas?

I have this function to process a database that I am using, the issue is that the result only classifies everything as "public" and does not seem to detect the other condition, any suggestions? sectorlaboral = function (funcionariopublicoinsti...
asked by 13.02.2018 / 21:04
1
answer

I can not predict new observations with predict ()

Ok then I have the following information: A<-c(.04,.10,.16,.28,.04,.10,.16,.28,.04,.10,.16,.28) Gain<-c(680.2,721.4,750.4,789.4,672.2,709.2,731.2,778.2,668.4,715.6,732.0,794.0) So I want to predict a new observations that is .20 using...
asked by 27.11.2017 / 01:55
1
answer

Plot (or graph) an lm

Calculate a polynomial regression model based on data obtained from the field, my problem is to graph them showing the points. I leave the script and a sample of data, plus a graph of a non-linear model to be a sample of what I'm looking for....
asked by 26.11.2017 / 21:00
1
answer

Random Forest in R

I am practicing with the well-known Kaggle Titanic challenge for R and this is what I have in code but I have stalled because it tells me that there are missing values in the object. #Seleccionamos el directorio donde iremos cogiendo los archi...
asked by 13.10.2017 / 18:33
1
answer

Fix a single level of variable when running linear regressions in R

I have the following simple linear model in R: xmdl <- lm(Voto ~ Edad + Educacion, data = datostotales) summary(xmdl) Imagine that "Age" is a variable with values ranging from 20 to 100 (in discrete steps of 1), and that "Educ...
asked by 10.10.2017 / 17:49
2
answers

Tags and legend to two variables ggplot

I have been trying to label several variables in the same graph in ggplot. The following example clarifies the question: df<-data.frame("a"=rnorm(100,150,30), "b"=rnorm(100,150,30),"c"=rnorm(100,150,30)) ggplot(data=df,aes())+geom_density(...
asked by 26.09.2017 / 05:20
1
answer

Error in ogrInfo (dsn = dsn,

Colleagues. When I read another file that is in the same folder in the work environment, it appears: source("Functions.R") Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Cannot open data source...
asked by 03.08.2017 / 21:05
1
answer

Building functions in Rstudio

From the data (Cereal) in Lock5data, how can I create a function that, when supplying the arguments: calories and fat shows the name of the cereal as output? For example: suppose that the function named Flakes has already been created and w...
asked by 16.06.2017 / 05:03
1
answer

Generalized Linear Models in Python

Do you know if you can define a Generalized Linear Model for a random variable with Gamma distribution in Python? Or will I have to settle for R? If it is possible, please attach tutorials, guides, documentation, examples ...     
asked by 10.06.2017 / 03:46