This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
So I have an r script that ran great, which I wanted to turn into a macro(s). Thanks to @AmeliaG, and @MarqueeCrew, I was able to get the macro built but my code no longer works. I not get an error (using the same data) "cannot allocated vector of size 141.5 Gb. "
The first macro constructs the formula string (fit <- glm(freq ~ State_bucket + eff_year + channel + marital_status + usage + term + pay_plan + bSpline(age, degree = 1, knots = c(27, 70)) + vehicle_type + bSpline(vehicle_age, degree = 1, knots = c(6, 17)) + bSpline(RBA, degree = 1, knots = c(2750,26750)) + bSpline(vehicle_length, degree= 1, knots = c(45)) + bSpline(Credit, degree = 1, knots = c(375)), family = quasipoisson(link="log"), data = the_data) to be inserted into the 2nd macro (r-script)
The second macro takes the formula string and inserts it via control parameter into the r-script.
When I run the macro though, I get the "cannot allocated vector of size 141.5 Gb. " though even though the workflow will run without being a macro. Can anyone help me figure out why?
Is there any chance that you could package the workflow including macros etc (Options > Export Workflow), so that it's easier to see just what data is being passed and run each of the macros independently?
Thank you for the reply. Yes, you do need splines2. I ended up bringing the string into the r input as a data frame and copying the method used in the out of the box count regression tool to use as a formula.
Thanks sgain for for the reply and I will use that technique next time I run a macro similar to what I have.