Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:16:49+00:00 2026-05-27T07:16:49+00:00

I have a curve produced by the code below in R/Sweave : \documentclass[a4paper,12pt]{article} \usepackage{Sweave}

  • 0

I have a curve produced by the code below in R/Sweave:

 \documentclass[a4paper,12pt]{article}
 \usepackage{Sweave}  %%%%%%
 \SweaveOpts{eps=TRUE}

 \begin{document}

<<echo=FALSE, results=hide>>=
test.frame<-data.frame(ratio= c(0.0, 144.321, 159.407, 178.413, 202.557), value= c(0, 0.84, 0.8925, 0.945, 0.9975))
@


<<echo=FALSE,results=hide,eval=TRUE>>=
postscript('doudou.eps',
           width=7, height=6,
           colormodel="cmyk",
           family = "ComputerModern",
           horizontal = FALSE,
           onefile=FALSE,
           paper = "special",
           encoding = "TeXtext.enc",
           pagecentre=FALSE)

with(test.frame,plot(ratio, value, ylab= "Hello",
                               xlab="Wonderful",
                               type="o",        
                               bty="o",         
                               lty="solid",     
                               lwd=3,            
                               pch=1,            
                               xaxp=c(0, 200, 4),  
                               xlim=c(0,200),
                               yaxt = "n",         
                               main=" My curve"))

axis(2,seq(0,1, by=0.5), las=2,cex=3,cex.lab=2,cex.axis=1.5,cex.main=2)

dev.off()
@

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.8\textwidth]{doudou.eps}
\end{figure}


\end{document}

The curve has a x = +\sqrt(y) behaviour. I need to draw the maximum slope from the first point of the curve that is tangent to the initial curve slope. How to calculate the parameters with R so that I get the equation of the line?

An approximate solution is to find a best fit line but then the initial point (0, 0) of the dataset does not form part of the fitted line (we get a y-intercept other than zero).

Thanks a lot…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:16:50+00:00Added an answer on May 27, 2026 at 7:16 am

    Your graph has five points: one at 0 and four between 144 and 203, so I don’t think you can say much about behaviour near 0.

    test.frame<-data.frame(ratio= c(0.0, 144.321, 159.407, 178.413, 202.557), 
                           value= c(0, 0.84, 0.8925, 0.945, 0.9975))
    with(test.frame,plot(ratio, value, ylab= "Hello", xlab="Wonderful", type="o",
                         bty="o", lty="solid", lwd=3, pch=1, xaxp=c(0, 200, 4),  
                         xlim=c(0,200), yaxt = "n", main=" My curve") )
    axis(2,seq(0,1, by=0.5), las=2,cex=3,cex.lab=2,cex.axis=1.5,cex.main=2)
    

    enter image description here

    You can get the slope of the first segment with

    > with(test.frame, (value[2]-value[1])/(ratio[2]-ratio[1]) )
    [1] 0.005820359
    

    Or you can put a line through all the points restricted to going through the origin with

    > with(test.frame, lm(value ~ ratio - 1 ) )
    Coefficients:
       ratio  
    0.005325  
    

    Or you can take your square-root function, which I think (but am not sure) you might intend to be

    > with(test.frame, lm(value ~ sqrt(ratio) - 1 ) )
    Coefficients:
    sqrt(ratio)  
        0.07037  
    

    but in this case, note that the gradient of the tangent of y = 0.07 sqrt(x) is infinite at 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 10 period cost curve table below. How do I programmatically collapse/condense/shrink
I have a parametric curve, say two vectors of doubles where the parameter is
If you have an elliptic curve in the form of: y^2 = x^3 +
It's one of those things that seems to have an odd curve where the
I have a quadratic bezier curve and I want to calculate the slope of
New to wpf and through a learning curve. I have a userControl with a
Have you guys had any experiences (positive or negative) by placing your source code/solution
I have this curve that contains certain peaks - I want to know how
I have a bezier curve B with points S, C1, C2, E, and a
I have a quadratic bezier curve described as (startX, startY) to (anchorX, anchorY) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.