This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Math and Science => Technology & Calculator Open Topic
Author Message
MeBeatYou


Member


Joined: 29 Sep 2005
Posts: 178

Posted: 28 Nov 2005 11:40:42 am    Post subject:

Well in math class, we're going over lines of regression. I sat during class and tried to create a program for this but, i realized that you cannot save something such as {5,10} to a variable. Well, you can, but then i want to do PtOn(A and then i get an error. Is there anyway for me to easily save the points and plot them too?

Also, I was wondering how exactly i would calculate the Line of best fit. After getting all the points, my math teach told me that the Ztest button could be used, but I'm not familiar with the graphing functions so I was wondering how to do Ztest correctly or if there is a simpler way?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 28 Nov 2005 01:00:33 pm    Post subject:

Lists should only be stored to list variables: [font="courier new"]{value|[font="courier new"],value,|[font="courier new"]List

To plot a point [font="courier new"]{x,y} using [font="courier new"]L1: [font="courier new"]Pt-On(L1(1),L1(2

For a large-scale set of data, use STAT PLOT—you can specify the plot type, lists, and mark (or how each point appears). [font="courier new"]ZoomStat makes viewing your result much easier. Make sure to toggle the corresponding Plot# from the Y= function screen whenever you need to (typically, to turn it off if you're having errors in graphing). Details regarding the different plot types are found in the manual.

I don't know much about Z-Test, and I'm quite frankly amazed that your teacher suggested it (unless you're in inferential statistics). According to one source, it is "hypothesis testing for the mean of one sample with known variance," and only works if you know the standard deviation of the population, the size of the sample, and the means for both. I would visit this page for information, and consult your manual for the syntax to be used in a program.

Ask your teacher for more help on the subject.

Last edited by Guest on 28 Nov 2005 01:08:43 pm; edited 1 time in total
Back to top
MeBeatYou


Member


Joined: 29 Sep 2005
Posts: 178

Posted: 28 Nov 2005 01:13:05 pm    Post subject:

Well, I came up with this after a while of reading


Code:
ClrHome:ClrDraw
ClrAllLists
Input "Num of Values?",N
For(F,1,N
Input "X= ",A
Input "Y= ",B
A=>L1(F):B=>L2‚(F
End
SetUpEditor L1,L2‚
Plot1(Scatter,L1,L2‚(little box looking thing)
LinReg(ax+b) L1,L2‚
"aX+b"=>Y1
CoordOn:AxesOn
ZoomStat:DispGraph
Text(1,1,"Y= ",a,"X+",b


But, every time i graph, it says Err: Undefined and never graphs the line. Can somebody explain why? This took me about 20 minutes so it wasn't all that hard, but it seemed like it should work out (according to my TI-84 plus manual anyways)
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 28 Nov 2005 01:46:57 pm    Post subject:

I did some optimization as I went along and found no error. Could you tell me where the 2:Goto in the menu brings you?

[font="courier new"]FnOff
ClrHome
ClrDraw
CoordOn
GridOff
AxesOn
PlotsOff
ClrAllLists
SetUpEditor L1,L2
Input "Num of Values? ",N
For(N,1,N
Prompt X,Y
X→L1(N:Y→L2(N
End
LinReg(ax+b) L1,L2,Y1
FnOff 1
Plot1(Scatter,L1,L2,▫
ZoomStat
Line(Xmin,Y1(Xmin),Xmax,Y1(Xmax
Text(0,0,"Y=",a,"X+",b


The TI-84 Plus manual leaves gaping holes in the language and proper use of the calculator. I strongly recommend that (if at all possible) you go out and buy the TI-83 Plus Graphing Calculator Guidebook. There are fair prices on eBay, but even $15 would be worth it in my opinion.
Back to top
MeBeatYou


Member


Joined: 29 Sep 2005
Posts: 178

Posted: 28 Nov 2005 05:12:50 pm    Post subject:

Well, using your optimized code, (as i deleted te old one), the error comes at LinReg(ax+Cool L1,L2,Y1 . I don't think the Y1 is supposed to go there? Maybe I just input the code wrong but in your optimized code, you did not have a place where you specified what Y1 actually should be. Is this wrong or did i just mess up?

[EDIT]
Actually, could you post the code exactly how it should look in the calculator? Because it keeps saying invalid dim even after i delete the Y1. Shouldn't you set up Plot1 before the line of LinReg? Sorry about my bothering you, but I have no knowledge of plots and graphing (well... a little of graphing Razz )


Last edited by Guest on 28 Nov 2005 05:15:53 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 28 Nov 2005 05:32:45 pm    Post subject:

Quote:
I don't think the Y1 is supposed to go there?
[font="courier new"]LinReg(ax+b) L1,L2,Y1 specifies the Xlist, the Ylist, and the function to which the results are then applied. Upon a successful regression, check the function screen and you'll see the equation there. B)

Quote:
Actually, could you post the code exactly how it should look in the calculator?
Um, sure.

[font="courier new"]PROGRAM:BESTFIT
:FnOff
:ClrHome
:ClrDraw
:CoordOn
:GridOff
:AxesOn
:PlotsOff
:ClrAllLists
:SetUpEditor L1,
L2
:Input "Num of V
alues? ",N
:For(N,1,N
:Prompt X,Y
:X→L1(N:Y→L2(N
:End
:LinReg(ax+b) L1
,L2,Y1
:FnOff 1
:Plot1(Scatter,L
1,L2,▫
:ZoomStat
:Line(Xmin,Y1(Xm
in),Xmax,Y1(Xmax

:Text(0,0,"Y=",a
,"X+",b


Quote:
Shouldn't you set up Plot1 before the line of LinReg?
The order of the plot and regression can go either way, as one does not entirely affect the other. I placed the regression before the plot to allow the function to be generated and then shut off before the plot should return to the graph screen.

I really don't know what's going on, as I can't even cause an error on my end. Type it again. :)
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 28 Nov 2005 05:44:22 pm    Post subject:

Quote:
I really don't know what's going on, as I can't even cause an error on my end. Type it again. Smile
L1/L2 probably don't exist (or you are not properly inputting data), and that's an easy fix. That's what I think it is, anyways, because of the dimension error.

Try this:

Code:
PROGRAM:BESTFIT
:FnOff
:ClrHome
:ClrDraw
:CoordOn
:GridOff
:AxesOn
:PlotsOff
:ClrAllLists
:10 -> dim( L1 )    // NEW LINE OF CODE
:10 -> dim( L2 )    // NEW LINE OF CODE
:SetUpEditor L1,
L2
:Input "Num of V
alues? ",N
:For(N,1,N
:Prompt X,Y
:X→L1(N:Y→L2(N
:End
:LinReg(ax+b) L1
,L2,Y1
:FnOff 1
:Plot1(Scatter,L
1,L2,▫
:ZoomStat
:Line(Xmin,Y1(Xm
in),Xmax,Y1(Xmax

:Text(0,0,"Y=",a
,"X+",b


Last edited by Guest on 28 Nov 2005 05:44:54 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 28 Nov 2005 05:50:02 pm    Post subject:

1. That won't help, since SetUpEditor will create the lists for you if they don't exist, and if it hadn't then storing to their elements will.
2. Please.. take out ClrAllLists. It's a bad command; could destroy valuable data.
3. Replace SetUpEditor L1,L2 with DelVar L1DelVar L2
4. These just make the code better, I still don't know what the error is.
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 30 Nov 2005 12:45:59 am    Post subject:

The line "For(N,1,N" is suspicious to me... ;)

I'll be back in a few ___ with a nice rewrite...

thornahawk
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 30 Nov 2005 01:40:36 am    Post subject:

[font="courier new"]For(N,1,N looks at the value of [font="courier new"]N and copies it over during the setup. The end argument remains fixed.

[font="courier new"]1→B
For(A,0,B
B+1→B
End


The above code actually terminates. Once [font="courier new"]B is construed, the interpreter won't be back for a checkup. Wink

Last edited by Guest on 30 Nov 2005 01:40:56 am; edited 1 time in total
Back to top
elfprince13
Retired


Super Elite (Last Title)


Joined: 11 Apr 2005
Posts: 3500

Posted: 30 Nov 2005 09:43:30 pm    Post subject:

Weregoose wrote:
The TI_84 Plus manual leaves gaping holes in the language and proper use of the calculator. I strongly recommend that (if at all possible) you go out and buy the TI-83 Plus Graphing Calculator Guidebook. There are fair prices on eBay, but even $15 would be worth it in my opinion.


Or download it from TI, and make sure you have plenty of paper,
Back to top
alexrudd
pm me if you read this


Bandwidth Hog


Joined: 06 Oct 2004
Posts: 2335

Posted: 30 Nov 2005 11:29:10 pm    Post subject:

elfprince13 wrote:
Weregoose wrote:
The TI_84 Plus manual leaves gaping holes in the language and proper use of the calculator. I strongly recommend that (if at all possible) you go out and buy the TI-83 Plus Graphing Calculator Guidebook. There are fair prices on eBay, but even $15 would be worth it in my opinion.
Or download it from TI, and make sure you have plenty of paper, [post="62808"]<{POST_SNAPBACK}>[/post]
eBook program for calculator?


To prempt the question that I know is coming:
LinReg(ax+b is the same thing as LinReg(bx+a, just switched around. There is no other difference whatsoever.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement