Polynomial regression

Hi devs! I am developing a function to build a polynomial regression. When I pass the polynomial formula as parameter from client to server-side, the server return an error like "Bad Request (400): Encountered " “(” "( “” at line 1, column 39. Was expecting one of: <F_OPERATOR> … <COMMON_OPERATOR> … “,” … “)” … " I tried to use the formula like ‘D$height ~ D$diameter + poly(D$length,3,raw=TRUE)’ as a String, but in this case the server returns “Bad Request (400)”. Someone had a similar problem with that?


Sorry, I have not seen that error message before.

Have you looked at the log files in “/var/log/opal”, on the machine running the opal server, to see if there is any other information about the problem?



The Datashield R parser does not allow function calls in a formula.

@swheater @olly should this be supported?


1 Like


@yannick this should not be supported at the current stage of DataSHIELD. But let’s think if it does not lead to any disclosure attacks, we can allow it in the future.

@paularaissa you can send the variables and the order of the polynomial to the server-side as single objects, and then create the formula there.

1 Like

Hi all

Happy to discuss this at workshop. Polynomial regression is one of those things that has been at the back of my mind but nobody has asked for it before in DataSHIELD. paul

Hi guys

In principle this should be straightforward as we already fit models equivalent to this but problem - as Yannick says - is that at present parser will not allow regression formula in this form to be passed to server. But I think I see a way to solve that. As I said let’s discuss at workshop. Paul

1 Like