Re: [R] MSE Cross-validation with factor interactions terms MARS regression

2018-10-29 Thread peter dalgaard
The two lines did the same thing, so little wonder... More likely, the culprit is that a is assigned in the global environment, and then used in a prediction on a subset. Also, - you are defining Training, but as far as I can tell, you're not using it. Not likely to be an issue in itself, but

Re: [R] MSE Cross-validation with factor interactions terms MARS regression

2018-10-29 Thread varin sacha via R-help
Hi Bert, Many thanks, I have fixed it but it still don't work... . Best, Le lundi 29 octobre 2018 à 22:07:26 UTC+1, Bert Gunter a écrit : I did no analysis of your code or thought process, but noticed that you had the following two successive lines in your code: y=Testing$wage y

Re: [R] MSE Cross-validation with factor interactions terms MARS regression

2018-10-29 Thread Bert Gunter
I did no analysis of your code or thought process, but noticed that you had the following two successive lines in your code: y=Testing$wage y=Wage[-sam,]$wage This obviously makes no sense, so maybe you should fix this first and then proceed. -- Bert Bert Gunter "The trouble with having an

[R] MSE Cross-validation with factor interactions terms MARS regression

2018-10-29 Thread varin sacha via R-help
Dear R-experts, I am having trouble while doing crossvalidation with a MARS regression including an interaction term between a factor variable (education) and 1 continuous variable (age). How could I solve my problem ? Here below my reproducible example. ### install.packages("ISLR") lib

Re: [R] Gamma Simulation from Exponential Distribution: find sample size given power and sig.Level

2018-10-29 Thread MacQueen, Don via R-help
If this is homework, then r-help has a no homework policy. I'm assuming that if it is homework then the focus is on statistical concepts, not on R programming. It looks like your gen_p_vals function should be defined as gen_p_vals <- function(reps = n) instead of n = reps. Why not just use

Re: [R] date and time data on x axis

2018-10-29 Thread Rui Barradas
Hello, Inline. Às 14:03 de 29/10/2018, snowball0916 escreveu: Hi, Rui Thanks for your code, even though I'm not fully understand it. And I am new to R, could you kindly help me with -1). what's the nested usage stand for? op <- par(mar = c(4, 0, 0, 0) + par("mar")) See the help for ?par. You

Re: [R] "logical indexing, " [was] match() question or needle haystack problem for a data.frame

2018-10-29 Thread MacQueen, Don via R-help
Wrong comparisons, I think. The opposite of A & B is !(A & B) There is no single operator that can replace the "&" in A & B that gives the "opposite" -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509

Re: [R] date and time data on x axis

2018-10-29 Thread MacQueen, Don via R-help
Here's an example of 24 hours of data at one second intervals. npts <- 24*60*60 df <- data.frame( tm = seq( Sys.time(), by='1 sec', length=npts), yd = round(runif(npts),2) ) head(df) with(df, plot(tm,yd)) The x axis appears to me to be display

Re: [R] date and time data on x axis

2018-10-29 Thread snowball0916
Hi, Jim Thanks very much, I will need to study your code, though. Will large volume of data will affect the x axis display? Thanks again. From: jim holtman Date: 2018-10-29 05:53 To: snowball0916 CC: R mailing list Subject: Re: [R] date and time data on x axis You need to specify what the fo

Re: [R] date and time data on x axis

2018-10-29 Thread snowball0916
Hi, Rui Thanks for your code, even though I'm not fully understand it. And I am new to R, could you kindly help me with -1). what's the nested usage stand for? op <- par(mar = c(4, 0, 0, 0) + par("mar")) -2). how can I get the axis.POSIXct usage or help? I use help(axis) and help(POSIXct) and not