[R] Indifference curve

Rui Barradas ruipbarradas at sapo.pt
Sat Jun 30 12:54:41 CEST 2012


Hello,

Is this it?


u <- function(x, y) 3*x^2 + 2*y

x <- seq(-10, 10, by=1)
y <- seq(0, 150, by=1)
a <- c(100, 200, 300)

persp(x, y, outer(x, y, u), ticktype="detailed")
contour(x, y, outer(x, y, u), levels=a)

Hope this helps,

Rui Barradas

Em 28-06-2012 10:13, Akhil dua escreveu:
> Hello everyone I am new to R
>
> I need to plot 3 indifference curve for the level 100, 200 and 300
>
> my utility function is of the form u(x,y)=3x^2+2y
>
> I also need to draw contour line on it
>
> can any one please tell me how to do it????
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list