Code needed in R language

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
raishikoh
Posts: 1
Joined: Sun Mar 02, 2014 6:05 pm

Code needed in R language

Post by raishikoh » Sun Mar 02, 2014 6:13 pm

Hello everyone
I hope that you are fine. Because I am starter, I am facing difficulties in figuring out commands that do the following:

Find the sample mean M and sample standard deviation S
Build the histogram.
Find if the shape of the distribution is close to normal or not.
Add to the histogram plot the line corresponding to the probability density function of the normal distribution using obtained mean and standard deviation.
Set up a 95% CI for the sample mean, using your values of M,S and N

Use the temperature (tempc and tempf) data given in the excel sheet. You can download the excel sheet from following link:
app.box.co m/s/8uw6os46iibmx4n5t21q (remove space between box.co m)

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Code needed in R language

Post by Klaus » Sun Mar 02, 2014 6:32 pm

Hi raishikoh,

1. welcome to the forum! :D

2. I don't have the slightest idea what you are talking about and if this has any relation to Livecode 8)


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10096
Joined: Fri Feb 19, 2010 10:17 am

Re: Code needed in R language

Post by richmond62 » Tue Mar 04, 2014 8:02 pm

#raishikoh

I have a feeling that you need to work out the algorithms for those statistical operations:

actually, if you are bit lazy like me, you can probably find them either in a high school Maths textbook
or by looking on the internet.

I remember finding means (that, at least is very easy) and standard deviation (which is not)
about 35 years ago when I was at school.

After all, all you have to do to find the mean is to add up a column of figures and divide the sum by the number of rows in the column.

After that you have to work out how to express those statistical operations in Livecode.

Then you have to work out how to extract values from an Excel spreadsheet.

And' lastly, how to get a bar chart up and running in Livecode.
--------------------------------------------------------------------------------------

The fact that you give a link to your spreadsheet gives me, at least, the impression
that you want somebody else to do the coding for you.

On these Forums and the Use-List you will find lots of people ready to advise you,
help you and so on, but I don't think you should really expect then to do all the code
work.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Code needed in R language

Post by FourthWorld » Tue Mar 04, 2014 10:05 pm

@raishikoh: If you need this done in R specifically, have you considered posting your question at R-Help?
https://stat.ethz.ch/mailman/listinfo/r-help
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Code needed in R language

Post by MaxV » Mon Apr 07, 2014 3:40 pm

Given a x collection of data, using R you to obtain a simple mean you digit:

Code: Select all

mean(x)
Using livecode you can write your mean function:

Code: Select all

function mean  data
 put 0 into counter
 put 0 into total
 repeat for each word temp in data
  add temp to total
  add 1 to counter
 end repeat
 put total / counter into y
 return y
end mean

put "1 2 3 4 5 6 12.3 15" into x
answer mean(x)
And so on for the other functions.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Code needed in R language

Post by jacque » Mon Apr 07, 2014 5:42 pm

MaxV wrote:Given a x collection of data, using R you to obtain a simple mean you digit:

Code: Select all

mean(x)
Using livecode you can write your mean function:

Code: Select all

function mean  data
 put 0 into counter
 put 0 into total
 repeat for each word temp in data
  add temp to total
  add 1 to counter
 end repeat
 put total / counter into y
 return y
end mean

put "1 2 3 4 5 6 12.3 15" into x
answer mean(x)
And so on for the other functions.
Or just use the built-in "average" function which does the same thing. ;)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply